使用 WIX,我需要创建一个可以在 32 位和 32 位中运行的 msi 或 exe 64位机器取决于系统。
最佳答案
您不能,因为 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。
关于wix - 32 位和 64 位的单个 MSI 取决于目标机器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15059520/