Summary
This article provides some of the most common conditions used in MSI projects for custom actions, features, components, etc.
Synopsis
This article gives you some of the most common conditions used in MSI projects for custom actions, features, components, etc. It also serves as a quick reference for most of what you need to know about Conditional Statement Syntax.
Discussion
Common Conditions
| Sequencing | Condition |
|---|---|
| First-time installation | Not Installed |
| Uninstallation | REMOVE~="ALL" |
| AutoRepair | REINSTALLMODE=pocmus |
| Uninstallation from Major Upgrade | UPGRADINGPRODUCTCODE |
| Minor Upgrade via Setup.exe | IS_MINOR_UPGRADE |
| Minor Upgrade via command line | REINSTALL~="ALL" And REINSTALLMODE><"v" |
| Patch | PATCH |
| Patch Uninstallation | MSIPATCHREMOVE |
| Modify | Installed And Not REINSTALL And Not REMOVE~="ALL" |
| Repair from ARP | REINSTALL~="ALL" And REINSTALLMODE="ocmusv" |
| Repair from right-click of MSI | REINSTALL~="ALL" And REINSTALLMODE="pecms" |
| Repair from Maintenance dialog | REINSTALL And REINSTALLMODE="omus" |
| Maintenance | Installed And Not RESUME And Not Preselected And Not PATCH |
| 64 bit OS | VersionNT64 |
| 32 bit OS | Not VersionNT64 |
| Running from Admin Image | IsAdminPackage |
| Silent Install (UI Sequence not run) | UILevel <= 3 |
| Install running from UNC Path | SourceDir >< "\\" |
| Windows XP | VersionNT = 501 |
| Windows XP (64-bit) | VersionNT64 = 502 And MsiNTProductType = 1 |
| Windows Server 2003 | VersionNT = 502 And MsiNTProductType = 3 |
| Windows Vista/Server 2008 | VersionNT = 600 |
| Windows 7/Server 2008 R2 | VersionNT = 601 |
| Windows 8/Server 2012 | VersionNT = 602 |
| Windows 8.1 & 10/Server 2012 R2 & 2016 | VersionNT = 603 |
| Feature installing or installed | &FeatName = 3 Or (&FeatName <> 2 And !FeatName=3) |
| Component Reinstalling | ?ComponentName=$ComponentName |
| At least 2 GB of RAM | PhysicalMemory >= 2048 |
| MSI running with elevated privileges | MsiRunningElevated |
| Core OS Language is English | SystemLanguageID = 1033 |
Prefix/State Operators
| Operator | Meaning |
|---|---|
| $ComponentName | Component action state |
| ?ComponentName | Component install state |
| &FeatureName | Feature action state |
| !FeatureName | Feature install state |
| %EnvVar | Environment variable value |
State Values
| State | Value |
|---|---|
| INSTALLSTATE_UNKNOWN | -1 |
| INSTALLSTATE_ADVERTISED | 1 |
| INSTALLSTATE_ABSENT | 2 |
| INSTALLSTATE_LOCAL | 3 |
| INSTALLSTATE_SOURCE | 4 |
Substring Operators
| Operator | Meaning |
|---|---|
| >< | Contains |
| << | Starts with |
| >> | Ends with |
Bitwise Operators
| Operator | Meaning |
|---|---|
| >< | Bitwise contains (any bits in common) |
| << | Bitwise starts with (high 16 bits) |
| >> | bitwise ends with (low 16 bits |
Logical Operators
| Operator | Meaning |
|---|---|
| Not | Inverts state of following item |
| And | TRUE if both terms are TRUE |
| Or | TRUE if either or both terms are TRUE |
| Xor | TRUE if either but not both are TRUE |
| Eqv | TRUE if both are TRUE or both are FALSE |
| Imp | TRUE if left term is FALSE or right is TRUE |
Comparison Operators
| Operator | Meaning |
|---|---|
| = | Equals |
| <> | Not equals |
| > | Greater than |
| >= | Greater than or equals |
| < | Less than |
| <= | Less than or equals |
| ~= | Case-insensitive equals |
Additional Information
For more information on built-in Windows Installer Properties, please see the MSDN article Property Reference.
These charts are also available as a PDF.
Related Articles
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
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. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago