I have a msi package generated by wix that creates a system environment variable by populating the Environment
table.
<Environment Id="CreateEnvVar" Name="DATADIR" Action="set"
System="yes" Part="all" Value="[DATA_DIR]" />
The install successfully creates the environment variable at the system level. This was verified by viewing the Environment Variables
dialog from System Properties
However the currently logged in user does not have access to the newly created environment variables until the machine is rebooted ( I'm assuming that logging out then back in would also work. Just have not tried it yet). Executing an application that was just installed fails because it does not have access to the DATADIR
variable.
Also, opening up a command prompt after the installation is complete the DATADIR
variable does not appear when executing the set
command.
I understand that a process started before executing the MSI would not get the new variables. However, why wouldn't a process started after the environment variables are added get the new ones?
FYI, I am installing on Windows Server 2003 and I am logged in through remote desktop with a user in the Administrators
group.