MykeV Posted August 31, 2006 Share Posted August 31, 2006 All, I need some help figuring out how to make this statement work. I'm using AutoIt to silently install a program and setup up some custom program links. Since I can't tell when the installation completes, I figured i would create an "IF" statement that would copy the links to the necessary folders once the program executable existed. I want the "IF" statement to keep repeating until the "FileExist" statement is true. What am i doing wrong. ;Program Install (silent mode) Run (@WorkingDir & "\8003\setup.exe -s") ;Copying File Links $C1 = @WorkingDir & "\misc\dynacomm.lnk" $C2 = @WorkingDir & "\misc\session1.ses" $C3 = @WorkingDir & "\misc\standard1.*" While 1 If FileExists (@ProgramFilesDir & "\Futuresoft\DCSeries\dseries.exe") Then FileCopy ($C1 , @DesktopDir,1) FileCopy ($C2 , @ProgramFilesDir & "\Futuresoft\DCSeries\session",1) FileCopy ($C3 , @ProgramFilesDir & "\Futuresoft\DCSeries\maps",1) EndIf WEnd Exit Link to comment Share on other sites More sharing options...
Valuater Posted August 31, 2006 Share Posted August 31, 2006 (edited) maybe... ;Program Install (silent mode) If FileExists(@WorkingDir & "\8003\setup.exe") Then $run_file = FileGetShortName(@WorkingDir & "\8003\setup.exe") Run ($run_file & " -s") ;Copying File Links $C1 = @WorkingDir & "\misc\dynacomm.lnk" $C2 = @WorkingDir & "\misc\session1.ses" $C3 = @WorkingDir & "\misc\standard1.*" While 1 If FileExists (@ProgramFilesDir & "\Futuresoft\DCSeries\dseries.exe") Then FileCopy ($C1 , @DesktopDir,1) FileCopy ($C2 , @ProgramFilesDir & "\Futuresoft\DCSeries\session",9) FileCopy ($C3 , @ProgramFilesDir & "\Futuresoft\DCSeries\maps",9) ExitLoop EndIf Sleep(100) WEnd EndIf Exit 8) Edited August 31, 2006 by Valuater Link to comment Share on other sites More sharing options...
MykeV Posted September 1, 2006 Author Share Posted September 1, 2006 Thanks for the help V. 2 questions? 1. What is served by making the entire script an "IF" statement? 2. What purpose does the "FileGetShortName" function serve? Again. Thanks for your help. maybe... ;Program Install (silent mode) If FileExists(@WorkingDir & "\8003\setup.exe") Then $run_file = FileGetShortName(@WorkingDir & "\8003\setup.exe") Run ($run_file & " -s") ;Copying File Links $C1 = @WorkingDir & "\misc\dynacomm.lnk" $C2 = @WorkingDir & "\misc\session1.ses" $C3 = @WorkingDir & "\misc\standard1.*" While 1 If FileExists (@ProgramFilesDir & "\Futuresoft\DCSeries\dseries.exe") Then FileCopy ($C1 , @DesktopDir,1) FileCopy ($C2 , @ProgramFilesDir & "\Futuresoft\DCSeries\session",9) FileCopy ($C3 , @ProgramFilesDir & "\Futuresoft\DCSeries\maps",9) ExitLoop EndIf Sleep(100) WEnd EndIf Exit 8) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 1, 2006 Moderators Share Posted September 1, 2006 "If" is exactly that, it's conditional, you only want to do something if the condition is true or untrure. FileGetShortName helps in run commands because spaces in the path sometimes will give you run errors, FileGetShortName() has no spaces in the path. 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 More sharing options...
Valuater Posted September 1, 2006 Share Posted September 1, 2006 "If" is exactly that, it's conditional, you only want to do something if the condition is true or untrure.FileGetShortName helps in run commands because spaces in the path sometimes will give you run errors, FileGetShortName() has no spaces in the path.exactly, I didn't know if you were running into errors with thisRun (@WorkingDir & "\8003\setup.exe -s")8) Link to comment Share on other sites More sharing options...
MykeV Posted September 4, 2006 Author Share Posted September 4, 2006 Thanks for the assist fellas. I appreciate it. Long Live AutoIT!!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now