views:

673

answers:

3

In a .wxs file I have:

<Environment Name="PATH" ... Value="%APPDATA%\Python\Scripts" system="no"/>

Unfortunately this does not seem to work. After installing the installer on another machine, I do see that '%APPDATA%\Python\Scripts' is contained in the PATH environment variable. But typing 'foo' (where foo.exe exists in that set path), says command not found.

What exactly went wrong here? Is there a way to fix this?

+1  A: 

I don't think the cmd.exe gets updated unless you recycle them. I've also seen the environment get stuck until logoff. Seems to be more of a Windows behavior than anything else. The Windows Installer does send the message to say the environment was updated... I just haven't it work all the time.

Rob Mensching
What do you mean by 'recycle them'? I am aware that .. for the environment change to take effect, I just have to relaunch cmd.exe (not restart/relogon Windows).
Sridhar Ratnakumar
Actually, restarting the computer fixes it.
Sridhar Ratnakumar
+1  A: 

This looks like a bug in Microsoft Windows:

http://support.microsoft.com/kb/329308

Yet, there is no workaround from the WiX side.

Sridhar Ratnakumar
+1  A: 

If you're updating environment variables and want them available immediately for your applications, then best solution here is to use ScheduleReboot element to prompt the user to restart post-install.

It seems like a bit of overkill just to update an environment variable, but it will do the trick.

sascha