cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
DaveTu
Level 3

How to prevent a feature from being installed?

Our Basic MSI has a feature that we do not want installed if the OS is a Windows Server (MsiNTProductType<>1). Setting a condition on a feature to raise the install level only deselects the feature on the CustomSetup dialog. This does not stop the user from selecting the feature or from installing the feature from the command line during a silent install.

Any suggestions?
Labels (1)
0 Kudos
(3) Replies
Not applicable

Create an install script custom action; code is below;

MsiSetFeatureState(ISMSI_HANDLE,"YourFeatureName",INSTALLSTATE_ABSENT);

call this before feature migrate state
It works with /qn option also.
0 Kudos
Kelter
Level 10

better solution: Have the condition set the InstallLevel of the feature to "0". Then it won't show up in CustomSetup at all.
0 Kudos
DaveTu
Level 3

That is exactly what I'm looking for. Thanks.
0 Kudos