Changes

Check Version (Windows)

528 bytes added, 07:38, 23 March 2016
from wpkg package
==Checking the version of Windows==
The following examples show you how to determine which version of Windows you are running.
 
Note: since wpkg 1.2 you should better use [[Extended host attribute matching]]
===from wpkg package===
<!-- windows 7 -->
<check type="registry" condition="equals" path="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion" value="6.1" />
<!-- windows 8 -->
<check type="registry" condition="equals" path="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion" value="6.2" />
<!-- windows 8.1 -->
<check type="registry" condition="equals" path="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion" value="6.3" />
<!-- windows 10 -->
<check type="registry" condition="equals" path="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion" value="10.0" />
</source>
This apporach approach can be used to limit a package to certain versions of windows; for example Windows7 already has Internet Explorer 8 installed, so to use a package in a mixed environment with xp and windows7 you could write a check like this:
<source lang="xml">
<check type="logical" condition="or">
===notes===
The environment variable ProgramW6432 is only definded defined in 64bit versions of Windows.
Be careful when using the PROCESSOR_ARCHITECTURE environment Variable or reading the value from HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE, as multiple processors can run 64bit OS, including AMD64, IA64 and "things to come".
11
edits