System environment variable created during installation is not available to current user until reboot

I have a msi package generated by wix that creates a system environment variable by populating a table Environment

.

<Environment Id="CreateEnvVar" Name="DATADIR" Action="set"
        System="yes" Part="all" Value="[DATA_DIR]" />

      

Upon successful installation, a system-level environment variable is created. This was confirmed by viewing the dialogue Environment Variables

fromSystem Properties

However, the currently logged in user does not have access to the newly created environment variables until the computer restarts (I assume that logging out and then back will work as well. Just haven't tried it yet). Execution of the newly installed application as it does not have access to the variable DATADIR

.

In addition, after installation is complete, after installation is complete, the variable DATADIR

does not appear when the command is executed set

.

I understand that the process started before the MSI started will not get new variables. However, why not start the process after adding environment variables to get new ones?

FYI, I am installing on Windows Server 2003 and I am logged in via remote desktop with a user in a group Administrators

.

+2


source to share


1 answer


Are you installing via Remote Desktop? If so, make sure you are using an Admin Console session.

To do this, start Remote Desktop using:

mstsc / admin



Or, if you are using the latest version of RDP, now it:

mstsc / console

Try installing it from that session (or locally) and let me know the result.

+2


source







All Articles