2

I have already read through Windows wiki page - https://nsis.sourceforge.io/Get_Windows_version and I understand that GetWindowsVersion plugin is limited only until Windows 8.1. How can I ensure to check windows version for Windows 10 and Windows server 2019?

PS: I have already referred - NSIS Detect Windows Version and I see that this thread is a little outdated.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
  • "*I see that this thread is a little outdated*" did you try each answer for Win10/2019? Just because it's old doesn't mean it won't still work :-) – TylerH Feb 19 '21 at 07:34
  • Yes i tried, for windows 10 it does show as windows 10 , but same happens for windows 19 as well. Here is my code snippet- `GetVersion::WindowsVersion Pop $R0 DetailPrint "WindowsVersion: $R0 "` – Ravikiran R Feb 19 '21 at 07:58

1 Answers1

4

Use WinVer.nsh

!include WinVer.nsh

Function .onInit
${IfNot} ${AtLeastWin10}
  MessageBox mb_iconStop "Windows 10 blah blah" 
  Abort
${EndIf}
FunctionEnd

Asking for plain Windows 10 but a specific server version is rather strange but if you must:

${If} ${IsServerOS}
${AndIf} ${AtLeastWaaS} 1809
  ...
${EndIf}
Anders
  • 97,548
  • 12
  • 110
  • 164