Old 18th June 2022, 10:44   #1
mrjohn
Member
 
Join Date: Feb 2009
Posts: 69
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
mrjohn is offline   Reply With Quote
Old 18th June 2022, 11:36   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,539
Why do you care? It is better to test for features rather than the version.

If there is no other way; ${If} ${AtLeastBuild} 22000

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 18th June 2022, 12:41   #3
mrjohn
Member
 
Join Date: Feb 2009
Posts: 69
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:
PHP Code:
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "ProductName"

 
${StrStrAdv$R1 "$R0" "indows 11" ">" "<" "0" "0" "0"

${IfNot$R1 == ''
...
${Endif} 
thanks
mrjohn is offline   Reply With Quote
Old 19th June 2022, 21:10   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,539
While you wait for the next release:

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

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 20th June 2022, 08:18   #5
mrjohn
Member
 
Join Date: Feb 2009
Posts: 69
good,thanks
mrjohn is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump