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.
0 Comments   [ - ] Hide Comments


Please log in to comment

Answer this question or Comment on this question for clarity


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>
Answered 02/05/2015 by: EdT
Red Belt

  • ...so the OP could use the RegLocator table :-)
    • >sigh< Just slapping myself with a wet kipper for once again missing the obvious.....
Please log in to comment