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
Was this helpful?
Related Articles
Agreements and Licenses 68Number of Views Install Condition to determine a 32bit or 64bit Machine 6Number of Views Feature Conditions Do Not Work as Expected When Based on Other Feature or Component States 5Number of Views How to Determine if a Property Has Been Set or Not in a Condition for Suite/Advanced UI Projects 3Number of Views Change Installation State of a Feature, Based on Another Feature's Selection State 5Number of Views
Revenera Assistant - Beta
Online
Hi, I am Reva - Ask me anything.
Updates
No new updates
Chat
Home
Updates
/**/
Thanks for the feedback!
Your feedback has been saved.Rate this response:
1
2
3
4
5
Add Additional feedback ( Optional )
0/240
English
English
Language changed successfully
Something went wrong
Email sent successfully
Something went wrong
Case create successfully
Are you sure you want to cancel
the case creation?
Please select a product to submit the case.
Please select a product version to submit the case.
0/255
Upload Attachment
File Upload
Maximum file
size allowed is 3 MB.
File type
not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
Are you sure you want to cancel the case creation?
Case closed successfully
File Upload
Maximum file size allowed is 3 MB.
File type not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
File Upload
Maximum file
size allowed is 3 MB.
File type
not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
© 2026 Flexera Software. All Rights Reserved.
Case id: 00001065
Activity: Status change: 2 hours ago