2014-06-25 22:21:56 -04:00
|
|
|
!define APPNAME "OnionShare"
|
|
|
|
!define BINPATH "..\dist\onionshare"
|
|
|
|
!define ABOUTURL "https://github.com/micahflee/onionshare"
|
|
|
|
|
|
|
|
# change these with each release
|
2014-08-18 17:20:28 -04:00
|
|
|
!define INSTALLSIZE 31008
|
2014-06-25 22:21:56 -04:00
|
|
|
!define VERSIONMAJOR 0
|
2014-08-18 15:07:10 -04:00
|
|
|
!define VERSIONMINOR 5
|
|
|
|
!define VERSIONSTRING "0.5dev"
|
2014-06-25 22:21:56 -04:00
|
|
|
|
|
|
|
RequestExecutionLevel admin
|
|
|
|
|
2014-06-27 19:07:20 -04:00
|
|
|
SetCompressor /FINAL /SOLID lzma
|
|
|
|
|
2014-06-25 22:21:56 -04:00
|
|
|
Name "OnionShare"
|
|
|
|
InstallDir "$PROGRAMFILES\${APPNAME}"
|
|
|
|
LicenseData "license.txt"
|
|
|
|
Icon "onionshare.ico"
|
|
|
|
OutFile "..\dist\OnionShare_Setup.exe"
|
|
|
|
|
|
|
|
!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
|
|
|
|
|
|
|
|
Function .onInit
|
2014-08-18 17:20:28 -04:00
|
|
|
setShellVarContext all
|
|
|
|
!insertmacro VerifyUserIsAdmin
|
2014-06-25 22:21:56 -04:00
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Section "install"
|
|
|
|
# application
|
2014-08-18 17:20:28 -04:00
|
|
|
SetOutPath "$INSTDIR"
|
|
|
|
File "onionshare.ico"
|
2014-06-25 22:21:56 -04:00
|
|
|
File "${BINPATH}\onionshare.exe"
|
|
|
|
File "${BINPATH}\LICENSE"
|
2014-06-27 18:18:43 -04:00
|
|
|
SetOutPath "$INSTDIR\onionshare"
|
2014-06-25 22:21:56 -04:00
|
|
|
File "${BINPATH}\onionshare\404.html"
|
2014-06-27 18:18:43 -04:00
|
|
|
File "${BINPATH}\onionshare\__init__.py"
|
2014-06-25 22:21:56 -04:00
|
|
|
File "${BINPATH}\onionshare\__init__.pyc"
|
|
|
|
File "${BINPATH}\onionshare\index.html"
|
2014-06-27 18:18:43 -04:00
|
|
|
File "${BINPATH}\onionshare\onionshare.py"
|
2014-06-25 22:21:56 -04:00
|
|
|
File "${BINPATH}\onionshare\onionshare.pyc"
|
|
|
|
File "${BINPATH}\onionshare\strings.json"
|
|
|
|
SetOutPath "$INSTDIR\onionshare_gui"
|
2014-06-27 18:18:43 -04:00
|
|
|
File "${BINPATH}\onionshare_gui\onionshare_gui.py"
|
2014-06-25 22:21:56 -04:00
|
|
|
File "${BINPATH}\onionshare_gui\onionshare_gui.pyc"
|
2014-06-27 18:18:43 -04:00
|
|
|
File "${BINPATH}\onionshare_gui\__init__.py"
|
2014-06-25 22:21:56 -04:00
|
|
|
File "${BINPATH}\onionshare_gui\__init__.pyc"
|
|
|
|
SetOutPath "$INSTDIR\onionshare_gui\static"
|
|
|
|
File "${BINPATH}\onionshare_gui\static\logo.png"
|
|
|
|
File "${BINPATH}\onionshare_gui\static\loader.gif"
|
2014-06-27 18:18:43 -04:00
|
|
|
|
2014-06-25 22:21:56 -04:00
|
|
|
# dependencies
|
|
|
|
SetOutPath $INSTDIR
|
2014-08-18 17:20:28 -04:00
|
|
|
File "${BINPATH}\_ctypes.pyd"
|
|
|
|
File "${BINPATH}\_hashlib.pyd"
|
|
|
|
File "${BINPATH}\_socket.pyd"
|
|
|
|
File "${BINPATH}\_ssl.pyd"
|
2014-06-25 22:21:56 -04:00
|
|
|
File "${BINPATH}\bz2.pyd"
|
2014-08-18 17:20:28 -04:00
|
|
|
File "${BINPATH}\Microsoft.VC90.CRT.manifest"
|
|
|
|
File "${BINPATH}\msvcm90.dll"
|
|
|
|
File "${BINPATH}\msvcp90.dll"
|
|
|
|
File "${BINPATH}\msvcr90.dll"
|
|
|
|
File "${BINPATH}\onionshare.exe.manifest"
|
|
|
|
File "${BINPATH}\pyexpat.pyd"
|
2014-06-25 22:21:56 -04:00
|
|
|
File "${BINPATH}\PyQt4.QtCore.pyd"
|
|
|
|
File "${BINPATH}\PyQt4.QtGui.pyd"
|
|
|
|
File "${BINPATH}\python27.dll"
|
2014-08-18 17:20:28 -04:00
|
|
|
File "${BINPATH}\pywintypes27.dll"
|
|
|
|
File "${BINPATH}\QtCore4.dll"
|
2014-06-25 22:21:56 -04:00
|
|
|
File "${BINPATH}\QtGui4.dll"
|
2014-08-18 17:20:28 -04:00
|
|
|
File "${BINPATH}\QtOpenGL4.dll"
|
|
|
|
File "${BINPATH}\QtSvg4.dll"
|
2014-06-25 22:21:56 -04:00
|
|
|
File "${BINPATH}\QtXml4.dll"
|
2014-08-18 17:20:28 -04:00
|
|
|
File "${BINPATH}\select.pyd"
|
|
|
|
File "${BINPATH}\sip.pyd"
|
|
|
|
File "${BINPATH}\unicodedata.pyd"
|
|
|
|
File "${BINPATH}\win32api.pyd"
|
|
|
|
File "${BINPATH}\win32pipe.pyd"
|
|
|
|
File "${BINPATH}\win32wnet.pyd"
|
2014-06-25 22:21:56 -04:00
|
|
|
SetOutPath "$INSTDIR\qt4_plugins\accessible"
|
|
|
|
File "${BINPATH}\qt4_plugins\accessible\qtaccessiblewidgets4.dll"
|
|
|
|
SetOutPath "$INSTDIR\qt4_plugins\codecs"
|
2014-08-18 17:20:28 -04:00
|
|
|
File "${BINPATH}\qt4_plugins\codecs\qcncodecs4.dll"
|
2014-06-25 22:21:56 -04:00
|
|
|
File "${BINPATH}\qt4_plugins\codecs\qjpcodecs4.dll"
|
|
|
|
File "${BINPATH}\qt4_plugins\codecs\qkrcodecs4.dll"
|
|
|
|
File "${BINPATH}\qt4_plugins\codecs\qtwcodecs4.dll"
|
2014-08-18 17:20:28 -04:00
|
|
|
SetOutPath "$INSTDIR\qt4_plugins\graphicssystems"
|
|
|
|
File "${BINPATH}\qt4_plugins\graphicssystems\qglgraphicssystem4.dll"
|
|
|
|
SetOutPath "$INSTDIR\qt4_plugins\iconengines"
|
|
|
|
File "${BINPATH}\qt4_plugins\iconengines\qsvgicon4.dll"
|
2014-06-25 22:21:56 -04:00
|
|
|
SetOutPath "$INSTDIR\qt4_plugins\imageformats"
|
|
|
|
File "${BINPATH}\qt4_plugins\imageformats\qgif4.dll"
|
2014-08-18 17:20:28 -04:00
|
|
|
File "${BINPATH}\qt4_plugins\imageformats\qico4.dll"
|
2014-06-25 22:21:56 -04:00
|
|
|
File "${BINPATH}\qt4_plugins\imageformats\qjpeg4.dll"
|
2014-08-18 17:20:28 -04:00
|
|
|
File "${BINPATH}\qt4_plugins\imageformats\qmng4.dll"
|
2014-06-25 22:21:56 -04:00
|
|
|
File "${BINPATH}\qt4_plugins\imageformats\qsvg4.dll"
|
|
|
|
File "${BINPATH}\qt4_plugins\imageformats\qtga4.dll"
|
|
|
|
File "${BINPATH}\qt4_plugins\imageformats\qtiff4.dll"
|
|
|
|
SetOutPath "$INSTDIR\Include"
|
|
|
|
File "${BINPATH}\Include\pyconfig.h"
|
2014-06-27 18:18:43 -04:00
|
|
|
|
2014-08-18 17:20:28 -04:00
|
|
|
# uninstaller
|
|
|
|
WriteUninstaller "$INSTDIR\uninstall.exe"
|
|
|
|
|
|
|
|
# start menu
|
|
|
|
CreateShortCut "$SMPROGRAMS\${APPNAME}.lnk" "$INSTDIR\onionshare.exe" "" "$INSTDIR\onionshare.ico"
|
|
|
|
|
|
|
|
# registry information for add/remove programs
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}"
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
|
|
|
|
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
|
|
|
|
# set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size
|
|
|
|
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-06-25 22:21:56 -04:00
|
|
|
Section "uninstall"
|
2014-08-18 17:20:28 -04:00
|
|
|
Delete "$SMPROGRAMS\${APPNAME}.lnk"
|
2014-06-27 18:18:43 -04:00
|
|
|
|
2014-08-18 17:20:28 -04:00
|
|
|
# remove files
|
2014-06-25 22:21:56 -04:00
|
|
|
Delete "$INSTDIR\onionshare.exe"
|
|
|
|
Delete "$INSTDIR\LICENSE"
|
|
|
|
Delete "$INSTDIR\onionshare.ico"
|
|
|
|
Delete "$INSTDIR\uninstall.exe"
|
|
|
|
Delete "$INSTDIR\onionshare\404.html"
|
2014-06-27 18:18:43 -04:00
|
|
|
Delete "$INSTDIR\onionshare\__init__.py"
|
2014-06-25 22:21:56 -04:00
|
|
|
Delete "$INSTDIR\onionshare\__init__.pyc"
|
|
|
|
Delete "$INSTDIR\onionshare\index.html"
|
2014-06-27 18:18:43 -04:00
|
|
|
Delete "$INSTDIR\onionshare\onionshare.py"
|
2014-06-25 22:21:56 -04:00
|
|
|
Delete "$INSTDIR\onionshare\onionshare.pyc"
|
|
|
|
Delete "$INSTDIR\onionshare\strings.json"
|
2014-06-27 18:18:43 -04:00
|
|
|
Delete "$INSTDIR\onionshare_gui\__init__.py"
|
2014-06-25 22:21:56 -04:00
|
|
|
Delete "$INSTDIR\onionshare_gui\__init__.pyc"
|
|
|
|
Delete "$INSTDIR\onionshare_gui\static"
|
|
|
|
Delete "$INSTDIR\onionshare_gui\static\logo.png"
|
|
|
|
Delete "$INSTDIR\onionshare_gui\static\loader.gif"
|
2014-06-27 18:18:43 -04:00
|
|
|
Delete "$INSTDIR\onionshare_gui\onionshare_gui.py"
|
2014-06-25 22:21:56 -04:00
|
|
|
Delete "$INSTDIR\onionshare_gui\onionshare_gui.pyc"
|
|
|
|
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"
|
2014-08-18 17:20:28 -04:00
|
|
|
Delete "$INSTDIR\Include\pyconfig.h"
|
|
|
|
Delete "$INSTDIR\_ctypes.pyd"
|
|
|
|
Delete "$INSTDIR\_hashlib.pyd"
|
|
|
|
Delete "$INSTDIR\_socket.pyd"
|
|
|
|
Delete "$INSTDIR\_ssl.pyd"
|
2014-06-25 22:21:56 -04:00
|
|
|
Delete "$INSTDIR\bz2.pyd"
|
2014-08-18 17:20:28 -04:00
|
|
|
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"
|
2014-06-25 22:21:56 -04:00
|
|
|
Delete "$INSTDIR\PyQt4.QtCore.pyd"
|
|
|
|
Delete "$INSTDIR\PyQt4.QtGui.pyd"
|
|
|
|
Delete "$INSTDIR\python27.dll"
|
2014-08-18 17:20:28 -04:00
|
|
|
Delete "$INSTDIR\pywintypes27.dll"
|
|
|
|
Delete "$INSTDIR\QtCore4.dll"
|
2014-06-25 22:21:56 -04:00
|
|
|
Delete "$INSTDIR\QtGui4.dll"
|
2014-08-18 17:20:28 -04:00
|
|
|
Delete "$INSTDIR\QtOpenGL4.dll"
|
|
|
|
Delete "$INSTDIR\QtSvg4.dll"
|
2014-06-25 22:21:56 -04:00
|
|
|
Delete "$INSTDIR\QtXml4.dll"
|
2014-08-18 17:20:28 -04:00
|
|
|
Delete "$INSTDIR\select.pyd"
|
|
|
|
Delete "$INSTDIR\sip.pyd"
|
|
|
|
Delete "$INSTDIR\unicodedata.pyd"
|
|
|
|
Delete "$INSTDIR\win32api.pyd"
|
|
|
|
Delete "$INSTDIR\win32pipe.pyd"
|
|
|
|
Delete "$INSTDIR\win32wnet.pyd"
|
2014-06-27 18:18:43 -04:00
|
|
|
|
2014-08-18 17:20:28 -04:00
|
|
|
rmDir "$INSTDIR\onionshare"
|
2014-06-25 22:21:56 -04:00
|
|
|
rmDir "$INSTDIR\onionshare_gui\static"
|
|
|
|
rmDir "$INSTDIR\onionshare_gui"
|
|
|
|
rmDir "$INSTDIR\Include"
|
2014-08-18 17:20:28 -04:00
|
|
|
rmDir "$INSTDIR\qt4_plugins\accessible"
|
2014-06-25 22:21:56 -04:00
|
|
|
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"
|
2014-06-27 18:18:43 -04:00
|
|
|
|
2014-08-18 17:20:28 -04:00
|
|
|
# remove uninstaller information from the registry
|
|
|
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
|
2014-06-27 18:18:43 -04:00
|
|
|
SectionEnd
|