[wix-users] A question about newly created environment variable on Windows 10

Gerhard Matzen gmatzen at osisoft.com
Mon Oct 2 13:10:49 PDT 2017

In my installer I have a custom action that makes the following call.  I'm not sure if there is a better way to deal with this, but it would solve your problem.

   //Call SendMessageTimeout with WM_SETTINGCHANGE so that environment variables are picked up by the 
   //next command promp that is opened.  The Wise for Windows install kit installs environment variables directly
   //in the registry.  This call informs the system that something has changed.
   DWORD_PTR tempresult;
   LRESULT bSuccess = SendMessageTimeout( HWND_BROADCAST, WM_SETTINGCHANGE, 0, 
                        (LPARAM)"Environment", SMTO_NORMAL, 1000, &tempresult );

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Miaohsi Wang via wix-users
Sent: Monday, October 2, 2017 1:05 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Miaohsi Wang <Miaohsi.Wang at schneider-electric.com>
Subject: [wix-users] A question about newly created environment variable on Windows 10

Dear WiX Support,

Our WiX installer creates an environment and we found an issue with it on Windows 10. On windows 10 after the installation, the environment variable is not effective and if I open a new DOS command prompt window and execute a set command, I would not see it there in the list. At this time, however, if I open the Environment Variable window, I'd see it there in the System Environment Variable window. After I close the Environment Variable window, the new environment variable is now effective. Any idea? The WiX code for the environment variable creation is shown below.

<Environment Id="Env1" Name="TEST" Value="[TEST]" Part="all" Permanent="yes" Action="set" System="yes" />

Thanks a lot,

WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

More information about the wix-users mailing list