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

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

问题描述

我有一个包含一个功能和两个子功能的 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 />

在安装过程的一开始就初始化属性值.但是,当您在对话框之间移动时,INSTALLLEVEL 属性可能会在您看到 FeathreTree 对话框之前发生变化.请验证日志文件末尾的属性值已更改"的详细日志条目和 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天全站免登陆