Search code examples
azurevisual-c++wixbundleexe

Why Azure build agent doesn't include executable in Wix bundle?


I want to include a Visual C++ redistributable executable in my Wix bundle (for an offline installation).

It is working great when I build the bundle on my PC (with Visual Studio or command line).

My issue is that it is not working as expected when the bundle is generated with Azure build agent. The Azure bundle installation is not working whereas it works when the bundle is generated on my PC. There is no warning or error in the Azure pipeline log.

The bundle is generated, but its size differs from the size of the bundle generated on my PC. The size difference is equal to the size of the Visual C++ redistributable executable. Therefore, it seems that the executable is not included in the bundle when the build is done by Azure build agent.

How can I ensure that the executable is correctly embedded in the Wix bundle when using Azure build agent?

Here is my code snippet:

Bundle.wxs:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Bundle>
    <BootstrapperApplicationRef />
    <Chain>
        <ExePackage Id="VisualCppRedistributableX86"
            Cache="no" Compressed="yes" PerMachine="yes" Permanent="yes" Vital="yes"
            InstallCommand="/q /norestart"
            SourceFile="$(sys.SOURCEFILEDIR)OfflineRedist\VC_redist.x86.exe"/>
        <MsiPackage/>
    </Chain>
  </Bundle>
</Wix>

Azure.yml:

- task: MSBuild@1
  displayName: 'Building MyBundle'
  inputs:
    solution: 'MyBundle\MyBundle.wixproj'
    msbuildArguments: '-p:RunWixToolsOutOfProc=true;Configuration=Release;Platfrom=x86'

The command line I use on my PC:

msbuild "MyPath\MyBundle\MyBundle.wixproj" -p:RunWixToolsOutOfProc=true;Configuration=Release;Platfrom=x86

Thank you for your help.


Solution

  • I found the solution here: stackoverflow.com/a/56838104/8183789

    I needed to use large file storage (LFS)

    I added the following in my .yml Azure pipeline file:

    steps:
    - checkout: self
      lfs: true