Community Forums
Page 1 of 2 12 LastLast
Results 1 to 5 of 7

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

  1. #1
    Join Date
    Feb 2013
    Posts
    8

    Wink 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?

  2. #2
    Join Date
    Oct 2010
    Posts
    219
    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.
    Cheers!

  3. #3
    Join Date
    Oct 2001
    Location
    Here and there
    Posts
    16,243
    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.

  4. #4
    Join Date
    Sep 2014
    Posts
    3

    Issues with broadcasting the updated environmental variable

    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


    Quote Originally Posted by RobertDickau View Post
    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.

  5. #5
    chad.petersen Guest
    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

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •