Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/content/docs/wix/tools/launch-conditions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: Launch conditions
---

# How To: Block installation based on OS version

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.

```xml
<Property Id="WINDOWSBUILDNUMBER" Secure="yes">
<RegistrySearch Id="BuildNumberSearch" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion" Name="CurrentBuildNumber" Type="raw" />
</Property>
<Launch Condition="Installed OR (WINDOWSBUILDNUMBER &gt;= 19044)" Message="This application require Windows 10 version 21H1 (build 19044) or newer." />
```

The sample uses the `SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentBuildNumber` registry key to detect the current Windows version.