Jump to content

EnvUpdate tricks?


Recommended Posts

I've got a program that's misbehaving, it's not properly seeing the changes I'm making in the registry to the path, as such:

$NEWPATH = EnvGet("PATH")
If (StringInStr($NEWPATH, "%FORTE_ROOT%\install\bin") = 0) or (StringInStr($NEWPATH, "c:\forte\install\bin") = 0) Then $NEWPATH = "%FORTE_ROOT%\install\bin;" & $NEWPATH
If (StringInStr($NEWPATH, "%FORTE_ROOT%\userlib") = 0) or (StringInStr($NEWPATH, "c:\forte\userlib") = 0) Then $NEWPATH = "%FORTE_ROOT%\userlib;" & $NEWPATH
If StringInStr($NEWPATH, "C:\Program Files\Caminus\Common") = 0 Then $NEWPATH = $NEWPATH & ';"C:\Program Files\Caminus\Common"'

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment", "PATH", "REG_SZ", $NEWPATH)
EnvSet("PATH", $NEWPATH)
EnvUpdate()

I put a msgbox in, and it shows the path is modified as I want it to be:

MsgBox(0,"path", Envget("PATH"))

I even split the script into two parts, one that changes the path, the other that runs the app... I also tried this:

Envset("PATH",Envget("PATH"))
EnvUpdate()
as another way attempting to inflict the change that I'd made on the app.

The program I'm running launches a self extracting winzip, then runs an extracted app, which is what's not seeing the updated path....

anyone else ever have to do similar dances? any suggestions?

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

The first thing I see is that the path-entry at the pc-systems I know are "REG_EXPAND_SZ"-types...

well, color me green and call me a pickle. I'll try that.

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

damn, no change. I think it might just be something as stupid as the app needing the %forte_root%\install\bin to be the first thing in the path... how's that for obnoxious?

"I'm not even supposed to be here today!" -Dante (Hicks)

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...