一个 32 位 MSI 中的 Wix 32 和 64 位组件

Wix 32 and 64 Bit Components within one 32 Bit MSI

我尝试了几个小时来创建一个集成了 32 位和 64 位版本的 exe 文件的 32 位安装程序。但似乎 64 位 exe 从未集成到安装程序中。

是否可以将两个版本集成到一个安装程序中?如果两者都使用相同的路径和一切。我只希望根据安装 32 位或 64 位版本的条件。

wix 文件如下所示:

<?xml version="1.0" encoding="UTF-8"?>

<Product Id="0E69C1BC-D9CD-4886-83D6-6240AEDC4D4F" Name="!(loc.ApplicationName)" Language="!(loc.Language)" Version="$(var.VersionNumber)" Manufacturer="!(loc.ManufacturerFullName)" UpgradeCode="$(var.UpgradeCode)">
   …

  <Property Id="OFFICEVERSION">
    <RegistrySearch Id="OfficeVersion"
                    Root="HKCR"
                    Key="Outlook.Application\CurVer"
                  Type="raw" />
  </Property>

<Property Id="Office64" Value="no"/>

…

<Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">

      <!-- 32-Bit -->
      <Component Id="ml.32" Guid="{8739FAD5-28ED-4F19-B25A-8CC05BA87174}"  >
        <File Source="$(var.ProjectDir)..\build\x86\ml.exe" Id="mlExe" KeyPath="yes"/>
         <Condition><![CDATA[NOT Office64]]></Condition>
      </Component>

      <!-- 64-Bit -->
      <Component Id="ml.64" Guid="{8B6345EE-689D-4E13-882D-CF5B4F97252A}" >
        <File Source="$(var.ProjectDir)..\build\x64\ml.exe" Id="mlExe64" KeyPath="yes" />
       <Condition><![CDATA[Office64]]></Condition>
      </Component>

      …

    </ComponentGroup>
</Fragment>

有人对此有想法吗?

32-bit packages do not support 64-bit components. To install 64-bit components, you must use a 64-bit package.