Skip to content

Commit fe5f3f0

Browse files
committed
Add documentation on how to block installation based on OS versions
Attempt on addressing wixtoolset/issues#8785 by extending the WiX documentation to also cover an OS version check that I believe is quite common.
1 parent 7dc7efe commit fe5f3f0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
sidebar_position: 91
3+
---
4+
5+
# How To: Block installation based on OS version
6+
7+
It is often desirable to block installation of an application on too old Windows versions. The following sample demonstrates how to block installation on Windows versions prior to Windows 10 version 21H1.
8+
9+
```xml
10+
<Property Id="WINDOWSBUILDNUMBER" Secure="yes">
11+
<RegistrySearch Id="BuildNumberSearch" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion" Name="CurrentBuildNumber" Type="raw" />
12+
</Property>
13+
<Launch Condition="Installed OR (WINDOWSBUILDNUMBER &gt;= 19044)" Message="This application require Windows 10 version 21H1 (build 19044) or newer." />
14+
```
15+
16+
The sample uses the `SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentBuildNumber` registry key to detect the current Windows version.

0 commit comments

Comments
 (0)