2013-02-25 61 views

回答

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位的微星。

+0

使用刻錄您可以創建引導程序來檢查操作系統並安裝相應的msi。 – BryanJ 2013-02-25 13:23:27

+0

Platform =「$(var.Platform)」,顯示該軟件包支持的平臺。不鼓勵使用這個屬性;相反,請在candle.exe命令行中指定-arch開關,或者在.wixproj MSBuild項目中指定InstallerPlatform屬性。 – 2013-02-27 01:39:40

+0

由於文本$(var.Platform)不是用於WiX源文件的XML架構中定義的平臺枚舉值之一,因此我只在Votive中得到一條扭曲的線條和警告。一旦預處理器完成文件,屬性的值是有效的,蠟燭將愉快地接受它。你使用的是什麼版本的Wix? – 2013-02-27 09:14:08