PDA

View Full Version : Implement changes to Environment Variables



Unregistered
09-03-2009, 12:37 PM
Our script changes environment variables, but the changes are not seen systemwide until the user reboots.

In other words, the set commands in SetupBuilder are working. I can see the new variables when I go to Advanced Setttings on the Computer and look at the environment variables. So, the registry has been updated.

However, when I open a new DOS command prompt and type Set and hit enter the variables are not there.

Is there a command in SetupBuilder (or a call I can make) that will implement the changes for all new processes? I don't want the user to have to reboot in order to use the app.

Thanks,

James

linder
09-04-2009, 01:03 AM
James,

Then installer uses the following function to propagate changes:

SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM) "Environment", SMTO_ABORTIFHUNG, 5000, &dwReturnValue);

http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b104011

Friedrich

glewis64
01-26-2010, 01:42 PM
Is there a command within SetupBuilder to put this timeout anywhere withing the script?

linder
01-27-2010, 12:08 AM
Hello,

This function is automatically called from the installer.

But it should be possible to use the "Call Dll..." script function to call this SendMessageTimeout Windows API programmatically from your script.

Does this help?

Friedrich