Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create .msi installer with WIX in Azure Devops?

I am trying to create a .msi installer package with wix for my dektop app in azure devops using yaml scripting. Below is the msbuild task created for the same:

- 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

Below is the error i'm getting during the pipeline build:

 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.

Thanks in advance.

like image 819
Rupal Goyal Avatar asked Sep 18 '25 06:09

Rupal Goyal


1 Answers

We had this problem too. Our solution was to remove the Installer project from the Solution file, continue building the other projects in the solution using the standard MSBuild task and then add script tasks to the pipeline to generate the 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'

Note that our build is based on the windows-latest image which includes WiX Toolset; see the list of all included tools here.

like image 106
fstarnaud Avatar answered Sep 21 '25 14:09

fstarnaud