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
- :
- Common MSI Conditions
Subscribe
- Mark as New
- Mark as Read
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Common MSI Conditions
Common MSI Conditions
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 ConditionsSequencing | 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.
No ratings