Windows installer提供了一個“Msix64”屬性幫我們檢測當前系統(tǒng)是32位還是64位。
The Msix64 PRoperty is defined only if running on an x64 processor.
當檢測到是64位系統(tǒng)時可以禁止繼續(xù)運行安裝包,在Wix中我們可以添加一個Condition:
<Condition Message="This insatller should be run on a 32-bit Operation system. 64-bit operating system is not supported."> <![CDATA[Not Msix64]]></Condition>
但是注意這個屬性需要Windows Installer 3.1以上版本的支持,也就是說要求操作系統(tǒng)的Window Installer版本至少是3.1. 在安裝包中我們可以指定安裝包要求的Windows Installer的最低版本:
<Package InstallerVersion="310" Compressed="yes" />
*InstallerVersion = Windows Installer版本 * 100, 所以310表示3.1.
相關(guān)鏈接:
新聞熱點
疑難解答