Environment variables in an MSI?
Help me with how to set environment variable in an msi
I got an application where it is mentioned to add environment variable.
Name : Server
value :ha@2500
I know that we can add them in environment variable table. But, i've seen that we need to prefix some symbolics and this is the first time that I'm adding an environment variable.
Environment:?
Name: Server
value : ha@2500
component : any component
Is this right?
Please suggest me and thanks in advance.
Answers (2)
system or user variable?
Environment: NewEnvironment1
Name: *=-server
Value [~];ha@2500
Component NewComponent2
for more info:http://msdn.microsoft.com/en-us/library/windows/desktop/aa368369(v=vs.85).aspx
Comments:
-
* means system variable - jaybee96 11 years ago
I found that this can be done by the scripting module in KACE. Use a batch file to edit registry keys located @ HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
Once you reboot the settings should work and you can proceed with your MSI. I recommend testing this on a VM with a prerecorded snapshot so if something breaks it's a quick restore away. Note that if you're using another solution to deploy your MSI you could make this part of a logon script as well (test test test!).
Comments:
-
It is a best practise to make use of msi tables when possible. If not, use custom actions. - SnowLyric 11 years ago
-
Maybe so, I have a script that does this for one of our proprietary applications. I wasn't saying it's the only way to do it, but it is a way to do it. - GeekSoldier 11 years ago