Pete_ Posted August 23, 2006 Share Posted August 23, 2006 (edited) Hi!I made few of my setups with AutoIT, now i tryed to install XP with Virtual PC, and saw what happend. Autoit script setups didn't start install, they made errors, because they tried to look the original exe from my WINXP\$OEM$\... folder, and ofcourse didn't find it because the map drive was changed like C:\install, how do define in my script to look for the original exe from %systemdrive%\install\Applications\ ? Edited August 23, 2006 by Pete_ Link to comment Share on other sites More sharing options...
MHz Posted August 23, 2006 Share Posted August 23, 2006 I do not understand you method os software deployment i.e. RunOnceEx, GuiRunOnce... and when you are deploying the software. I do not know where your AutoIt scripts are i.e. perhaps in $OEM$ folder somewhere? If your scripts are in the same directory as the installers, are you using @ScriptDir to path to the files?For all I know, it could be that you are hardcoding the paths? But a wild guess as I have not enough information to help you . Link to comment Share on other sites More sharing options...
Pete_ Posted August 23, 2006 Author Share Posted August 23, 2006 The script exe:s made from au3 files are in the same directory than original setup exe:s i.e %systemdrive%\install\Applications\The script exe is right, because its defined in RunOnceEx to be in %systemdrive%\install\Applications,but the original exe,isn't defined, and its in C:\$OEM$\install\App... during I made the script from it, so now when it tries to install in Windows startup, it tries to find the original exe from that place not from %systemdrive% ..... -> C:\install Link to comment Share on other sites More sharing options...
MHz Posted August 23, 2006 Share Posted August 23, 2006 Would you be able to show your RunOnceEx that shows it as entering this information for the script.exe's. Also show me the Run() functions used in the Au3 scripts. Link to comment Share on other sites More sharing options...
Pete_ Posted August 23, 2006 Author Share Posted August 23, 2006 Yes, you were right, the Run() path was wrong it was (C:\WINXP\....), i corrected it now to%systemdrive%\install\Applications\, should now work fine I just deleted the au3 files, when I made exe's of them, (thought I don't need them anymore ), but ofcourse they needed editing! ;DThanks again MHz Link to comment Share on other sites More sharing options...
Daedlus Posted August 24, 2006 Share Posted August 24, 2006 In the Extras folder of autoit in the start menu there will be a folder called extras... there you can find a decompile command allowing you to change the .exe back to .au3. Whenever I use autoit scripts I always put them in the same dir as the setup.exe and dont use a path. EX:Run ( "Setup.exe" )that way you wont run into this problem. Link to comment Share on other sites More sharing options...
Pete_ Posted August 24, 2006 Author Share Posted August 24, 2006 In the Extras folder of autoit in the start menu there will be a folder called extras... there you can find a decompile command allowing you to change the .exe back to .au3. Whenever I use autoit scripts I always put them in the same dir as the setup.exe and dont use a path. EX:Run ( "Setup.exe" )that way you wont run into this problem.Thank you for the tip, Daedlus Link to comment Share on other sites More sharing options...
Pete_ Posted August 28, 2006 Author Share Posted August 28, 2006 Still got problems, I modified the script to Run("%systemdrive%\install\Applications\RegCleaner.exe")But it seems that AutoIT wont regognize the %systemdrive%, because when i tryed this with Virtual, it popuped error when trying to find the exe from %systemdrive% not from C:\ Link to comment Share on other sites More sharing options...
oneless Posted August 28, 2006 Share Posted August 28, 2006 Run( @SystemDir & "\install\Applications\RegCleaner.exe") ? Link to comment Share on other sites More sharing options...
MHz Posted August 29, 2006 Share Posted August 29, 2006 @DaedlusYour relative addressing can fail as you show that you do not check the working directory and change it if needed. To ensure you concept will indeed work, check as the example below shows before using it.If @WorkingDir <> @ScriptDir Then FileChangeDir(@ScriptDir)EndIfChanging Working Directory within a script is a powerful thing to use, so I praise it's good use, but the script should always know it before relative use.@onelessYour in the system32 folder? Using a macro is a good idea also, though using @ScriptDir maybe better to use. @PeteI thought we covered this in the other topic? If your script is in the same directory as for example "RegCleaner.exe", then just doLike Daedlus shows, but check Working Directory firstIf @WorkingDir <> @ScriptDir Then FileChangeDir(@ScriptDir)EndIfRun("RegCleaner.exe")Or as oneless is refering to as in using an absolute address with a macroRun(@ScriptDir & "\RegCleaner.exe")Else, if you want to expand environmental variables in your string, then like thisOpt('ExpandEnvStrings', 1)Run("%systemdrive%\install\Applications\RegCleaner.exe")The top 2 methods are considered better IMHO, as you are not hardcoding the path. You can also expand variables or even use EnvGet() for getting envronmental variables, but you already have good choice to select from to get it right. 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