PDA

View Full Version : Modifying the registry from an action script


dwybo1
10-05-2004, 02:15 PM
I am modifying environment variables in my install script. It works fine except I have to tell the user to reboot before they can use my software, because the environment variables have not taken effect.

An old info document for SetupFactory version 6 (Document ID: IR02020) states:

Use a Modify Registry action to set your environment variable in the registry.

NOTE: When setting variables like this on Windows 9x or Windows NT, the system MUST be restarted for them to take effect.

I am doing this. However, if I manually create/modify environment variables with (WinXP) System->Advanced->Environment Variables, and press OK, then all processes are updated with the new environment. So, that begs the question, what does pressing that OK button do to update the registry without having to reboot?

And if we know that, then can we put that into the install script and change the registry without having the user to reboot for the changes to take effect?

JXBURNS
10-05-2004, 04:25 PM
I think it depends whether you are writing environment variables that apply to the system (all users) or to the current user. If the former, I'm sure that a system restart will be required as many systems will have used the previous information to start themselves. For a user, it should not really matter and may just require user-specific programs to restart (if at all).

In fact what I have written above I've just found in a MSFT KB article (really should learn to research before opening mouth to save typing):

http://support.microsoft.com/default.aspx?scid=kb;en-us;310519&sd=tech

John