views:

422

answers:

1

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.

+1  A: 

Are you installing via Remote Desktop? If so, ensure you are using the admin console session.

To do so, launch Remote Desktop using:

mstsc /admin

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

mstsc /console

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

Mick
Thanks for the response. That ended up being the problem. And we were having problems with the /admin /console. Originally we were connecting as /console but apparently that's been deprecated in later releases.
Aaron Carlson
Glad to hear that it is working.
Mick
wow awesome! many thanks in deed sir!
Ric Tokyo