如何在Azure DevOps中使用WIX创建.msi安装程序?

4

我正在尝试使用wix为我的桌面应用程序在Azure DevOps中使用yaml脚本创建.msi安装程序包。下面是为此创建的msbuild任务:

- task: MSBuild@1
  inputs:
    solution: '**/*.wixproj'
#    platform: 'Any CPU'
    configuration: 'Release'
    msbuildArguments: '/p:Configuration=Release/p:ProductCode=${product_code} /p:UpgradeCode=${upgrade_code}/t:Clean;Rebuild'
    clean: true

以下是我在管道构建过程中遇到的错误:

 Error MSB3441: Cannot get assembly name for "..\MyProject\bin\Release\MyProject.exe". Could not load file or assembly 'MyProject.exe' or one of its dependencies. The system cannot find the path specified.

提前致谢。

2个回答

2

我们也遇到了这个问题。我们的解决方案是从解决方案文件中移除安装程序项目,继续使用标准的 MSBuild 任务构建其他项目,然后添加 script 任务到管道中生成 MSI 文件:

pool:
  vmImage: windows-latest

steps:
    - script: .\Tools\Wix\candle.exe -nologo Foobar.wxs -out Foobar.wixobj -ext WixUIExtension
      displayName: 'Compile Wix file'
    
    - script: .\Tools\Wix\light.exe -nologo Foobar.wixobj -out Foobar.msi -ext WixUIExtension
      displayName: 'Create MSI file'

请注意,我们的构建基于windows-latest镜像,该镜像包括WiX Toolset;请查看所有已包含工具的列表 这里

0

我没有自定义参数,所以可能这里的区别就在于此,但我使用了 Azure Pipelines 提供的模板化 msbuild 任务。它生成了下面的 yaml,并且可以在管道中很好地构建 msi。

- task: MSBuild@1
  inputs:
    solution: '**/*.wixproj'
    msbuildArchitecture: 'x64'
    platform: 'x64'
    configuration: 'Release'
  displayName: 'build installer'

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接