首页 > 学院 > 开发设计 > 正文

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

2019-11-17 02:58:24
字体:
来源:转载
供稿:网友

禁止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.

相关链接:

  • Windows Installer介绍

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表