Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 366
Ray Avatar asked Apr 28 '10 22:04

Ray


People also ask

How do I install WiX on Windows?

Step 1: To download and install WiX on windows, go to the official website of WiX as below https://wixtoolset.org/releases and choose the recommended build number, here we have chosen V3. 11.1 and click on the download button.

What is VersionNT64?

VersionNT64. This property stores the version number of a Windows NT-based operating system as an integer on 64-bit systems only.

Is WiX Installer open source?

WiX was the first Microsoft project to be released under an open-source license, the Common Public License. Initially hosted on SourceForge, it was also the first Microsoft project to be hosted externally.


2 Answers

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>
like image 73
Preet Sangha Avatar answered Oct 23 '22 14:10

Preet Sangha


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>
like image 29
saschabeaumont Avatar answered Oct 23 '22 14:10

saschabeaumont