I have a scenario wherein i have say 5 features in MSI (say A,B,C,D,E).

First user installs say only two features (A,B) and finishes the installation, now after few days he want to install one more feature which was not installed before (say C) and remove one of the feature which was installed before (say B), so he will double click the MSI, out of modify, change, and remove he selects modify radio button, clicks next and on feature selection box he selects extra feature (C) he want to install and unselects the one he wants to uninstall (B).

Now i want to know the condition which i can use at runtime to find which was the feature he installed firsttime and he wants to retain that feature (i.e., featurename of the one he wants to repair) (in this case it's A)

To check whether feature is selected for installation or not then we use "&FeatureName=3" and To check whether feature is installed locally or not then we use "!FeatureName=3".

Similarly i want to know the condition for the repair scenario (i.e., feature is already installed and user is repairing that feature)


2 Comments   [ - ] Hide Comments


  • One, why would you need to know and two, where are you using that syntax?
  • 1. I have the requirement wherein i want to display user what action is he performing on what feature, i.e., which feature he is installing freshly, which feature is he uninstalling and which one is he repairing
    2. I am using the syntax in Installscript (e.g. MsiEvaluateCondition(hMSI, "&FeatureName=3"), I am executing installscript on next button event

    Do share your idea on how to find which feature is user repairing at runtime

Please log in to comment

Answer this question or Comment on this question for clarity


To reinstall upon repair I used:

(!FeatureName=3 AND REINSTALL="ALL)
//if feature installed         //repair mode selected

To modify the program through the modify dialog, I first selected the already installed features by checking the registry for a matching version number and display name.  Then I used FeatureSetData in the OnAppSearch() function to select or unselect depending on if the feature was already installed.

To Install if not installed in modify mode I used:

(!FeatureName=2 AND &FeatureName=3)
//feature not installed      //feature is selected

To uninstall if installed and deselected in maintenance mode I used:

 (&FeatureName=2 AND !FeatureName=3)
//feature not selected       //feature is installed
Answered 06/07/2016 by: xblackhand
White Belt

Please log in to comment