This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Knowledge Base
- :
- Conditions to Determine Installation States
Subscribe
- Mark as New
- Mark as Read
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Conditions to Determine Installation States
Conditions to Determine Installation States
Summary
This article includes a list of common conditions that are used to determine the state of an installation.Synopsis
Instead of using an explicit script, Basic MSI setups determine the actions to perform and the order in which they will occur using sequence tables. In particular, the InstallUISequence and InstallExecuteSequence tables?the "User Interface" and "Execute" sequences?contain ordered lists of actions to perform during a normal installation (that is, an installation started by double-clicking an MSI database icon or by running the command msiexec /i ProductName.msi).When working with the MSI sequence tables, an important idea is that the same sequences are used for first-time installations and maintenance installations (including uninstallation); there is no separate "uninstallation sequence". Therefore, any custom actions you schedule in the Installation sequences will by default run for both installation and uninstallation. The problem, of course, is that this behavior is undesirable for many custom actions, especially those involving launching or manipulating files installed by your installation.
Discussion
To ensure that an action runs only during a desired time, you can condition the custom action. The following table includes some of the more common conditions that can be used to ensure that the custom action only runs during the installation state that is desired. Keep in mind that property names are case-sensitive. Also, silent and UI-limited installations will only perform actions in the Execute sequence.
Installation State | Condition | Notes |
First time Install | Not Installed | Installed is true if a product with the same product code is found on the machine. This will evaluate to true for major upgrades as well. |
Modify, Repair, or Remove | Installed | |
Remove (Uninstall)
| REMOVE="ALL" | this condition is valid only after the InstallValidate action in the InstallExecuteSequence table. For detecting an uninstall during the UI sequence, you can use _IsMaintenance="Remove" anywhere after the MaintenanceType dialog box? |
Maintenance or Repair | Installed AND Not REMOVE | |
Minor Upgrade | IS_MINOR_UPGRADE | set by the setup.exe launcher |
Major Upgrade | IS_MAJOR_UPGRADE | set by the action ISSetAllUsers |
Major Upgrade | ActionProperty | The property specified as the Detect Property in the Advanced tab of the Major Upgrade item. |
In addition to detecting different types of installation for the entire product, it can sometimes be useful to detect if a specific feature or component is being installed or removed. To support this, Windows Installer defines feature/component action and feature/component state with a special syntax. Action conditions enable you to determine if a feature's installation state is changing (in the example above, from "not installed" to "installed locally"). If you want to determine a feature or component's state, regardless of whether the state is changing, you can use state conditions. Feature/component action is defined as &FeatureName=n and $ComponentName=n respectively while feature/component state is respectively defined as !FeatureName=n and ?ComponentName=n where n corresponds to the number in the table below:
-1 | No action (feature unchanged) |
1 | Feature advertised |
2 | Feature not installed (uninstalled) |
3 | Feature installed locally |
4 | Feature installed to run from source |
Additional Information
For more information on creating conditions please refer to the MSDN article Conditional Statement Syntax.
For more information on the ActionProperty please refer to the MSDN article Upgrade Table.
For more information on the Installed property, please refer to the MSDN article Installed Property
For more information on the REMOVE property, please refer to the MSDN article REMOVE Property
No ratings