微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在 Wix 中为 MULTIPLE Components 设置条件

如何解决在 Wix 中为 MULTIPLE Components 设置条件

我想在多个组件上设置条件,但不希望每个组件一遍又一遍地重复使用该条件,而是在不是启动入口条件的条件下将组件组合在一起片段是。

使用的想法?例如,ComponentGroup 不是 Directory 的有效子项,我真的不知道用什么来将下面的前两个组件与一个条件组合在一起。

附注。 Fragment、DirectoryRef 和 Directory 我不允许更改。

我想要这样的东西:

  <Fragment>
    <DirectoryRef Id="blbalba">
         <Directory Id="bin" Name="bin">
          
           **<Condition>**
            <my condition>    
             <Component Id="id1.dll" Guid="{a guid}">
                <File Id="id2.dll" KeyPath="yes" Source="mysource.dll" />
             </Component>
            
            <Component Id="id3.dll" Guid="{another guid}">
                <File Id="id3.dll" KeyPath="yes" Source="anothermysource.dll" />
            </Component>
           **</Condition>**

            <Component> **bla bla bla no condition here**
            </Component>

        </Directory>
    </DirectoryRef>
  </Fragment>

解决方法

您可以将组件分组为一个功能并为此功能定义单个条件。

否则,您必须为每个组件单独定义每个条件。

条件只能在这些元素上设置:Component、Control、Feature、Fragment、PermissionEx、Product

https://wixtoolset.org/documentation/manual/v3/xsd/wix/condition.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。