installation - 如何在 Wix 中使用可配置的合并模块?

标签 installation wix windows-installer wix3

AFAIK 是这样完成的:

产品:

<Merge Id ="HelpInstaller" SourceFile="HelpInstaller.msm" Language="1033" DiskId="1">
                <ConfigurationData Name="SurpressInstallation_Config" Value="&amp;HelpFeature"/>
 </Merge>





合并模块:
<Property Id="SupressInstallation" Value='0'  />

<Substitution Table='CustomAction' Row='SetSupressInstallationProperty' Column='Target' Value='[=SupressInstallation_Config]'/>
<CustomAction Id='SetSupressInstallationProperty' Property='SupressInstallation'      Value='[SupressInstallation]'/>  
<InstallExecuteSequence>
  <Custom Action='SetSupressInstallationProperty' Before='RegisterHelp' />
  <Custom Action='RegisterHelp' After='CostFinalize'>(NOT Installed) AND (NOT UPGRADINGPRODUCTCODE) AND SupressInstallation = 3) </Custom>
</InstallExecuteSequence>

但是当我像上面那样做时,我得到一个错误:
遇到“msmErrorDataRequestFailed”类型的意外合并错误,目前没有要显示的错误消息。

谁能告诉我如何解决这个问题?我基本上想做的是仅在选择某个功能时才在合并模块中执行自定义操作。这是正确的方法吗?谢谢丹尼尔

最佳答案

您必须在模块下定义配置节点:

<Property Id="SupressInstallation" Value='0'  />
<Configuration Name="SupressInstallation_Config" Format="Text"/>
<Substitution Table='CustomAction' Row='SetSupressInstallationProperty' Column='Target' Value='[=SupressInstallation_Config]'/>
<CustomAction Id='SetSupressInstallationProperty' Property='SupressInstallation'      Value='[SupressInstallation]'/>  
<InstallExecuteSequence>
  <Custom Action='SetSupressInstallationProperty' Before='RegisterHelp' />
  <Custom Action='RegisterHelp' After='CostFinalize'>(NOT Installed) AND (NOT UPGRADINGPRODUCTCODE) AND SupressInstallation = 3) </Custom>
</InstallExecuteSequence>

关于installation - 如何在 Wix 中使用可配置的合并模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2091724/

相关文章:

javascript - 在 Windows 上静默安装 Qt55 Enterprise

c# - 在 c#\.NET 中使用自定义操作的 wix 3.5 静默安装程序

installation - 从 32 位安装程序写入 64 位注册表

download - Raspberry Pi 2 - 卡在 apt-get 上(gnome 用户指南)

wix - 访问延迟的 .net 自定义操作中的 wix 属性值

c# - InstallShield 内部错误 2769 - 安装过程中出现错误 1001

electron - Electron NSIS阻止重新安装

c# - 如何在 C# 中使用其产品代码卸载 MSI

.NET Framework 4.0 - 最小的安装程序?

WIX 对话框更改属性文本值