Skip to content
⌘ NSIS Forum Archive

Windows 11 detection

5 posts

mrjohn#

Windows 11 detection

Hi
is there a way to detect windows 11?

WinVer.nsh and https://nsis.sourceforge.io/Get_Windows_version not updated for it

thanks
Anders#
Why do you care? It is better to test for features rather than the version.

If there is no other way; ${If} ${AtLeastBuild} 22000
mrjohn#
I have a software that has a specific behavior in w11 and I have to create a 'patch' for it

I'll test soon this code also:
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "ProductName"
 ${StrStrAdv} $R1 "$R0" "indows 11" ">" "<" "0" "0" "0"
${IfNot} $R1 == ''
...
${Endif} 
thanks
Anders#
While you wait for the next release:

!include WinVer.nsh
!define /IfNDef AtLeastWin11 'U>= WinVer_BuildNumCheck 22000'
!define /IfNDef AtMostWin11  'U<= WinVer_BuildNumCheck 22000'