I have an WIX installation with a feature and two subfeatures. I would like the feature to be required and the two subfeatures optional but not to install by default. Here is my feature tree:
<Feature Id="A" Level="3" AllowAdvertise="no" TypicalDefault="install"
InstallDefault="local" Absent="disallow" >
<Feature Id="A1" Level="1" AllowAdvertise="no" />
<Feature Id="A2" Level="1" AllowAdvertise="no" />
</Feature>
I thought that adding:
<Property Id="INSTALLLEVEL" Value=3 />
would set the main feature to install and the subfeatures to not install. That isn't the case; all features are installed by default.
I'm using the WixUI_FeatureTree. I wonder if that might be messing up the INSTALLLEVEL property.
So is what I am attempting even possible? How can I disable the two subfeatures by default?
Edit: Interesting. I set INSTALLLEVEL=1000
and tried it again and all features were still set to install. Could WixUI_FeatureTree be clobbering INSTALLLEVEL
?
The MSIFASTINSTALL property can be used to reduce the time required to install a large Windows Installer package.
The INSTALLLEVEL property is the initial level at which features are selected "ON" for installation by default. A feature is installed only if the value in the Level field of the Feature table is less than or equal to the current INSTALLLEVEL value.
A feature is installed only if the feature level value is less than or equal to the current install level.
The INSTALLLEVEL property is like a high water mark. If you set it to 1000 and you don't want a feature selected by default you have to set the level of the feature to 1001 or higher. It's everything at or below the level that gets installed by default.
From MSDN:
The INSTALLLEVEL property is the initial level at which features are selected "ON" for installation by default. A feature is installed only if the value in the Level field of the Feature table is less than or equal to the current INSTALLLEVEL value. The installation level for any installation is specified by the INSTALLLEVEL property, and can be an integral from 1 to 32,767. For further discussion of installation levels, see Feature Table.
One more observation and probably more important.
Your sub-features have Level="1" and that will install them anyway for any valid INSTALLLEVEL. You should set their level to something higher if you need to disable them by default. Like this:
<Feature Id="A" Level="3" AllowAdvertise="no" TypicalDefault="install"
InstallDefault="local" Absent="disallow" >
<Feature Id="A1" Level="10" AllowAdvertise="no" />
<Feature Id="A2" Level="10" AllowAdvertise="no" />
</Feature>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With