7

如果在功能选择树中选择了另一个功能,是否有任何方法可以强制安装特定功能?那就是没有功能成为其依赖项的子项?

4

1 回答 1

2

是的,这应该是可能的,如果您在 Feature 元素下使用 Condition 元素,您可以从条件控制功能安装级别。

    <Feature Id="MyDependentFeature">
      <Condition Level="1">(NOT INSTALLED AND &MyMasterFeature=3) OR (INSTALLED AND !MyMasterFeature=3)</Condition> 
    </Feature>

    <Feature Id="MyMasterFeature"> 
    </Feature>

这里需要解释几件事:

  • Condition Level="1"告诉 Wix 将父功能安装级别设置为 1(安装)(信息
  • (NOT INSTALLED AND &MyMasterFeature=3)如果产品尚未安装,并且 MyMasterFeature 请求的操作是安装
  • (INSTALLED AND !MyMasterFeature=3)如果产品已经安装,并且 MyMasterFeature 的安装状态为 Installed。(信息)
于 2015-07-23T16:08:05.717 回答