File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 2020; --------------------------------
2121; General
2222
23+
2324; Name and file
2425Name " PC-BASIC 3.23"
2526OutFile " pcbasic-win32.exe"
2627
28+
29+
30+
31+
32+
2733; Default installation folder
2834InstallDir " $programfiles\PC-BASIC"
2935; Get installation folder from registry if available
3036InstallDirRegKey ${INSTDIR_REG_ROOT} " ${INSTDIR_REG_KEY}" " InstallDir"
3137
3238; Request application privileges for Windows Vista
33- RequestExecutionLevel user
39+ ; RequestExecutionLevel user
40+
41+ RequestExecutionLevel admin ; Require admin rights on NT6+ (When UAC is turned on)
42+
43+ !include LogicLib.nsh
44+
45+
3446
3547; Start Menu Folder Page Configuration
3648!define MUI_STARTMENUPAGE_REGISTRY_ROOT " HKCU"
@@ -115,6 +127,15 @@ SectionEnd
115127
116128Function .onInit
117129 ; prepare log always within .onInit function
130+
131+ UserInfo::GetAccountType
132+ pop $0
133+ ${If} $0 != " admin" ; Require admin rights on NT4+
134+ MessageBox mb_iconstop " Administrator rights required!"
135+ SetErrorLevel 740 ; ERROR_ELEVATION_REQUIRED
136+ Quit
137+ ${EndIf}
138+
118139 !insertmacro UNINSTALL.LOG_PREPARE_INSTALL
119140FunctionEnd
120141
You can’t perform that action at this time.
0 commit comments