PDA

View Full Version : Disable feature (but do not hide it)



fanasus
03-11-2008, 04:13 AM
the following problem is from other web site:

I have a number of features in my installation project, and some of
them have prerequisites that must be checked (ie. IIS must be
installed, Office must be installed, ...).
Right now I'm using a 'Condition' tag on the Feature that sets the
Level to '0' if the condition isn't met, however this completely hides
the feature. Is it possible to disable (grayed out) the feature
instead of hiding it? I think that this will be easier for our
users...

Thanks.

joshstechnij
03-11-2008, 10:13 AM
There's no way to disable a feature, still have it displayed, and prevent the user from changing it's state in an MSI project. The feature can be hidden by setting its install level to 0, or it can be deselected and visible by setting its install level to a value greater than the value of the INSTALLLEVEL property (the feature can still be selected by the user if they click on it in the CustomSetup dialog). To prevent the user from installing the feature if it is visible and its conditions for install have not been met, a custom action could be used to validate the feature state.