Installed state
While Windows Installer uses action state to determine if a feature or component should be installed, it uses installed state to see if a feature or component has already been installed by a previous installation. In other words, does it currently exist on the computer?
Unlike action state, the value of installed state can be used in feature and component conditions. For features, you'll prefix the feature's Id
with an exclamation mark (!
), as shown:
!MainFeature = 3
For components, you'll use a question mark (?
):
?ComponentA = 3
This allows you to include features and components based on whether they were installed before. You can also use them in custom actions and UI control conditions, such as to change which dialogs are displayed. Windows Installer uses this functionality itself, at least in regards to features, when you use the feature tree control. During a reinstall, it will show the features as enabled that have been selected before and disables those that haven't. This...