一个MSI用于32位和64位

时间:2012-09-03 08:48:39

标签: wix windows-installer platform

任何人都可以给我一个很好的例子,或者让我按照正确的方向为我的安装程序启用32位和64位。我正在使用Wix 3.6。

我试过这个:

<?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)" />

它不喜欢这个,但它说平台属性无效,有没有人有这个功能,可以帮助我吗?

1 个答案:

答案 0 :(得分:2)

这正是我做的方式,而且效果非常好。

你在Votive中得到了一条波浪线和一个警告,因为文字文本$(var.Platform)不是XML Schema for WiX源文件中定义的平台枚举值之一。预处理器完成文件后,属性的值有效,candle将很乐意接受它。

已编辑添加: This question and its answers are a great WiX resource