2014-06-25 22:21:56 -04:00
|
|
|
!define APPNAME "OnionShare"
|
2016-02-16 01:16:09 -05:00
|
|
|
!define BINPATH "..\dist"
|
2015-12-04 19:56:16 -05:00
|
|
|
!define ABOUTURL "https:\\onionshare.org\"
|
2014-06-25 22:21:56 -04:00
|
|
|
|
|
|
|
# change these with each release
|
2016-02-16 01:16:09 -05:00
|
|
|
!define INSTALLSIZE 60104
|
2014-06-25 22:21:56 -04:00
|
|
|
!define VERSIONMAJOR 0
|
2015-12-04 21:19:36 -05:00
|
|
|
!define VERSIONMINOR 8
|
2015-12-07 19:34:50 -05:00
|
|
|
!define VERSIONSTRING "0.8.1"
|
2014-06-25 22:21:56 -04:00
|
|
|
|
|
|
|
RequestExecutionLevel admin
|
|
|
|
|
|
|
|
Name "OnionShare"
|
|
|
|
InstallDir "$PROGRAMFILES\${APPNAME}"
|
|
|
|
LicenseData "license.txt"
|
|
|
|
Icon "onionshare.ico"
|
|
|
|
|
|
|
|
!include LogicLib.nsh
|
|
|
|
|
|
|
|
Page license
|
|
|
|
Page directory
|
|
|
|
Page instfiles
|
|
|
|
|
|
|
|
!macro VerifyUserIsAdmin
|
|
|
|
UserInfo::GetAccountType
|
|
|
|
pop $0
|
|
|
|
${If} $0 != "admin" ;Require admin rights on NT4+
|
|
|
|
messageBox mb_iconstop "Administrator rights required!"
|
|
|
|
setErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
|
|
|
|
quit
|
|
|
|
${EndIf}
|
|
|
|
!macroend
|
|
|
|
|
2014-09-24 20:09:47 -04:00
|
|
|
# in order to code sign uninstall.exe, we need to do some hacky stuff outlined
|
2015-12-04 19:56:16 -05:00
|
|
|
# here: http:\\nsis.sourceforge.net\Signing_an_Uninstaller
|
2014-09-24 20:09:47 -04:00
|
|
|
!ifdef INNER
|
|
|
|
!echo "Creating uninstall.exe"
|
|
|
|
OutFile "$%TEMP%\tempinstaller.exe"
|
|
|
|
SetCompress off
|
|
|
|
!else
|
|
|
|
!echo "Creating normal installer"
|
2015-12-04 19:56:16 -05:00
|
|
|
!system "makensis.exe /DINNER onionshare.nsi" = 0
|
2014-09-24 20:09:47 -04:00
|
|
|
!system "$%TEMP%\tempinstaller.exe" = 2
|
2015-12-04 19:56:16 -05:00
|
|
|
!system "signtool.exe sign /v /d $\"Uninstall OnionShare$\" /a /tr http://timestamp.globalsign.com/scripts/timstamp.dll /fd sha256 $%TEMP%\uninstall.exe" = 0
|
2015-05-27 14:21:19 -04:00
|
|
|
|
2014-09-24 20:09:47 -04:00
|
|
|
# all done, now we can build the real installer
|
|
|
|
OutFile "..\dist\OnionShare_Setup.exe"
|
|
|
|
SetCompressor /FINAL /SOLID lzma
|
|
|
|
!endif
|
|
|
|
|
2014-06-25 22:21:56 -04:00
|
|
|
Function .onInit
|
2014-09-24 20:09:47 -04:00
|
|
|
!ifdef INNER
|
|
|
|
WriteUninstaller "$%TEMP%\uninstall.exe"
|
|
|
|
Quit # bail out early
|
|
|
|
!endif
|
|
|
|
|
2014-08-18 17:20:28 -04:00
|
|
|
setShellVarContext all
|
2015-05-27 14:21:19 -04:00
|
|
|
!insertmacro VerifyUserIsAdmin
|
2014-06-25 22:21:56 -04:00
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Section "install"
|
|
|
|
# application
|
2014-08-18 17:20:28 -04:00
|
|
|
SetOutPath "$INSTDIR"
|
2014-06-25 22:21:56 -04:00
|
|
|
File "${BINPATH}\onionshare.exe"
|
2016-02-16 01:16:09 -05:00
|
|
|
File "${BINPATH}\license.txt"
|
|
|
|
File "${BINPATH}\version"
|
|
|
|
File "${BINPATH}\onionshare.ico"
|
|
|
|
SetOutPath "$INSTDIR\html"
|
|
|
|
File "${BINPATH}\html\404.html"
|
|
|
|
File "${BINPATH}\html\index.html"
|
2014-09-04 16:20:39 -04:00
|
|
|
SetOutPath "$INSTDIR\images"
|
2014-09-03 20:50:06 -04:00
|
|
|
File "${BINPATH}\images\logo.png"
|
|
|
|
File "${BINPATH}\images\drop_files.png"
|
|
|
|
File "${BINPATH}\images\server_stopped.png"
|
|
|
|
File "${BINPATH}\images\server_started.png"
|
|
|
|
File "${BINPATH}\images\server_working.png"
|
2014-09-22 14:25:20 -04:00
|
|
|
SetOutPath "$INSTDIR\locale"
|
|
|
|
File "${BINPATH}\locale\de.json"
|
|
|
|
File "${BINPATH}\locale\en.json"
|
2015-12-04 21:19:36 -05:00
|
|
|
File "${BINPATH}\locale\eo.json"
|
2014-09-22 14:25:20 -04:00
|
|
|
File "${BINPATH}\locale\es.json"
|
|
|
|
File "${BINPATH}\locale\fi.json"
|
|
|
|
File "${BINPATH}\locale\fr.json"
|
|
|
|
File "${BINPATH}\locale\it.json"
|
|
|
|
File "${BINPATH}\locale\nl.json"
|
|
|
|
File "${BINPATH}\locale\no.json"
|
|
|
|
File "${BINPATH}\locale\pt.json"
|
|
|
|
File "${BINPATH}\locale\ru.json"
|
|
|
|
File "${BINPATH}\locale\tr.json"
|
2014-06-27 18:18:43 -04:00
|
|
|
|
2014-06-25 22:21:56 -04:00
|
|
|
# dependencies
|
2016-02-16 01:16:09 -05:00
|
|
|
SetOutPath "$INSTDIR\platforms"
|
|
|
|
File "${BINPATH}\platforms\qwindows.dll"
|
2014-06-25 22:21:56 -04:00
|
|
|
SetOutPath $INSTDIR
|
2016-02-16 01:16:09 -05:00
|
|
|
File "${BINPATH}\_bz2.pyd"
|
2014-08-18 17:20:28 -04:00
|
|
|
File "${BINPATH}\_ctypes.pyd"
|
2016-02-16 01:16:09 -05:00
|
|
|
File "${BINPATH}\_decimal.pyd"
|
2014-08-18 17:20:28 -04:00
|
|
|
File "${BINPATH}\_hashlib.pyd"
|
2016-02-16 01:16:09 -05:00
|
|
|
File "${BINPATH}\_lzma.pyd"
|
|
|
|
File "${BINPATH}\_multiprocessing.pyd"
|
2014-08-18 17:20:28 -04:00
|
|
|
File "${BINPATH}\_socket.pyd"
|
|
|
|
File "${BINPATH}\_ssl.pyd"
|
2016-02-16 01:16:09 -05:00
|
|
|
File "${BINPATH}\icudt53.dll"
|
|
|
|
File "${BINPATH}\icuin53.dll"
|
|
|
|
File "${BINPATH}\icuuc53.dll"
|
|
|
|
File "${BINPATH}\library.zip"
|
|
|
|
File "${BINPATH}\license.txt"
|
2014-08-18 17:20:28 -04:00
|
|
|
File "${BINPATH}\pyexpat.pyd"
|
2016-02-16 01:16:09 -05:00
|
|
|
File "${BINPATH}\PyQt5.QtCore.pyd"
|
|
|
|
File "${BINPATH}\PyQt5.QtGui.pyd"
|
|
|
|
File "${BINPATH}\PyQt5.QtWidgets.pyd"
|
|
|
|
File "${BINPATH}\python34.dll"
|
|
|
|
File "${BINPATH}\pywintypes34.dll"
|
|
|
|
File "${BINPATH}\Qt5Core.dll"
|
|
|
|
File "${BINPATH}\Qt5Gui.dll"
|
|
|
|
File "${BINPATH}\Qt5Widgets.dll"
|
2014-08-18 17:20:28 -04:00
|
|
|
File "${BINPATH}\select.pyd"
|
|
|
|
File "${BINPATH}\sip.pyd"
|
|
|
|
File "${BINPATH}\unicodedata.pyd"
|
|
|
|
File "${BINPATH}\win32wnet.pyd"
|
2014-06-27 18:18:43 -04:00
|
|
|
|
2014-08-18 17:20:28 -04:00
|
|
|
# uninstaller
|
2014-09-24 20:09:47 -04:00
|
|
|
!ifndef INNER
|
|
|
|
SetOutPath $INSTDIR
|
|
|
|
File $%TEMP%\uninstall.exe
|
|
|
|
!endif
|
2014-08-18 17:20:28 -04:00
|
|
|
|
|
|
|
# start menu
|
|
|
|
CreateShortCut "$SMPROGRAMS\${APPNAME}.lnk" "$INSTDIR\onionshare.exe" "" "$INSTDIR\onionshare.ico"
|
|
|
|
|
2015-12-04 19:56:16 -05:00
|
|
|
# registry information for add\remove programs
|
2014-08-18 17:20:28 -04:00
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}"
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
2015-12-04 19:56:16 -05:00
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" \S"
|
2014-08-18 17:20:28 -04:00
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "InstallLocation" "$\"$INSTDIR$\""
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayIcon" "$\"$INSTDIR\onionshare.ico$\""
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "URLInfoAbout" "$\"${ABOUTURL}$\""
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayVersion" ${VERSIONSTRING}
|
|
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "VersionMajor" ${VERSIONMAJOR}
|
|
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "VersionMinor" ${VERSIONMINOR}
|
|
|
|
# there is no option for modifying or repairing the install
|
|
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoModify" 1
|
|
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoRepair" 1
|
2015-12-04 19:56:16 -05:00
|
|
|
# set the INSTALLSIZE constant (!defined at the top of this script) so Add\Remove Programs can accurately report the size
|
2014-08-18 17:20:28 -04:00
|
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "EstimatedSize" ${INSTALLSIZE}
|
2014-06-25 22:21:56 -04:00
|
|
|
SectionEnd
|
2014-06-27 18:18:43 -04:00
|
|
|
|
2014-06-25 22:21:56 -04:00
|
|
|
# uninstaller
|
|
|
|
Function un.onInit
|
2014-08-18 17:20:28 -04:00
|
|
|
SetShellVarContext all
|
2014-06-27 18:18:43 -04:00
|
|
|
|
2014-08-18 17:20:28 -04:00
|
|
|
#Verify the uninstaller - last chance to back out
|
|
|
|
MessageBox MB_OKCANCEL "Uninstall ${APPNAME}?" IDOK next
|
|
|
|
Abort
|
|
|
|
next:
|
|
|
|
!insertmacro VerifyUserIsAdmin
|
2014-06-25 22:21:56 -04:00
|
|
|
FunctionEnd
|
2014-06-27 18:18:43 -04:00
|
|
|
|
2014-09-24 20:09:47 -04:00
|
|
|
!ifdef INNER
|
|
|
|
Section "uninstall"
|
|
|
|
Delete "$SMPROGRAMS\${APPNAME}.lnk"
|
2014-06-27 18:18:43 -04:00
|
|
|
|
2014-09-24 20:09:47 -04:00
|
|
|
# remove files
|
|
|
|
Delete "$INSTDIR\onionshare.exe"
|
2016-02-16 01:16:09 -05:00
|
|
|
Delete "$INSTDIR\license.txt"
|
|
|
|
Delete "$INSTDIR\version"
|
2014-09-24 20:09:47 -04:00
|
|
|
Delete "$INSTDIR\onionshare.ico"
|
2016-02-16 01:16:09 -05:00
|
|
|
Delete "$INSTDIR\html\404.html"
|
|
|
|
Delete "$INSTDIR\html\index.html"
|
2014-09-24 20:09:47 -04:00
|
|
|
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"
|
2015-12-04 21:19:36 -05:00
|
|
|
Delete "$INSTDIR\locale\eo.json"
|
2014-09-24 20:09:47 -04:00
|
|
|
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"
|
2016-02-16 01:16:09 -05:00
|
|
|
Delete "$INSTDIR\platforms\qwindows.dll"
|
|
|
|
Delete "$INSTDIR\_bz2.pyd"
|
2014-09-24 20:09:47 -04:00
|
|
|
Delete "$INSTDIR\_ctypes.pyd"
|
2016-02-16 01:16:09 -05:00
|
|
|
Delete "$INSTDIR\_decimal.pyd"
|
2014-09-24 20:09:47 -04:00
|
|
|
Delete "$INSTDIR\_hashlib.pyd"
|
2016-02-16 01:16:09 -05:00
|
|
|
Delete "$INSTDIR\_lzma.pyd"
|
|
|
|
Delete "$INSTDIR\_multiprocessing.pyd"
|
2014-09-24 20:09:47 -04:00
|
|
|
Delete "$INSTDIR\_socket.pyd"
|
|
|
|
Delete "$INSTDIR\_ssl.pyd"
|
2016-02-16 01:16:09 -05:00
|
|
|
Delete "$INSTDIR\icudt53.dll"
|
|
|
|
Delete "$INSTDIR\icuin53.dll"
|
|
|
|
Delete "$INSTDIR\icuuc53.dll"
|
|
|
|
Delete "$INSTDIR\library.zip"
|
|
|
|
Delete "$INSTDIR\license.txt"
|
2014-09-24 20:09:47 -04:00
|
|
|
Delete "$INSTDIR\pyexpat.pyd"
|
2016-02-16 01:16:09 -05:00
|
|
|
Delete "$INSTDIR\PyQt5.QtCore.pyd"
|
|
|
|
Delete "$INSTDIR\PyQt5.QtGui.pyd"
|
|
|
|
Delete "$INSTDIR\PyQt5.QtWidgets.pyd"
|
|
|
|
Delete "$INSTDIR\python34.dll"
|
|
|
|
Delete "$INSTDIR\pywintypes34.dll"
|
|
|
|
Delete "$INSTDIR\Qt5Core.dll"
|
|
|
|
Delete "$INSTDIR\Qt5Gui.dll"
|
|
|
|
Delete "$INSTDIR\Qt5Widgets.dll"
|
2014-09-24 20:09:47 -04:00
|
|
|
Delete "$INSTDIR\select.pyd"
|
|
|
|
Delete "$INSTDIR\sip.pyd"
|
|
|
|
Delete "$INSTDIR\unicodedata.pyd"
|
|
|
|
Delete "$INSTDIR\win32wnet.pyd"
|
2014-06-27 18:18:43 -04:00
|
|
|
|
2016-02-16 01:16:09 -05:00
|
|
|
rmDir "$INSTDIR\html"
|
2014-09-24 20:09:47 -04:00
|
|
|
rmDir "$INSTDIR\images"
|
|
|
|
rmDir "$INSTDIR\locale"
|
2016-02-16 01:16:09 -05:00
|
|
|
rmDir "$INSTDIR\platforms"
|
2014-09-24 20:09:47 -04:00
|
|
|
rmDir "$INSTDIR"
|
2014-06-27 18:18:43 -04:00
|
|
|
|
2014-09-24 20:09:47 -04:00
|
|
|
# remove uninstaller information from the registry
|
|
|
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
|
|
|
|
SectionEnd
|
|
|
|
!endif
|