Hi,
The workaround for this limitation is to use another MSI package which creates the environment variable as a prerequisite for the main package.
Here are the steps you can take:
- create a new Advanced Installer project and configure it to create only your environment variable
- go to the "Registry" page and create a registry entry (this will be used to detect if the prerequisite was installed)
http://www.advancedinstaller.com/user-g ... istry.html
- go to the "Install Parameters" page and set the "Limit to basic user interface (simple progress and error handling)" option (to make the prerequisite installation silent)
- go to the "Product Details" page and select the "Do not show in list" option (so the user doesn't uninstall it by accident)
- create the main installation package
- go to the "Software Prerequisites" tab of the "Prerequisites" page and add the first MSI as a prerequisite
http://www.advancedinstaller.com/user-g ... requisites
http://www.advancedinstaller.com/user-g ... tware.html
- for the prerequisite you can use the registry entry in the first package as a detection criteria
http://www.advancedinstaller.com/user-g ... earch.html
- in the "Bootstrapper UI" section of the "Software Prerequisites" tab set the "UI Level" combo to "Basic UI and progress" (so the prerequisite is installed with no user interaction)
- in the "Bootstrapper" tab of the "Media" page you can include the install files in the EXE botstrapper (this is optional)
- go to the "Search" page and create a new File search for
msiexec.exe
http://www.advancedinstaller.com/user-guide/search.html
- rename the search to MSIEXEC (the name of the search is actually a public property which will contain the search result)
- right-click the search and use the "Add Location" menu to add
[SystemFolder] as the search location
- go to the "Custom Actions" page and show the "InstallFinalize" standard action (you can use the "Show standard action" button on the toolbar)
- under "InstallExecuteSequence" -> "InstallFinalize" create a "Property Source" custom action
http://www.advancedinstaller.com/user-g ... -page.html
http://www.advancedinstaller.com/user-g ... rty-source
- use these settings:
Code: Select all
Property Name: MSIEXEC (the property of the search)
Command Line: /x GUID /qb
Execution Properties: Asynchronous execution, do not wait for return
Expression: (REMOVE="ALL")
-
GUID is the Product Code of the first package (the one which creates the environment variable); you can get it by opening the AIP of the first package with a text editor (the "Product Code" property)
Let me know if you encounter any problems.
Regards,
Cosmin