Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
611 views
in Technique[技术] by (71.8m points)

wix - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...