McGyver Posted October 19, 2006 Posted October 19, 2006 Hope you folks can help me. I am rather new at this and am having a small problem with one of my automated installs. The install program updates part of the path in the registry, and I thought the script I wrote took care of making the path work for the install, but I get a missing dll when I call the last part of the script. If I run the script a second time, everything works fine. Any help you can offer would be gran $SysPath = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment", "Path") $SysAdd = ";C:\Program Files\WallData\System" $MergePath = $SysPath & $SysAdd RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment", "Path", "REG_EXPAND_SZ", $MergePath) EnvSet("path",EnvGet("path") & ";C:\Program Files\WallData\System") RunWait("cmd") EnvUpdate() ; Adjust RUMBA Mainframe Display Run("C:\Program Files\WallData\Mframe\Rumbadsp.exe")
PsaltyDS Posted October 19, 2006 Posted October 19, 2006 (edited) Hope you folks can help me. I am rather new at this and am having a small problem with one of my automated installs. The install program updates part of the path in the registry, and I thought the script I wrote took care of making the path work for the install, but I get a missing dll when I call the last part of the script. If I run the script a second time, everything works fine. Any help you can offer would be gran$SysPath = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment", "Path")$SysAdd = ";C:\Program Files\WallData\System"$MergePath = $SysPath & $SysAddRegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment", "Path", "REG_EXPAND_SZ", $MergePath)EnvSet("path",EnvGet("path") & ";C:\Program Files\WallData\System")RunWait("cmd")EnvUpdate(); Adjust RUMBA Mainframe DisplayRun("C:\Program Files\WallData\Mframe\Rumbadsp.exe")I've run into this myself, and restarting the script (or running a "Phase-II" script) seems to be the only sure fix. Your script is kicked off in its own shell environment, with its own copies of the effective System/User environment variables, including PATH. If your installer gets kicked off by Run(), it gets its own new shell, which doesn't contain the changes made in the script's shell. Very frustrating chasing this around in circles! I tried EnvSet()/EnvUpdate() to no avail, but it has been a while since I just rigged a kluge workaround and moved on. Insert some EnvGet() debug messages to show you how the PATH variable looks at each step, maybe you'll do better than I did... Edited October 19, 2006 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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