request admin elevation for uninstaller as well

This commit is contained in:
Stephen Birarda 2016-01-13 12:30:07 -08:00
parent 75a8ab56bc
commit 265879cacf

View file

@ -31,10 +31,14 @@
;-------------------------------- ;--------------------------------
;General ;General
; Require administrator access
RequestExecutionLevel admin
!ifdef INNER !ifdef INNER
!echo "Inner invocation" ; just to see what's going on !echo "Inner invocation" ; just to see what's going on
OutFile "$%TEMP%\tempinstaller.exe" ; not really important where this is OutFile "$%TEMP%\tempinstaller.exe" ; not really important where this is
SetCompress off ; for speed SetCompress off ; for speed
!else !else
!echo "Outer invocation" !echo "Outer invocation"
@ -42,7 +46,7 @@
; it is invoked, will just write the uninstaller to some location, and then exit. ; it is invoked, will just write the uninstaller to some location, and then exit.
; Be sure to substitute the name of this script here. ; Be sure to substitute the name of this script here.
!system "set __COMPAT_LAYER=RunAsInvoker && $\"${NSISDIR}\makensis$\" /DINNER project.nsi" = 0 !system "$\"${NSISDIR}\makensis$\" /DINNER project.nsi" = 0
; Require administrator access ; Require administrator access
RequestExecutionLevel admin RequestExecutionLevel admin
@ -52,6 +56,12 @@
!system "$%TEMP%\tempinstaller.exe" = 2 !system "$%TEMP%\tempinstaller.exe" = 2
; The Inner invocation has written an uninstaller binary for us.
; We need to sign it if it's a production or PR build.
!if @PRODUCTION_BUILD@ == 1
!system '"@SIGNTOOL_EXECUTABLE@" sign /f %HF_PFX_FILE% /p %HF_PFX_PASSPHRASE% /tr http://tsa.starfieldtech.com /td SHA256 $%TEMP%\uninstaller.exe' = 0
!endif
; Good. Now we can carry on writing the real installer. ; Good. Now we can carry on writing the real installer.
;Name and file ;Name and file
@ -1096,12 +1106,6 @@ Function .onInit
WriteUninstaller "$%TEMP%\uninstaller.exe" WriteUninstaller "$%TEMP%\uninstaller.exe"
; We've written the uninstaller binary.
; We need to sign it if it's a production or PR build.
!if @PRODUCTION_BUILD@ == 1
!system '"@SIGNTOOL_EXECUTABLE@" sign /f %HF_PFX_FILE% /p %HF_PFX_PASSPHRASE% /tr http://tsa.starfieldtech.com /td SHA256 $%TEMP%\uninstaller.exe' = 0
!endif
; just bail out quickly when running the "inner" installer ; just bail out quickly when running the "inner" installer
Quit Quit
!endif !endif