Skip to content

Commit 0858dae

Browse files
forderudbarnson
authored andcommitted
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 4946e75 commit 0858dae

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+
title: Launch conditions
3+
---
4+
5+
# How To: Block installation based on OS version
6+
7+
It's common to want to block installers from running on old versions of Windows. The following sample blocks installation on versions of Windows earlier than Windows 10 version 21H1. You can choose different minimum versions by replacing `19044` with a different version number.
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)