将子功能设置为默认情况下不安装 [英] Set sub-features to not install by default

查看:63
本文介绍了将子功能设置为默认情况下不安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有一个功能和两个子功能的WIX安装.我希望此功能是必需的,而两个子功能是可选的,但默认情况下不安装.这是我的功能树:

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>

我认为要添加:

<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.

我正在使用 WixUI_FeatureTree .我想知道这是否会弄乱 INSTALLLEVEL属性.

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?

编辑:有趣.我设置了INSTALLLEVEL=1000并再次尝试,所有功能仍设置为要安装. WixUI_FeatureTree是否会破坏INSTALLLEVEL?

Interesting. I set INSTALLLEVEL=1000 and tried it again and all features were still set to install. Could WixUI_FeatureTree be clobbering INSTALLLEVEL?

推荐答案

我认为您的问题是在执行UISequence时覆盖了INSTALLLEVEL属性的值.添加代码

I think your problem is in overwriting the value of INSTALLLEVEL property duting execution of the UISequence. Adding code

<Property Id="INSTALLLEVEL" Value=3 />

在安装过程的一开始就初始化属性值.但是,当您从一个对话框移动到另一个对话框时,在看到FeathreTree对话框之前,INSTALLLEVEL属性可能会更改.请在日志文件末尾验证属性值已更改"的详细日志条目以及INSTALLLEVEL属性的最终值. 您可能需要创建自定义操作,以将INSTALLLEVEL设置为所需的任何值. 可以在WIX​​源代码中找到示例:SetupType对话框正是这样做的:

initializes property value on the very beginning of installation process. But when you are moving from dialog to dialog the INSTALLLEVEL property may change before you are seeing the FeathreTree dialog. Please verify verbose log entries of "Propery value changed" and the final value of INSTALLLEVEL property in the end of the log file. You may need to create custom action to set INSTALLLEVEL to whatever value you need. Example can be found in WIX sources: SetupType dialog does exactly this:

<Control Id="TypicalButton" Type="PushButton" X="40" Y="65" Width="80" 
         Height="17" ToolTip="!(loc.SetupTypeDlgTypicalButtonTooltip)" 
         Default="yes" Text="!(loc.SetupTypeDlgTypicalButton)">
  <Publish Property="WixUI_InstallMode" Value="InstallTypical">1</Publish>
  <Publish Event="SetInstallLevel" Value="3">1</Publish>
</Control>

这篇关于将子功能设置为默认情况下不安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆