2

使用 WIX,我需要创建一个可以在 32 位和 64 位机器上工作的 msi 或 exe,具体取决于系统。

4

1 回答 1

2

您不能,因为 MSI 格式要求您指定处理器架构。因此,您必须创建两个单独的 .msi 文件,但您至少可以从 Wix 中的同一个项目文件生成它们,这样可以避免一些重复的工作。

我用这个:

<?if $(var.Platform) = x64 ?>
<?define ProductName = "InsomniacGeek: Windows Setup Test (64 bit)" ?>
<?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
<?define ProductName = "InsomniacGeek: Windows Setup Test" ?>
<?define Win64 = "no" ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif ?>


<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="$(var.Platform)"/>

然后您必须构建项目并创建一个 32 位 Msi 和 64 位 Msi。

于 2013-02-25T09:22:47.493 回答