0

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.

Toto
  • 11
  • 3
  • Start by decompling (using `dark.exe`) the Azure Pipeline built bundle. Find the VC redist in the files (you'll need to cross-reference with the `manifest.xml`) and see if that file looks correct. Maybe the file on Azure Pipelines is a zero byte file (or otherwise corrupted). – Rob Mensching Mar 14 '22 at 19:52
  • @rob Thank you for your suggestion. Using Dark.exe I was able to extract the bundle, and I found the VC_redist.x86.exe file. Its size is 133 Bytes, instead of 13725768 Bytes when using my PC. It seems that this 133 Bytes file is a “pointer file” (https://github.com/git-lfs/git-lfs/issues/3128), never heard of it, I can read it with notepad. I modified the Azure pipeline to copy the original VC_redist.x86.exe file in the ArtifactStagingDirectory, and it is the same pointer file of 133 Bytes. But if I download the VC_redist.x86.exe file from the repository, it is the correct size. – Toto Mar 15 '22 at 10:17
  • I found the solution here: https://stackoverflow.com/a/56838104/8183789 I added the following in my .yml pipeline file: steps: - checkout: self lfs: true – Toto Mar 15 '22 at 12:22

1 Answers1

0

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
Toto
  • 11
  • 3