Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Environment PATH not being updated


3 replies to this topic

mouy

mouy
  • Members
  • 56 posts

Posted 16 March 2004 - 03:53

Hi,

Im trying to move away from forcing the user to reboot before they can use an application.

Everything works fine, except I know there is a windows issue with PATH not being refreshed until reboot.

This is causing one of the programs to not run properly, until explorer.exe is killed and restarted.

Anyone know how to successfully refresh environment variables without a reboot?

I have tried running a command prompt to echo PATH, it wont work.

Thanks!

luke_s

luke_s
  • Full Members
  • 532 posts

Posted 18 March 2004 - 04:47

I do know that the service manager requires a reboot before it can take in the new environment.

The normal dos prompt environment should refresh after an install. Make sure you open a new prompt and try not to use a dos prompt that was open before the install started.

hteichert

hteichert
  • Members
  • 158 posts

Posted 18 March 2004 - 10:14

First of all, a question:
In which operating system environment do you want to install? The way that Windows handles environment variables is completely different between the 9x family (95, 98, ME) and the NT family (NT4, 2000, XP, 2003 Server).

1) in general: already running processes will never see a change in the environment variables
2) Win 9x sets these variables (like PATH) during boot time in the DOS environment and changing the values will be notified on the next boot
3) Win NT and up store the environment variables in the registry. There are two different areas for this: systemvariables and uservariables. Systemvariables are stored in
"\\HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
and uservariables are stored in "\\HKCU\Environment". If a variable exists in both, then the uservariable is appended to the systemvariable and the resulting value is returned to the process requesting it.

For some further info about Environment variables and there use with windows installer please read the Windows installer documentation for the "Environment Table"
h.teichert-ott

Balachandar

Balachandar
  • Members
  • 23 posts

Posted 18 March 2004 - 16:40

I have had a similar problem and used the following work around.

If you are launching any exe program which should look for an updated path during the process, you could try the following.

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\<Your program.exe>
Inside <YourProgram.exe> create a key PATH and add the values %PATH%;<ew path>

The program you are executing should find the path now.