cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Not applicable

i want to modify "Path" Enviornmant Variable through Msi installshield

i want to install apache tomcat on target machine and i need to modify Windows "Path" Environment variable , how can i do?
Labels (1)
0 Kudos
(6) Replies
rrinblue22
Level 9

use SetEnvironmentVariableA for the current session and if you need to get it updated permanently then set it in registry (SYSTEM\\ControlSetControl\\Session Manager\\Environment) and broadcast the same using SendMessage function.
0 Kudos
RobertDickau
Flexera Alumni

You could also use the Environment Variables view, which uses MSI's Environment table and related actions, to append something to PATH. The view is under System Configuration, and the help topic "Environment Variables View" has details.
0 Kudos
tgvishnupriyabe
Level 3

Hi,

I am using pure installscript project and there is not option for Environmental variables view.
We are still doing it from installscript code, it works on Win 7 ,but it hangs on Windows 10 machine. It hangs at the point,after setting the environment variable related registry key and try broadcasting the change to all child processes.

I tried replacing with SendMessageTimeout, so as to overcome hang issue, but at end of install, I see registry key updated with new env variable, but all other child processes not reflecting the new env var until we do system restart

szEnv = "Environment";

pEnv = &szEnv;
//Takes more time on Windows 10
//SendMessage (HWND_BROADCAST, WM_WININICHANGE, 0, pEnv );
if(!SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, pEnv, SMTO_ABORTIFHUNG, SMTO_TIMEOUT, pResult))then
LogInformation("SendMessageTimeout failed in RefreshEnvironment, Error :" + Err.LastDllError());
endif;


Is there any other way to forcefully get all child processes to reflect new environmental variable without doing a system restart?

Thanks,
Priya


RobertDickau wrote:
You could also use the Environment Variables view, which uses MSI's Environment table and related actions, to append something to PATH. The view is under System Configuration, and the help topic "Environment Variables View" has details.
0 Kudos
chad_petersen
Level 9

You re replying to Robert Dickau, but he has not logged on here since December of 2013, about 4 years ago.

Also, just so you know, Flexera no longer provides support for Installshield 2012. or 2012 Spring. You must be on at least 2013 to get support.

InstallScript only projects are very outdated. Everyone should be compiling to an MKSI these days. The old Setup.exe and InstallScript only is only maintained for backward compatibility.

You might have better luck if you use something more modern on Windows 10. The InstallShield 2012 precedes Windows 10 by a few years. It does not surprise me if anyone has difficulties.

Try something modern.

Chad
0 Kudos
chad_petersen
Level 9

Here's the list of supported products. Even Limited support has ended for 2012 and 2012 Spring. Not much time left for support of 2013, either.

https://www.flexerasoftware.com/producer/support/additional-support/end-of-life/installshield.html

Chad

0 Kudos
bestellen
Level 4

The InstallShield 2012 precedes Windows 10 by a few years. It does not surprise me if anyone has difficulties.
0 Kudos