简体   繁体   English

Wix设置-检查Windows 2012 R2是否

[英]Wix setup - check if windows 2012 R2

Need to check if msi is running on Windows Server 2012 with R2. 需要检查msi是否在带有R2的Windows Server 2012上运行。 So, if it runs on Server 2012 - error. 因此,如果它在Server 2012上运行-错误。 If it runs on windows 8 - OK. 如果它在Windows 8上运行-确定。 If it runs on any Server 2008 - OK. 如果它在任何Server 2008上运行-确定。

I tried the following condition, but it shows error also on win 8, why? 我尝试了以下条件,但在win 8上也显示错误,为什么?

<Condition Message='This application only runs on Windows Server 2012 R2 or higher'>
  NOT VersionNT = 602 AND MsiNTProductType > 1
</Condition>

As you discovered, you're interested in the VersionNT and MsiNTProductType properties. 如发现的那样,您对VersionNTMsiNTProductType属性感兴趣。

However, launch conditions use a positive syntax -- you specify the valid condition(s). 但是,启动条件使用肯定的语法-您指定有效条件。 The NOT in your comment's answer will cause the installer to fail for Windows Server 2012 and proceed for everything else. NOT在您的评论的回答会导致安装失败的Windows Server 2012,并进行了一切。

Also note that Windows Server 2012 R2's version is 6.03, not 6.02. 另请注意,Windows Server 2012 R2的版本是6.03,而不是6.02。

For Windows Server 2012 R2 only, you want: 仅对于Windows Server 2012 R2,您需要:

<Condition Message="This application only runs on Windows Server 2012 R2 or higher">
    <![CDATA[VersionNT>=603 AND MsiNTProductType=3]]>
</Condition>

I used VersionNT>=603 to reflect that your error string says "...or higher." 我使用VersionNT>=603来反映您的错误字符串显示为“ ...或更高版本”。

For Windows Server 2012 and Windows 8: 对于Windows Server 2012和Windows 8:

<Condition Message="This application only runs on...">
    <![CDATA[VersionNT>=602]]>
</Condition>

For Windows Server 2012, Windows 8, and Windows Server 2008: 对于Windows Server 2012,Windows 8和Windows Server 2008:

<Condition Message="This application only runs on...">
    <![CDATA[VersionNT>=602 OR (VersionNT>=600 AND MsiNTProductType=3)]]>
</Condition>

我发现了一种验证WS2012 R2的方法,如果仍然可以帮助某些人的话:

    <![CDATA[(VersionNT64 = 603 AND MsiNTProductType <> 1)]]>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM