Archive: Path does not expand after installer run


Path does not expand after installer run
Here is how my path looks like in "System | Advanced | Environment Variables":
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;c:\b;%ANT_HOME%\bin;%JAVA_HOME%\bin

This is what i get when I type "set" from my command prompt:
Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\b;c:\java\ant1.5.1\bin;c:\java\jdk1.3.1\bin

I run the installer which adds a variable to the path.

Now this is what i get when I type "set" from my command prompt after i run the installer (as you can see now, the %VARIABLEs% are NOT expanded anymore, consequently java & ant don't run anymore):
Path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;c:\b;%ANT_HOME%\bin;%JAVA_HOME%\bin


At this point i manually open up "System | Advanced | Environment Variables", I make an insignificant change: I add a semicolon to the end of the value.
This is what i get when I type "set" from my command prompt:
Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\b;c:\java\ant1.5.1\bin;c:\java\jdk1.3.1\bin

As you can see the variables are expanded again.

Conclusion:
The %VARIABLEs% inside the PATH value are only filled when saved through the Windows XP UI.

Any clues?


I have updated the script to use WriteRegExpandStr instead of WriteRegStr. This will make sure that even if the registry value was REG_EXPAND_SZ it will still be written right, and if not, the type will just change to REG_EXPAND_SZ.

It should work now (worked for me).


looking good.

thanks.