PDA

View Full Version : Feature condition install level 0 not working



jbabco
04-29-2004, 01:33 PM
InstallScript MSI project. I have 3 System Searches (registry), putting results in 3 same-named properties. I have set the 3 properties have to default values of "NULL", and they get overwritten properly with the registry values (if found). This is all working correctly.

One of the properties (IIS_VERSION) I use as a condition for an IIS Virtual Directory. The condition looks like: (IIS_VERSION <> "NULL") and works properly. i.e. if the condition evaluates to true, the Virtual Directory gets installed.

The two other properties (FRAMEWORK10_AVAILABLE and FRAMEWORK11_AVAILABLE) I use in conditions in several features. Those feature conditions look like ((FRAMEWORK10_AVAILABLE = "NULL") AND (FRAMEWORK11_AVAILABLE = "NULL")) with InstallLevel as 0. This should set the features to be not visible and not installed if the condition evaluates to true, no?

During setup, I'm checking the properties and they are indeed set to "NULL". I'm logging the install, and I see:

Feature: [featurename]; Installed: Absent; Request: Null; Action: Null

Good news is the features are not being installed.

Bad news is I'm still seeing the features show up in the feature tree, and they are still selected (I'm checking for that later in SdStartCopy).

I thought conditionally setting the install level to 0 was supposed to disable and hide (and I assume unselect) the feature. Is this incorrect?

e

SilentCode
05-05-2004, 03:36 PM
Hi there,

I had the exact same problem. It turns out that the INSTALLLEVEL property only hides and unselects items in an msi project and not an installscript msi project.

Installshield support told me to use the "FeatureSetData" function with FEATURE_FIELD_VISIBLE parameter. Works ok unless you have parent child features. If you do the user can unselect and reselect the parent feature and subsequently select a hidden child feature.

<RANT>
There also doesn't seem to be a way to disable entries in the SdFeatureTree and have them be visible. I know there's the required features property but its not accessable at runtime :(

Take it easy.

jbabco
05-06-2004, 01:29 PM
I ended up doing the FeatureSetData to hide the items and FeatureSelectItem to unselect them. The features are subfeatures so I had to account for the user selecting the parent feature and therefore selecting the sub feature, even though it is hidden. I basically put all of the hide/unselect functionality into a function and call the function before and after the FeatureTree. It all works but the downside is the reported install size on the FeatureTree dialog reports the total size of the feature, including hidden subfeatures.

Oh well.

Thanks for the tip.

e