Page 1 of 1

Update Path??

Posted: Thu Jun 02, 2011 7:43 am
by ctkaerospace
I'm trying to add an installation target directory to the system path - it seems like such a simple thing to do, but I can't make it work. The script line for setting the path looks like "Set Environment Variable %path% to $targetdir$" . What am I missing?

Re: Update Path??

Posted: Thu Jun 02, 2011 7:57 am
by bokkie
Have you executed Apply Install after setting its value?

Re: Update Path??

Posted: Thu Jun 02, 2011 10:00 am
by ctkaerospace
Yes, there is an Apply Install immediately following the Set Environment Command. I've stepped through this with the debugger, and following the apply install the variable SUCCESS has the value COMPLETE, and TARGETDIR has the value C:\Program Files (x86)\\GEM, which looks correct except for the double backslash. However, I can't find where the path has been modified after the install has completed. The Set Environment dialog is configured to always set variable, Add value to beginning of variable, and the variable is set for All users.

Re: Update Path??

Posted: Thu Jun 02, 2011 5:36 pm
by giaviv
Hi,

It might take a reboot before that takes effect - please try that and let me know.

Re: Update Path??

Posted: Thu Jun 02, 2011 6:06 pm
by ctkaerospace
Rebooting or logging off/on seems to fix the problem, but sometimes it works without the reboot. I hate to complain, but I never had these kind of issues with Wise.

Re: Update Path??

Posted: Thu Jun 02, 2011 7:01 pm
by giaviv
Hi,

In my experience working with environment variables outside of InstallAware, a reboot is always recommended before the changes take effect.
This has to do with Windows and not with InstallAware..

Solution - Re: Update Path??

Posted: Wed Aug 28, 2013 8:00 am
by mmellon@ecrs.com
I am currently evaluating InstallAware 17 and I'm disappointed in the above response.

This is indeed a bug in InstallAware. After updating the system or user PATH environment variables, the installer MUST broadcast a message to all top level windows to inform them that system settings have changed. Sample Win32 API function call:

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

I would expect InstallAware to make this happen in an MSI automatically if any environment variables are changed. It doesn't.

QUICK WORKAROUND:

1. Install AutoHotKey (32-bit) - http://www.autohotkey.com/.
2. Make a file called EnvUpdate.ahk. Put one line of text in the file:
EnvUpdate
3. Save.
4. Right-click the file, and choose Compile Script.
5. Install the resulting EnvUpdate.exe in your $TARGETDIR_X86$ (pick it in Files and Settings on the Design tab).
6. On the Project tab, in Run Programs, set the installer to run $TARGETDIR_X86$\EnvUpdate.exe at the Finish dialog.

Note: All new processes launched by explorer.exe will get the new environment. Existing processes will get the new environment if they are programmed to handle WM_SETTINGCHANGE correctly. To see this effect, open a command prompt before you run your installer, run the installer, then open another command prompt. In each prompt, type SET [Enter]. The new environment variable values will be set in the command prompt you opened after the installer, but not before.

Re: Update Path??

Posted: Wed Aug 28, 2013 9:15 am
by FrancescoT
Dear User,

this matter has been extensively discussed with the forum ... I may suggest you to have a look at the following topic;
http://www.installaware.com/forum/viewtopic.php?f=2&t=9515

Anyway, I don't agree with your reply as well.

Not all running processes, including OS processes, are able to handle the SendMessage notification and this is the reason why, the notification mesaage is not automatically issued. In addition, It depends on which Env variable you are updating and if the case, you could send the message notification.

Regards