Checking systems environment variables in a Basic MSI Project.
Hi Guys,
Please let me how to implement the below configuration in a MSI package
At the beginning of installation, I want to check a certain environment variable. e.g. "%MYPATH". If this variable is not found, the installation should abort. If the variable is found, the value should be written to INSTALLDIR property and the installation should proceed to that directory.
At the beginning of installation, I want to check a certain environment variable. e.g. "%MYPATH". If this variable is not found, the installation should abort. If the variable is found, the value should be written to INSTALLDIR property and the installation should proceed to that directory.
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
EdT
9 years ago
The "locator" tables do not include any functionality to search for environment variables, so I would suggest writing a custom action that reads the environment variables and looks for the specific variable you need to find. If found, the variable is then loaded into a property value that is returned to the MSI and used as a launch condition. The alternative to reading the environment variables directly is to look for the specific environment variable within the registry - if I recall correctly the system environment variables will be under: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\<name of environment variable>
Comments:
-
...so the OP could use the RegLocator table :-) - anonymous_9363 9 years ago
-
>sigh< Just slapping myself with a wet kipper for once again missing the obvious..... - EdT 9 years ago