azure-devops - 如何在 Azure Devops 中使用 WIX 创建 .msi 安装程序?

标签 azure-devops msbuild wix windows-installer azure-yaml-pipelines

我正在尝试使用 yaml 脚本在 azure devops 中为我的 dektop 应用程序创建一个带有 wix 的 .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.

提前致谢。

最佳答案

我们也遇到过这个问题。我们的解决方案是从解决方案文件中删除 Installer 项目,继续使用标准 MSBuild 任务构建解决方案中的其他项目,然后将 script 任务添加到管道以生成微星:

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'

请注意,我们的构建基于包含 WiX 工具集的 windows-latest 镜像;查看所有随附工具的列表 here .

关于azure-devops - 如何在 Azure Devops 中使用 WIX 创建 .msi 安装程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66740839/

相关文章:

azure-devops - 如果特定文件已更改,合并或构建会失败吗?

Azure Devops 拆分字符串函数

azure - 从 Visual Studio Team Services (VSO) 部署 Azure WebApp

msbuild - 如何将构建定义从 TFS2010 克隆/复制到 TFS2012

c# - 自定义操作 dll 不工作。安装程序显示错误 : Wizard ended prematurely

azure - 通过 Azure DevOps Pipelines 部署 DACPAC 时出错

javascript - 从 MSBuild SonarQube Runner Analysis 中删除单个 JavaScript 文件

.net-core - 仅在 .NET Core 3.1 项目中进行目标重建

只有欢迎屏幕和已完成屏幕的 WiX 脚本

windows - WiX bundle 安装强制重启详细信息