禁止32位安装包运行在64位操作系统上

Windows installer提供了一个“Msix64”属性帮我们检测当前系统是32位还是64位。

The Msix64 property is defined only if running on an x64 processor.

当检测到是64位系统时可以禁止继续运行安装包,在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以上版本的支持,也就是说要求操作系统的Window Installer版本至少是3.1. 在安装包中我们可以指定安装包要求的Windows Installer的最低版本:

<Package InstallerVersion="310" Compressed="yes" />

*InstallerVersion = Windows Installer版本 * 100, 所以310表示3.1.  

相关链接:

posted @ 2014-08-14 16:05  排骨虾  阅读(720)  评论(0编辑  收藏  举报