wix - 如何从命令行选择功能

标签 wix

这可能是一个幼稚的问题。我必须手动编辑.WXS文件,以使其支持从命令行选择功能。

例如,.WXS文件中有3个功能。

<Feature Id="AllFeature" Level='1'>

    <Feature Id="Feature1" Level='1'> </Feature>

    <Feature Id="Feature2" Level='1'> </Feature>

    <Feature Id="Feature3" Level='1'> </Feature>

</Feature>

现在,我想从命令行中选择功能。说,如果我键入“msiexec / i install.msi FEATURE = A”,则将安装“Feature1”和“Feature2”;如果键入“msiexec / i install.msi FEATURE = B”,则将安装“Feature1”和“Feature3”。在这种情况下,“A”映射到功能1和功能2; “B”映射​​到功能1和功能3。

如何在WIX中完成这项工作?

最佳答案

我将Feature1,Feature2和Feature3更改为Components,然后声明如下内容:

<Feature Id="FEATUREA" Title="Super" Level="1" >
  <ComponentRef Id="Component1" />
  <ComponentRef Id="Component2" />
</Feature>

<Feature Id="FEATUREB" Title="Super1" Level="1" >
  <ComponentRef Id="Component1" />
  <ComponentRef Id="Component3"/>
</Feature>

然后安装FeatureA或FeatureB
msiexec /i install.msi ADDLOCAL=[FEATUREA | FEATUREB]

关于wix - 如何从命令行选择功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/246329/

相关文章:

sql - 如何在 Wix 中添加测试 sql 连接按钮

wix - Windows Installer 实例转换如何与升级交互?

installation - WiX bundle :condition - util:RegistrySearch variable always false

64 位 WiX 自定义操作

wix - 默认情况下,每用户 MSI 未提升 - 如何显示写入文件夹的提升提示?

WiX 重大升级拒绝替换现有文件!

asp.net-mvc - 如何使用 WIX 在 IIS 6 上安装 ASP.NET MVC 3 应用程序?

permissions - WiX 权限,如何根据 DACL 标志表示 'Modify'

wix - (WiX) 将同一文件安装到多个位置

wix - 根据情况在卸载期间保存组件