[Pkg-anonymity-tools] [onionshare] 136/140: Authenticode signs uninstall.exe too (#72)

Ulrike Uhlig u-guest at moszumanska.debian.org
Mon Sep 29 20:33:56 UTC 2014


This is an automated email from the git hooks/post-receive script.

u-guest pushed a commit to branch master
in repository onionshare.

commit f076d68ec6e9b61773620df6c4ac26ba6fe876e0
Author: Micah Lee <micah at micahflee.com>
Date:   Wed Sep 24 17:09:47 2014 -0700

    Authenticode signs uninstall.exe too (#72)
---
 setup/onionshare.nsi | 250 ++++++++++++++++++++++++++++-----------------------
 1 file changed, 137 insertions(+), 113 deletions(-)

diff --git a/setup/onionshare.nsi b/setup/onionshare.nsi
index 36bb2be..8153bdc 100644
--- a/setup/onionshare.nsi
+++ b/setup/onionshare.nsi
@@ -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,9 +31,31 @@ ${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
+    !insertmacro VerifyUserIsAdmin    
 FunctionEnd
 
 Section "install"
@@ -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,114 +200,116 @@ Function un.onInit
     !insertmacro VerifyUserIsAdmin
 FunctionEnd
 
-Section "uninstall"
-    Delete "$SMPROGRAMS\${APPNAME}.lnk"
+!ifdef INNER
+    Section "uninstall"
+        Delete "$SMPROGRAMS\${APPNAME}.lnk"
 
-    # remove files
-    Delete "$INSTDIR\onionshare.exe"
-    Delete "$INSTDIR\LICENSE"
-    Delete "$INSTDIR\onionshare.ico"
-    Delete "$INSTDIR\uninstall.exe"
-    Delete "$INSTDIR\onionshare\__init__.py"
-    Delete "$INSTDIR\onionshare\__init__.pyc"
-    Delete "$INSTDIR\onionshare\404.html"
-    Delete "$INSTDIR\onionshare\helpers.py"
-    Delete "$INSTDIR\onionshare\helpers.pyc"
-    Delete "$INSTDIR\onionshare\index.html"
-    Delete "$INSTDIR\onionshare\onionshare.py"
-    Delete "$INSTDIR\onionshare\onionshare.pyc"
-    Delete "$INSTDIR\onionshare\socks.py"
-    Delete "$INSTDIR\onionshare\socks.pyc"
-    Delete "$INSTDIR\onionshare\strings.py"
-    Delete "$INSTDIR\onionshare\strings.pyc"
-    Delete "$INSTDIR\onionshare\web.py"
-    Delete "$INSTDIR\onionshare\web.pyc"
-    Delete "$INSTDIR\onionshare_gui\__init__.py"
-    Delete "$INSTDIR\onionshare_gui\__init__.pyc"
-    Delete "$INSTDIR\onionshare_gui\common.py"
-    Delete "$INSTDIR\onionshare_gui\common.pyc"
-    Delete "$INSTDIR\onionshare_gui\downloads.py"
-    Delete "$INSTDIR\onionshare_gui\downloads.pyc"
-    Delete "$INSTDIR\onionshare_gui\file_selection.py"
-    Delete "$INSTDIR\onionshare_gui\file_selection.pyc"
-    Delete "$INSTDIR\onionshare_gui\onionshare_gui.py"
-    Delete "$INSTDIR\onionshare_gui\onionshare_gui.pyc"
-    Delete "$INSTDIR\onionshare_gui\options.py"
-    Delete "$INSTDIR\onionshare_gui\options.pyc"
-    Delete "$INSTDIR\onionshare_gui\server_status.py"
-    Delete "$INSTDIR\onionshare_gui\server_status.pyc"
-    Delete "$INSTDIR\images\logo.png"
-    Delete "$INSTDIR\images\drop_files.png"
-    Delete "$INSTDIR\images\server_stopped.png"
-    Delete "$INSTDIR\images\server_started.png"
-    Delete "$INSTDIR\images\server_working.png"
-    Delete "$INSTDIR\locale\de.json"
-    Delete "$INSTDIR\locale\en.json"
-    Delete "$INSTDIR\locale\es.json"
-    Delete "$INSTDIR\locale\fi.json"
-    Delete "$INSTDIR\locale\fr.json"
-    Delete "$INSTDIR\locale\it.json"
-    Delete "$INSTDIR\locale\nl.json"
-    Delete "$INSTDIR\locale\no.json"
-    Delete "$INSTDIR\locale\pt.json"
-    Delete "$INSTDIR\locale\ru.json"
-    Delete "$INSTDIR\locale\tr.json"
-    Delete "$INSTDIR\qt4_plugins\accessible\qtaccessiblewidgets4.dll"
-    Delete "$INSTDIR\qt4_plugins\graphicssystems\qglgraphicssystem4.dll"
-    Delete "$INSTDIR\qt4_plugins\iconengines\qsvgicon4.dll"
-    Delete "$INSTDIR\qt4_plugins\codecs\qjpcodecs4.dll"
-    Delete "$INSTDIR\qt4_plugins\codecs\qkrcodecs4.dll"
-    Delete "$INSTDIR\qt4_plugins\codecs\qtwcodecs4.dll"
-    Delete "$INSTDIR\qt4_plugins\codecs\qcncodecs4.dll"
-    Delete "$INSTDIR\qt4_plugins\imageformats\qmng4.dll"
-    Delete "$INSTDIR\qt4_plugins\imageformats\qico4.dll"
-    Delete "$INSTDIR\qt4_plugins\imageformats\qgif4.dll"
-    Delete "$INSTDIR\qt4_plugins\imageformats\qjpeg4.dll"
-    Delete "$INSTDIR\qt4_plugins\imageformats\qsvg4.dll"
-    Delete "$INSTDIR\qt4_plugins\imageformats\qtga4.dll"
-    Delete "$INSTDIR\qt4_plugins\imageformats\qtiff4.dll"
-    Delete "$INSTDIR\Include\pyconfig.h"
-    Delete "$INSTDIR\_ctypes.pyd"
-    Delete "$INSTDIR\_hashlib.pyd"
-    Delete "$INSTDIR\_socket.pyd"
-    Delete "$INSTDIR\_ssl.pyd"
-    Delete "$INSTDIR\bz2.pyd"
-    Delete "$INSTDIR\Microsoft.VC90.CRT.manifest"
-    Delete "$INSTDIR\msvcm90.dll"
-    Delete "$INSTDIR\msvcp90.dll"
-    Delete "$INSTDIR\msvcr90.dll"
-    Delete "$INSTDIR\onionshare.exe.manifest"
-    Delete "$INSTDIR\pyexpat.pyd"
-    Delete "$INSTDIR\PyQt4.QtCore.pyd"
-    Delete "$INSTDIR\PyQt4.QtGui.pyd"
-    Delete "$INSTDIR\python27.dll"
-    Delete "$INSTDIR\pywintypes27.dll"
-    Delete "$INSTDIR\QtCore4.dll"
-    Delete "$INSTDIR\QtGui4.dll"
-    Delete "$INSTDIR\QtOpenGL4.dll"
-    Delete "$INSTDIR\QtSvg4.dll"
-    Delete "$INSTDIR\QtXml4.dll"
-    Delete "$INSTDIR\select.pyd"
-    Delete "$INSTDIR\sip.pyd"
-    Delete "$INSTDIR\unicodedata.pyd"
-    Delete "$INSTDIR\win32api.pyd"
-    Delete "$INSTDIR\win32pipe.pyd"
-    Delete "$INSTDIR\win32wnet.pyd"
+        # remove files
+        Delete "$INSTDIR\onionshare.exe"
+        Delete "$INSTDIR\LICENSE"
+        Delete "$INSTDIR\onionshare.ico"
+        Delete "$INSTDIR\uninstall.exe"
+        Delete "$INSTDIR\onionshare\__init__.py"
+        Delete "$INSTDIR\onionshare\__init__.pyc"
+        Delete "$INSTDIR\onionshare\404.html"
+        Delete "$INSTDIR\onionshare\helpers.py"
+        Delete "$INSTDIR\onionshare\helpers.pyc"
+        Delete "$INSTDIR\onionshare\index.html"
+        Delete "$INSTDIR\onionshare\onionshare.py"
+        Delete "$INSTDIR\onionshare\onionshare.pyc"
+        Delete "$INSTDIR\onionshare\socks.py"
+        Delete "$INSTDIR\onionshare\socks.pyc"
+        Delete "$INSTDIR\onionshare\strings.py"
+        Delete "$INSTDIR\onionshare\strings.pyc"
+        Delete "$INSTDIR\onionshare\web.py"
+        Delete "$INSTDIR\onionshare\web.pyc"
+        Delete "$INSTDIR\onionshare_gui\__init__.py"
+        Delete "$INSTDIR\onionshare_gui\__init__.pyc"
+        Delete "$INSTDIR\onionshare_gui\common.py"
+        Delete "$INSTDIR\onionshare_gui\common.pyc"
+        Delete "$INSTDIR\onionshare_gui\downloads.py"
+        Delete "$INSTDIR\onionshare_gui\downloads.pyc"
+        Delete "$INSTDIR\onionshare_gui\file_selection.py"
+        Delete "$INSTDIR\onionshare_gui\file_selection.pyc"
+        Delete "$INSTDIR\onionshare_gui\onionshare_gui.py"
+        Delete "$INSTDIR\onionshare_gui\onionshare_gui.pyc"
+        Delete "$INSTDIR\onionshare_gui\options.py"
+        Delete "$INSTDIR\onionshare_gui\options.pyc"
+        Delete "$INSTDIR\onionshare_gui\server_status.py"
+        Delete "$INSTDIR\onionshare_gui\server_status.pyc"
+        Delete "$INSTDIR\images\logo.png"
+        Delete "$INSTDIR\images\drop_files.png"
+        Delete "$INSTDIR\images\server_stopped.png"
+        Delete "$INSTDIR\images\server_started.png"
+        Delete "$INSTDIR\images\server_working.png"
+        Delete "$INSTDIR\locale\de.json"
+        Delete "$INSTDIR\locale\en.json"
+        Delete "$INSTDIR\locale\es.json"
+        Delete "$INSTDIR\locale\fi.json"
+        Delete "$INSTDIR\locale\fr.json"
+        Delete "$INSTDIR\locale\it.json"
+        Delete "$INSTDIR\locale\nl.json"
+        Delete "$INSTDIR\locale\no.json"
+        Delete "$INSTDIR\locale\pt.json"
+        Delete "$INSTDIR\locale\ru.json"
+        Delete "$INSTDIR\locale\tr.json"
+        Delete "$INSTDIR\qt4_plugins\accessible\qtaccessiblewidgets4.dll"
+        Delete "$INSTDIR\qt4_plugins\graphicssystems\qglgraphicssystem4.dll"
+        Delete "$INSTDIR\qt4_plugins\iconengines\qsvgicon4.dll"
+        Delete "$INSTDIR\qt4_plugins\codecs\qjpcodecs4.dll"
+        Delete "$INSTDIR\qt4_plugins\codecs\qkrcodecs4.dll"
+        Delete "$INSTDIR\qt4_plugins\codecs\qtwcodecs4.dll"
+        Delete "$INSTDIR\qt4_plugins\codecs\qcncodecs4.dll"
+        Delete "$INSTDIR\qt4_plugins\imageformats\qmng4.dll"
+        Delete "$INSTDIR\qt4_plugins\imageformats\qico4.dll"
+        Delete "$INSTDIR\qt4_plugins\imageformats\qgif4.dll"
+        Delete "$INSTDIR\qt4_plugins\imageformats\qjpeg4.dll"
+        Delete "$INSTDIR\qt4_plugins\imageformats\qsvg4.dll"
+        Delete "$INSTDIR\qt4_plugins\imageformats\qtga4.dll"
+        Delete "$INSTDIR\qt4_plugins\imageformats\qtiff4.dll"
+        Delete "$INSTDIR\Include\pyconfig.h"
+        Delete "$INSTDIR\_ctypes.pyd"
+        Delete "$INSTDIR\_hashlib.pyd"
+        Delete "$INSTDIR\_socket.pyd"
+        Delete "$INSTDIR\_ssl.pyd"
+        Delete "$INSTDIR\bz2.pyd"
+        Delete "$INSTDIR\Microsoft.VC90.CRT.manifest"
+        Delete "$INSTDIR\msvcm90.dll"
+        Delete "$INSTDIR\msvcp90.dll"
+        Delete "$INSTDIR\msvcr90.dll"
+        Delete "$INSTDIR\onionshare.exe.manifest"
+        Delete "$INSTDIR\pyexpat.pyd"
+        Delete "$INSTDIR\PyQt4.QtCore.pyd"
+        Delete "$INSTDIR\PyQt4.QtGui.pyd"
+        Delete "$INSTDIR\python27.dll"
+        Delete "$INSTDIR\pywintypes27.dll"
+        Delete "$INSTDIR\QtCore4.dll"
+        Delete "$INSTDIR\QtGui4.dll"
+        Delete "$INSTDIR\QtOpenGL4.dll"
+        Delete "$INSTDIR\QtSvg4.dll"
+        Delete "$INSTDIR\QtXml4.dll"
+        Delete "$INSTDIR\select.pyd"
+        Delete "$INSTDIR\sip.pyd"
+        Delete "$INSTDIR\unicodedata.pyd"
+        Delete "$INSTDIR\win32api.pyd"
+        Delete "$INSTDIR\win32pipe.pyd"
+        Delete "$INSTDIR\win32wnet.pyd"
 
-    rmDir "$INSTDIR\onionshare"
-    rmDir "$INSTDIR\onionshare_gui"
-    rmDir "$INSTDIR\images"
-    rmDir "$INSTDIR\locale"
-    rmDir "$INSTDIR\Include"
-    rmDir "$INSTDIR\qt4_plugins\accessible"
-    rmDir "$INSTDIR\qt4_plugins\bearer"
-    rmDir "$INSTDIR\qt4_plugins\codecs"
-    rmDir "$INSTDIR\qt4_plugins\graphicssystems"
-    rmDir "$INSTDIR\qt4_plugins\iconengines"
-    rmDir "$INSTDIR\qt4_plugins\imageformats"
-    rmDir "$INSTDIR\qt4_plugins"
-    rmDir "$INSTDIR"
+        rmDir "$INSTDIR\onionshare"
+        rmDir "$INSTDIR\onionshare_gui"
+        rmDir "$INSTDIR\images"
+        rmDir "$INSTDIR\locale"
+        rmDir "$INSTDIR\Include"
+        rmDir "$INSTDIR\qt4_plugins\accessible"
+        rmDir "$INSTDIR\qt4_plugins\bearer"
+        rmDir "$INSTDIR\qt4_plugins\codecs"
+        rmDir "$INSTDIR\qt4_plugins\graphicssystems"
+        rmDir "$INSTDIR\qt4_plugins\iconengines"
+        rmDir "$INSTDIR\qt4_plugins\imageformats"
+        rmDir "$INSTDIR\qt4_plugins"
+        rmDir "$INSTDIR"
 
-    # remove uninstaller information from the registry
-    DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
-SectionEnd
+        # remove uninstaller information from the registry
+        DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
+    SectionEnd
+!endif

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/onionshare.git



More information about the Pkg-anonymity-tools mailing list