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:
<Condition Message='Windows Server 2008 R2 or Windows 7 is required'>(VersionNT = 600 AND ServicePackLevel = 1) OR VersionNT = 601 </Condition>
but it can still be installed on Windows Vista. Please help!
Thank you!
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)
See https://www.msigeek.com/442/windows-os-version-numbers and https://www.lifewire.com/windows-version-numbers-2625171for an example
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:Just check for VersionNT 601 or newer, Windows 7 and Server 2008 R2 both have the same value.