How do I read an environment variable into the MSI?
Question
How do I read an environment variable into the MSI?
Answer
Check out the MSDN topic Restrictions on Property Names [Windows Installer] which says
Property names prefixed with % represent system and user environment variables.
Check out the MSDN topic Formatted [Windows Installer] which says
If a substring of the form [%environmentvariable] is found, the value of the environment variable is substituted for the substring.
Property names prefixed with % represent system and user environment variables.
Content credit also belongs to
- Rob, Microsoft Dev and WiX Project Lead. You can get other Rob insights about developing for Windows Installer from his blog when setup isn't just xcopy
[Author: Robert Flaming]
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at https://www.microsoft.com/info/cpyright.htm.
Comments
- Anonymous
September 16, 2005
I have been trying to write an environment variable from a setup and deployment project. I realized it was not possible, or was too difficult, and ended up creating a custom action that in turn calls a managed dll. This dll does the job of changing the environment variable (in my case PATH) - Anonymous
April 05, 2008
PingBack from http://copyrightrenewalsblog.info/windows-installer-team-blog-how-do-i-read-an-environment-variable/