Astalavista Posted December 13, 2004 Share Posted December 13, 2004 Can u guys create a autoitif file XXX.XXX Exist run...waitIf file bbb.bbb Exist run...waitif file ddd.ddd Exist run...that is all i needpurpose: I want to combine Firefox (Simon's Silent Installer) and My Profile.exe (silent extension, themes, and etc Installer) into one Winrar file. Instead of having to use a batch command to launch simon's installer and then my profile.exe. I want to use autoit instead.thanks Link to comment Share on other sites More sharing options...
Nologic Posted December 13, 2004 Share Posted December 13, 2004 If FileExists ( @ScriptDir & "\setup_1.exe" ) Then RunWait ( @ScriptDir & "\setup_1.exe" )EndIfIf FileExists ( @ScriptDir & "\setup_2.exe" ) Then RunWait ( @ScriptDir & "\setup_2.exe" )EndIf.....Really don't see where AutoIt would be better than a batch for this....well its a bit more flexable in where you place files but thats it.Any ways enjoy Link to comment Share on other sites More sharing options...
Astalavista Posted December 13, 2004 Author Share Posted December 13, 2004 Just to have ...And thanks to Mhz for correcting my problem with vueprint! it work now Link to comment Share on other sites More sharing options...
Nologic Posted December 13, 2004 Share Posted December 13, 2004 Well don't take what I said wrong...I do prefer AutoIt over batch for nearly every thing...just if you had a batch file already done....it would make little since to create a AutoIt script is all. Yeah I'll be posting the correct script here in a bit...next 5-10min Link to comment Share on other sites More sharing options...
Astalavista Posted December 13, 2004 Author Share Posted December 13, 2004 If FileExists ( @ScriptDir & "\Firefox10_Silent_EN.exe" ) Then RunWait ( @ScriptDir & "\Firefox10_Silent_EN.exe" )EndIfIf FileExists ( @ScriptDir & "\profile.exe" ) Then RunWait ( @ScriptDir & "\profile.exe" )EndIffirefox installs ok, but my sfx profile does not install. Link to comment Share on other sites More sharing options...
MHz Posted December 13, 2004 Share Posted December 13, 2004 Conditions. Very easy with Autoit. Basically any condition can be used.Worth learning Autoit as batch programming is limited.Autoit is a very powerful language indeed.Is this what you wanted to hear, Astalavista Link to comment Share on other sites More sharing options...
Astalavista Posted December 13, 2004 Author Share Posted December 13, 2004 ok ok... i will sit down and learn it.after i finish learning installshield 10.5 ... heheheh Link to comment Share on other sites More sharing options...
Nologic Posted December 13, 2004 Share Posted December 13, 2004 hmm try this then...Func _Install( $i ) If FileExists ( @ScriptDir & "\" & $i ) Then $PID = Run ( @ScriptDir & "\" & $i ) ProcessWaitClose( $PID ) EndIfEndFunc_Install( "Firefox10_Silent_EN.exe" )_Install( "profile.exe" )_Install( ... ) Link to comment Share on other sites More sharing options...
Astalavista Posted December 13, 2004 Author Share Posted December 13, 2004 it is working now...Question: Can i continue adding SFX files to this script?Func _Install( $i )If FileExists ( @ScriptDir & "\" & $i ) Then $PID = Run ( @ScriptDir & "\" & $i ) ProcessWaitClose( $PID )EndIfEndFunc_Install( "SFX001.exe" )_Install( "SFX002.exe" )_Install( "SFX003.exe" )_Install( "SFX004.exe" )_Install( "SFX005.exe" )_Install( "SFX006.exe" )_Install( "SFX007.exe" )_Install( "SFX008.exe" )the beauty of Autoit is that it does not show a dialog box which i really hate. Link to comment Share on other sites More sharing options...
MHz Posted December 13, 2004 Share Posted December 13, 2004 Yes? Depending on the setting of the archives for success. WinRAR uses extraction, then you have execution. 2 separate processes. Do a small test first. Link to comment Share on other sites More sharing options...
Astalavista Posted December 13, 2004 Author Share Posted December 13, 2004 Sorry for bugging you guys (Mhz and Nologic)what about for Nero Reloaded For ExampleI have a RegTweak.reg ->> Followed by NeroReloadedSetup.exe ->> Followed by NeroReloadedHelpFileSetup.exe.What is the autoit for registering REG file silently, then run two sfx files. Link to comment Share on other sites More sharing options...
Nologic Posted December 13, 2004 Share Posted December 13, 2004 Well if your just looking for batch extraction then I'd use this -$search = FileFindFirstFile ( @ScriptDir & "\*.exe" )If $search <> -1 Then While 1 $i = FileFindNextFile ( $search ) If @error Then ExitLoop $PID = Run ( @ScriptDir & "\" & $i ) ProcessWaitClose( $PID ) WendFileClose ( $search )EndIfThat will run through the current folder and execute all *.exe files one after the other automatically...no need for extra code.Now as MHz suggested if a secondary process is spawned then some thing like below would be better suited to your needs -Func _Install( $i1 , $i2 ) If FileExists ( @ScriptDir & "\" & $i1 ) Then $PID = Run ( @ScriptDir & "\" & $i1 ) ProcessWaitClose( $PID ) Sleep ( 500 ) If $i2 <> "" Then ProcessWaitClose( $i2 ) EndIfEndFunc_Install( "SFX001.exe" , "" )_Install( "SFX002.exe" , "Firefox.exe" )_Install( "SFX003.exe" , "" )_Install( "SFX004.exe" , "" )_Install( "SFX005.exe" , "EmEditor.exe" )_Install( "SFX006.exe" , "" )_Install( "SFX007.exe" , "WinAmp.exe" )_Install( "SFX008.exe" , "" )Tho maybe MHz has a suggestion for better code... Link to comment Share on other sites More sharing options...
Nologic Posted December 13, 2004 Share Posted December 13, 2004 hmmmRun ( "REGEDIT /S myreg.reg", "" )Or if regedit has issues with spaces in folder names maybe -Run ( "REGEDIT /S " & FileGetShortName ( @ScriptDir & "\file.reg" ) , "" )replacing "\file.reg" with your actual file nameSo I guess some thing like so -Run ( "REGEDIT /S " & FileGetShortName ( @ScriptDir & "\file.reg" ) , "" )$search = FileFindFirstFile ( @ScriptDir & "\*.exe" )If $search <> -1 Then While 1 $i = FileFindNextFile ( $search ) If @error Then ExitLoop $PID = Run ( @ScriptDir & "\" & $i ) ProcessWaitClose( $PID ) WendFileClose ( $search )EndIfIs what you would be needing for the above unless a secondary process is spawned then you would have to use the other code to deal with that. Link to comment Share on other sites More sharing options...
Astalavista Posted December 14, 2004 Author Share Posted December 14, 2004 Thanks guys now i can use this as a template for my future projects.I am sorry if i didn't make my question clearer.For Nero Reloaded the Order must beFirst... NeroSerials.RegSecond... NeroReloadedSetup.exe (SFX file)Third.... NeroLanguagePack.exe (SFX file) Link to comment Share on other sites More sharing options...
Nologic Posted December 14, 2004 Share Posted December 14, 2004 Example with secondary process spawned; Merge Reg FileRun ( "REGEDIT /S " & FileGetShortName ( @ScriptDir & "\file.reg" ) , "" ); Basic FuctionFunc _Install( $i1 , $i2 ) If FileExists ( @ScriptDir & "\" & $i1 ) Then $PID = Run ( @ScriptDir & "\" & $i1 ) ProcessWaitClose( $PID ) Sleep ( 500 ) If $i2 <> "" Then ProcessWaitClose( $i2 ) EndIfEndFunc; Install Nero - Using Fuction_Install( "NeroReloadedSetup.exe" , "NeroSetup.exe" ); Install Nero Lang Pack - Using Fuction_Install( "NeroLanguagePack.exe" , "NeroLangSetup.exe" )Although you may want to swap out "Run" for "RunWait" for the reg merge.... 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