为什么 Azure 构建代理不包含 Wix 捆绑包中的可执行文件?

发布于 2025-01-14 00:21:24 字数 1313 浏览 3 评论 0原文

我想在我的 Wix 捆绑包中包含 Visual C++ 可再发行可执行文件(用于脱机安装)。

当我在我的 PC 上构建捆绑包(使用 Visual Studio 或命令行)时,它运行得很好。

我的问题是,当使用 Azure 构建代理生成捆绑包时,它无法按预期工作。 Azure 捆绑包安装无法正常工作,而在我的电脑上生成捆绑包后却可以正常工作。 Azure 管道日志中没有警告或错误。

捆绑包已生成,但其大小与我的电脑上生成的捆绑包的大小不同。大小差异等于 Visual C++ 可再发行可执行文件的大小。因此,当 Azure 构建代理完成构建时,可执行文件似乎不包含在捆绑包中。

使用 Azure 构建代理时,如何确保可执行文件正确嵌入到 Wix 捆绑包中?

这是我的代码片段:

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'

我在 PC 上使用的命令行:

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

谢谢您的帮助。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青衫负雪 2025-01-21 00:21:24

我在这里找到了解决方案: stackoverflow.com/a/56838104/8183789

我需要使用大文件存储(LFS)

我在 .yml Azure 管道文件中添加了以下内容:

steps:
- checkout: self
  lfs: true

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文