Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set sub-features to not install by default

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?

like image 820
SaulBack Avatar asked Sep 19 '12 21:09

SaulBack


People also ask

Which of the below properties can be used to reduce the install time?

The MSIFASTINSTALL property can be used to reduce the time required to install a large Windows Installer package.

What is Installlevel in MSI?

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.

What should be the value of feature level for feature to install?

A feature is installed only if the feature level value is less than or equal to the current install level.


2 Answers

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.

like image 136
Christopher Painter Avatar answered Sep 28 '22 18:09

Christopher Painter


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>
like image 31
Sasha Avatar answered Sep 28 '22 19:09

Sasha