How to check the system is Windows 7 or Windows Server 2008 R2 in Wix Installer?

后端 未结 4 1757
伪装坚强ぢ
伪装坚强ぢ 2020-12-15 10:12

I am working on a windows installer project. And now I only want the software only can be installed on Windows 7 or Windows Server 2008 R2 system, I tried to use this:

相关标签:
4条回答
  • 2020-12-15 10:26

    Vista and Server 2008 pre-SP2 have the same major version number. You also need to look for the Wix equivalent to 'VER_NT_SERVER' (InstallShield). (at work now, don't have Wix installed here)

    0 讨论(0)
  • 2020-12-15 10:36

    You can use the MsiNTProductType property to detect if it is a server os. In combination with the NT version check you can check if you have Windows Server 2008R2. This would look like the following:

    <Condition Message="Windows Server 2008R2 required">
      <![CDATA[(VersionNT = 601 AND MsiNTProductType > 1) OR Installed]]>
    </Condition>
    
    0 讨论(0)
  • 2020-12-15 10:39

    See https://www.msigeek.com/442/windows-os-version-numbers and https://www.lifewire.com/windows-version-numbers-2625171for an example

    <Condition Message='Windows 95'>Version9X = 400</Condition>
    <Condition Message='Windows 95 OSR2.5'>Version9X = 400 AND WindowsBuild = 1111</Condition>
    <Condition Message='Windows 98'>Version9X = 410</Condition>
    <Condition Message='Windows 98 SE'>Version9X = 410 AND WindowsBuild = 2222</Condition>
    <Condition Message='Windows ME'>Version9X = 490</Condition>
    <Condition Message='Windows NT4'>VersionNT = 400</Condition>
    <Condition Message='Windows NT4 SPn'>VersionNT = 400 AND ServicePackLevel = n</Condition>
    <Condition Message='Windows 2000'>VersionNT = 500</Condition>
    <Condition Message='Windows 2000 SPn'>VersionNT = 500 AND ServicePackLevel = n</Condition>
    <Condition Message='Windows XP'>VersionNT = 501</Condition>
    <Condition Message='Windows XP SPn'>VersionNT = 501 AND ServicePackLevel = n</Condition>
    <Condition Message='Windows XP Home SPn'>VersionNT = 501 AND MsiNTSuitePersonal AND ServicePackLevel = n</Condition>
    <Condition Message='Windows Server 2003'>VersionNT = 502</Condition>
    <Condition Message='Windows Vista'>VersionNT = 600</Condition>
    <Condition Message='Windows Vista SP1'>VersionNT = 600 AND ServicePackLevel = 1</Condition>
    <Condition Message='Windows Server 2008'>VersionNT = 600 AND MsiNTProductType = 3</Condition>
    <Condition Message='Windows 7'>VersionNT = 601</Condition>
    <Condition Message='Windows 8'>VersionNT = 602</Condition>
    
    0 讨论(0)
  • 2020-12-15 10:47

    Just check for VersionNT 601 or newer, Windows 7 and Server 2008 R2 both have the same value.

    <Condition Message="Win7 or 2008 R2 required"><![CDATA[Installed OR VersionNT >= 601]]></Condition>
    
    0 讨论(0)
提交回复
热议问题