fix: prevent installs on old windows versions

This commit is contained in:
keejef 2023-09-23 14:29:56 +10:00
parent b550547fcf
commit c299eb06aa
2 changed files with 18 additions and 1 deletions

16
build/installer.nsh Normal file
View File

@ -0,0 +1,16 @@
!include LogicLib.nsh
Function .onInit
; Check Windows major version
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
StrCpy $R1 $R0 1 -1 ; Extract major version (e.g., "10" from "10.0")
IntOp $R1 $R1 - 10 ; Subtract 10
; If major version is less than 10, abort
${If} $R1 < 0
MessageBox MB_OK|MB_ICONERROR "This application requires Windows 10 or higher."
Abort
${EndIf}
FunctionEnd

View File

@ -250,7 +250,8 @@
"nsis": {
"deleteAppDataOnUninstall": true,
"oneClick": false,
"allowToChangeInstallationDirectory": true
"allowToChangeInstallationDirectory": true,
"script": "build/installer.nsh"
},
"linux": {
"category": "Network",