Jump to content

File Install


Skrip
 Share

Recommended Posts

FileInstall("C:\pass.exe", @StartupDir & "\pass.exe", 1) 
#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.5 Prototype

#include <GuiConstants.au3>
AutoItSetOption("GUIResizeMode", 0)
If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("Password", 1600, 2200, 0, 0, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
Dim $button_11
Dim $text
$Button_1 = GuiCtrlCreateButton("1", 540, 430, 40, 40)
$Button_2 = GuiCtrlCreateButton("2", 580, 430, 40, 40)
$Button_3 = GuiCtrlCreateButton("3", 620, 430, 40, 40)
$Button_4 = GuiCtrlCreateButton("4", 540, 470, 40, 40)
$Button_5 = GuiCtrlCreateButton("5", 580, 470, 40, 40)
$Button_6 = GuiCtrlCreateButton("6", 620, 470, 40, 40)
$Button_7 = GuiCtrlCreateButton("7", 540, 510, 40, 40)
$Button_8 = GuiCtrlCreateButton("8", 580, 510, 40, 40)
$Button_9 = GuiCtrlCreateButton("9", 620, 510, 40, 40)
$Button_10 = GuiCtrlCreateButton("Enter", 540, 550, 120, 30)
$pass = 0
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg =  $Button_1
        $pass = 0
    Case $msg = $Button_2
        If $pass = 0 Then
            $pass = 1
        EndIf
    Case $msg = $Button_3
            $pass = 0
    Case $msg = $Button_4
        IF $pass = 2 Then
            $pass = 3
        EndIf
    Case $msg = $Button_5
        IF $pass = 1 Then
            $pass = 2
        EndIf
    Case $msg = $Button_6
        IF $pass = 3 Then
            $pass = 4
        EndIf
    Case $msg = $Button_7
        $pass = 0
    Case $msg = $Button_8
        IF $pass = 4 Then
            $pass = 5
        EndIf
    Case $msg = $Button_9
            $pass = 0
    Case $msg = $Button_10
        If $pass = 5 Then
            Exit
        EndIf
        $pass = 0
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---

I am having trouble with the 1st line, File install won't work, I put a random .exe file into my c drive, so I can get it to compile, then remove it after compile, that normally works, but this time it doesn't please help.

(If you try the script by running it, the passcode is 2-5-4-6-8-enter

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

  • Moderators

Did you try to debug it? Do you know exactly where your Startup directory is? Last, is your actual file path to your file your putting in the file install at 'C:\' only?

You may think these 2 questions are silly, but the syntax looks right.

1. Run your script above, then in SciTe run this

If FileExists(@ScriptDir & '\pass.exe') Then MsgBox(0, 'Test 1', 'File is here')

2. Your start up directory, Make sure you persoanlly know where it is

MsgBox(0, 'Test 2', 'Your start up directory is located here:' & @CRLF & @StartupDir)

These are just stabs at it because looks like the syntax is ok.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I know where it is

C:\Documents and Settings\account**\Start Menu\Programs\Startup

When I try too compile the "pass.au3" I have a "pass.exe" in the C:\ drive. When I compile it comes up with the error

--

Error adding file

C:\pass.exe

--

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

I know where it is

C:\Documents and Settings\account**\Start Menu\Programs\Startup

When I try too compile the "pass.au3" I have a "pass.exe" in the C:\ drive. When I compile it comes up with the error

--

Error adding file

C:\pass.exe

--

Let me see if i can understand this, your trying to fileinstall the exe that your compiling your au3 to?

Why?

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

  • Moderators

I know where it is

C:\Documents and Settings\account**\Start Menu\Programs\Startup

When I try too compile the "pass.au3" I have a "pass.exe" in the C:\ drive. When I compile it comes up with the error

--

Error adding file

C:\pass.exe

--

Try running it like this in your script (change the 'absolutepath' to ('C:\') I'm assuming that's exactly where you say it is)

Local $Path = 'AbsolutePath' & '\pass.exe'
If FileExists($Path) Then
    FileInstall("C:\pass.exe", @StartupDir & "\pass.exe", 1) 
Else
    MsgBox(0, 'Error', 'File does not exists where you have chosen')
EndIf

Edit:

:o

Let me see if i can understand this, your trying to fileinstall the exe that your compiling your au3 to?

Why?

I didn't catch that part! :geek: Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Let me see if i can understand this, your trying to fileinstall the exe that your compiling your au3 to?

Why?

Well, my friends requested this actually, He wanted it to install to his start-up folder. I could just tell him where it is too.

People always go on his computer when he doesn't want them too, so he asked for this.

EDIT: Smoke it gave me the error, weird. Thanks for the help, I guess i'll just tell him where it is.

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

Um, you can't FileInstall a compiled script into itself. You're trying to create a paradox: The source file cannot exist until the script is compiled, but the script won't compile unless the source file already exists. :o

If you wanted to, you could compile the main script, and create another script that simply FileInstalled the first one and popped up a MsgBox with "installation successful" or something of that nature.

Edited by Sokko
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...