File tree 1 file changed +22
-1
lines changed 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 20
20
; --------------------------------
21
21
; General
22
22
23
+
23
24
; Name and file
24
25
Name " PC-BASIC 3.23"
25
26
OutFile " pcbasic-win32.exe"
26
27
28
+
29
+
30
+
31
+
32
+
27
33
; Default installation folder
28
34
InstallDir " $programfiles\PC-BASIC"
29
35
; Get installation folder from registry if available
30
36
InstallDirRegKey ${INSTDIR_REG_ROOT} " ${INSTDIR_REG_KEY}" " InstallDir"
31
37
32
38
; 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
+
34
46
35
47
; Start Menu Folder Page Configuration
36
48
!define MUI_STARTMENUPAGE_REGISTRY_ROOT " HKCU"
@@ -115,6 +127,15 @@ SectionEnd
115
127
116
128
Function .onInit
117
129
; 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
+
118
139
!insertmacro UNINSTALL.LOG_PREPARE_INSTALL
119
140
FunctionEnd
120
141
You can’t perform that action at this time.
0 commit comments