Authenticode signs uninstall.exe too (#72)

This commit is contained in:
Micah Lee 2014-09-24 17:09:47 -07:00
parent bd5a463691
commit f076d68ec6

View File

@ -10,13 +10,10 @@
RequestExecutionLevel admin
SetCompressor /FINAL /SOLID lzma
Name "OnionShare"
InstallDir "$PROGRAMFILES\${APPNAME}"
LicenseData "license.txt"
Icon "onionshare.ico"
OutFile "..\dist\OnionShare_Setup.exe"
!include LogicLib.nsh
@ -34,7 +31,29 @@ ${If} $0 != "admin" ;Require admin rights on NT4+
${EndIf}
!macroend
# in order to code sign uninstall.exe, we need to do some hacky stuff outlined
# here: http://nsis.sourceforge.net/Signing_an_Uninstaller
!ifdef INNER
!echo "Creating uninstall.exe"
OutFile "$%TEMP%\tempinstaller.exe"
SetCompress off
!else
!echo "Creating normal installer"
!system "$\"${NSISDIR}\makensis$\" /DINNER onionshare.nsi" = 0
!system "$%TEMP%\tempinstaller.exe" = 2
!system "signtool.exe sign /v /d OnionShare /a /tr http://www.startssl.com/timestamp $%TEMP%\uninstall.exe" = 0
# all done, now we can build the real installer
OutFile "..\dist\OnionShare_Setup.exe"
SetCompressor /FINAL /SOLID lzma
!endif
Function .onInit
!ifdef INNER
WriteUninstaller "$%TEMP%\uninstall.exe"
Quit # bail out early
!endif
setShellVarContext all
!insertmacro VerifyUserIsAdmin
FunctionEnd
@ -145,7 +164,10 @@ Section "install"
File "${BINPATH}\Include\pyconfig.h"
# uninstaller
WriteUninstaller "$INSTDIR\uninstall.exe"
!ifndef INNER
SetOutPath $INSTDIR
File $%TEMP%\uninstall.exe
!endif
# start menu
CreateShortCut "$SMPROGRAMS\${APPNAME}.lnk" "$INSTDIR\onionshare.exe" "" "$INSTDIR\onionshare.ico"
@ -178,6 +200,7 @@ Function un.onInit
!insertmacro VerifyUserIsAdmin
FunctionEnd
!ifdef INNER
Section "uninstall"
Delete "$SMPROGRAMS\${APPNAME}.lnk"
@ -289,3 +312,4 @@ Section "uninstall"
# remove uninstaller information from the registry
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
SectionEnd
!endif