You need to enable JavaScript to run this app. Wix细粒度打包场景下Bundle.wixproj自定义MSI源路径的方法问询
优惠活动
大模型
产品
解决方案
定价
更多

Wix细粒度打包场景下Bundle.wixproj自定义MSI源路径的方法问询

解决方法

有两种可行的方案可以实现你的需求,优先推荐第一种,可控性更高:

方案1:自定义属性直接指定MSI路径

这种方式完全绕开项目引用的默认路径规则,适合你提前单独编译好两个MSI的场景:

  1. 先修改Bundle项目的.wxs源文件,把MsiPackage的SourceFile属性替换为自定义的MSBuild变量:
<MsiPackage Id="Client" SourceFile="$(CustomClientMsiPath)" Vital="no" /> 
<MsiPackage Id="Server" SourceFile="$(CustomServerMsiPath)" Vital="no" />
  1. 执行Bundle构建时,直接传入你提前编译好的两个MSI的完整路径即可:
msbuild Bundle.wixproj /p:OutputPath=$installerPath /p:CustomClientMsiPath=$yourMsiDir\Client.msi /p:CustomServerMsiPath=$yourMsiDir\Server.msi

方案2:正确配置多路径的LinkerBindInputPaths

你之前配置不生效的原因是:MSBuild中重复传入同一个属性会发生值覆盖,多个路径需要用分号分隔放在同一个属性值里:

msbuild Bundle.wixproj /p:OutputPath=$installerPath /p:LinkerBindInputPaths="$binariesPath\Client;$binariesPath\Server"

注意:使用这个方案需要保证你提前编译好的MSI文件名,和ClientInstaller、ServerInstaller项目默认输出的文件名完全一致,否则WiX链接器无法匹配到对应文件。

内容的提问来源于stack exchange,提问作者yoger

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.13 23:21:02