Restore UAC elevation in the uninstaller.

master
Fedor 2020-07-16 03:29:18 +03:00
parent 764fb0f07f
commit 1fb3124661
1 changed files with 7 additions and 28 deletions

View File

@ -5124,6 +5124,9 @@
${GetParameters} $R8
; Require elevation if the user can elevate
${ElevateUAC}
${If} $R8 != ""
; Default install type
StrCpy $InstallType ${INSTALLTYPE_BASIC}
@ -5176,28 +5179,14 @@
FileClose $R5
Delete $R6
${If} ${Errors}
; Attempt to elevate and then try again.
${ElevateUAC}
GetTempFileName $R6 "$INSTDIR"
FileOpen $R5 "$R6" w
FileWrite $R5 "Write Access Test"
FileClose $R5
Delete $R6
${If} ${Errors}
; Nothing initialized so no need to call OnEndCommon
Quit
${EndIf}
; Nothing initialized so no need to call OnEndCommon
Quit
${EndIf}
${Else}
CreateDirectory "$INSTDIR"
${If} ${Errors}
; Attempt to elevate and then try again.
${ElevateUAC}
CreateDirectory "$INSTDIR"
${If} ${Errors}
; Nothing initialized so no need to call OnEndCommon
Quit
${EndIf}
; Nothing initialized so no need to call OnEndCommon
Quit
${EndIf}
${EndIf}
@ -5229,20 +5218,10 @@
${EndIf}
!endif
${EndIf}
${Else}
; If this isn't an INI install, we need to try to elevate now.
; We'll check the user's permission level later on to determine the
; default install path (which will be the real install path for /S).
; If an INI file is used, we try to elevate down that path when needed.
${ElevateUAC}
${EndUnless}
${EndIf}
ClearErrors
${IfNot} ${Silent}
${ElevateUAC}
${EndIf}
Pop $R5
Pop $R6
Pop $R7