How can I use a PROPERTY=Value to set an environment variable?
I am repackaging an application as an MSI and as part of the install I need to set an environment variable so the app knows where the license server is. Is there a way to change the server location (Environment Variable's value) using a public PROPERTY=Value in the command line?
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
anonymous_9363
13 years ago
Use the 'Environment' table.
Column names: Environment,Name,Value,Component_
Row entries: SERVER,=-SERVER,[NAME_OF_PUBLIC_PROPERTY],Environment
The "=-" prefix tells the engine that it is to be set on install and removed on uninstall.
In the 'Component' table:
Column names: Component,ComponentID,Directory_,Attributes,Condition,KeyPath
Row entries: Environment,{Your_Component_GUID},TARGETDIR,0,,,
I posted a script earlier today which you can use to generate a GUID. Paste that GUID into the ComponentID cell.
Column names: Environment,Name,Value,Component_
Row entries: SERVER,=-SERVER,[NAME_OF_PUBLIC_PROPERTY],Environment
The "=-" prefix tells the engine that it is to be set on install and removed on uninstall.
In the 'Component' table:
Column names: Component,ComponentID,Directory_,Attributes,Condition,KeyPath
Row entries: Environment,{Your_Component_GUID},TARGETDIR,0,,,
I posted a script earlier today which you can use to generate a GUID. Paste that GUID into the ComponentID cell.
Posted by:
binarycortex
13 years ago
Thanks for the help, but when I do the install the environment variable looks like this ENVNAME=PUBLICPROPERTYNAME. It does not have the value of the public property. Did i do something wrong?
Edit: I couldn't find your script for generating guids but I found guidgenerator.com.
Edit: I couldn't find your script for generating guids but I found guidgenerator.com.
Posted by:
anonymous_9363
13 years ago

so that the conversation will remain readable.