假如要检测安装包是否在 Windows 的 Server 版本上运行,如果是,则显示一条消息并退出安装程序。Windows Installer 可以为我们做以上事。
属性
MSI 具有许多内置属性 ,这些属性允许我们检测运行包的 Windows 版本,以及一个名为 launch conditions 的工具,用于在不满足用户指定的条件时阻止包。
MsiNTProductType 属性具有以下值:
ValueMeaning1Windows 2000 Professional and later2Windows 2000 domain controller and later3Windows 2000 Server and later所以如果MsiNTProductType 属性不是1,则表明在WIndows Server上运行。
条件和表达式