首页 > 解决方案 > Wix:如何创建超过 2GB 的 bundle.exe(外部文件)

问题描述

我有多个 MSI 文件,我正在使用 WIX 创建包 .exe。捆绑包开始超过 2GB。从这个答案我知道它不能在单个 .exe 文件中完成,因为刻录不支持大于 2GB 的容器。

是否可以使用(例如外部 .cab 文件)生成 .exe 安装程序?
.exe 文件小于 2GB,但它需要外部文件?

标签: cmakewixcpack

解决方案


<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Bundle Name="Bundle Name" Version="1.0.0.0" Manufacturer="Company Inc." UpgradeCode="YOUR_GUID_HERE">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />

    <Chain>
      <MsiPackage SourceFile="stage\msi1.msi" Vital="yes" Visible="yes"/>
      <MsiPackage SourceFile="stage\msi2.msi" Vital="yes" Visible="yes"/>
      <!-- etc... -->
      <!-- msi which will not be compressed: -->
      <MsiPackage DownloadUrl="{0}" SourceFile="stage\external.msi" Vital="yes" Visible="yes"  Compressed="no"/>
    </Chain>
  </Bundle>
</Wix>

这会产生一系列 msi1、msi2 文件(包含在 .exe 中)。
External.msi 文件不包含在 bundle 中,因此在运行 bundle 时需要将其放在 .exe 文件旁边。


推荐阅读