[#2325] [Packaging] Fix uninstaller deleting non-deluge files
This commit is contained in:
parent
3eefc81d9d
commit
40c0c8ef6a
|
@ -70,7 +70,7 @@ if not DEBUG:
|
||||||
# Include python modules not picked up automatically by bbfreeze.
|
# Include python modules not picked up automatically by bbfreeze.
|
||||||
includes = ("libtorrent", "cairo", "pangocairo", "atk", "pango", "twisted.internet.utils",
|
includes = ("libtorrent", "cairo", "pangocairo", "atk", "pango", "twisted.internet.utils",
|
||||||
"gio", "gzip", "email.mime.multipart", "email.mime.text", "_cffi_backend")
|
"gio", "gzip", "email.mime.multipart", "email.mime.text", "_cffi_backend")
|
||||||
excludes = ("numpy", "OpenGL", "psyco", "win32ui")
|
excludes = ("numpy", "OpenGL", "psyco", "win32ui", "unittest")
|
||||||
|
|
||||||
|
|
||||||
def recipe_gtk_override(mf):
|
def recipe_gtk_override(mf):
|
||||||
|
@ -111,7 +111,7 @@ for script in script_list:
|
||||||
os.remove(script)
|
os.remove(script)
|
||||||
|
|
||||||
# Exclude files which are already included in GTK or Windows.
|
# Exclude files which are already included in GTK or Windows.
|
||||||
excludeDlls = ("MSIMG32.dll", "MSVCR90.dll", "MSVCP90.dll", "POWRPROF.dll", "DNSAPI.dll", "USP10.dll")
|
excludeDlls = ("MSIMG32.dll", "MSVCR90.dll", "MSVCP90.dll", "MSVCR120.dll", "POWRPROF.dll", "DNSAPI.dll", "USP10.dll")
|
||||||
for dll in excludeDlls:
|
for dll in excludeDlls:
|
||||||
try:
|
try:
|
||||||
os.remove(os.path.join(build_dir, dll))
|
os.remove(os.path.join(build_dir, dll))
|
||||||
|
@ -165,9 +165,35 @@ for script in script_list:
|
||||||
description="Deluge Bittorrent Client",
|
description="Deluge Bittorrent Client",
|
||||||
company="Deluge Team",
|
company="Deluge Team",
|
||||||
product="Deluge",
|
product="Deluge",
|
||||||
copyright="GPLv3")
|
copyright="Deluge Team")
|
||||||
stamp(os.path.join(build_dir, script_exe), versionInfo)
|
stamp(os.path.join(build_dir, script_exe), versionInfo)
|
||||||
|
|
||||||
# Copy version info to file for nsis script.
|
# Copy version info to file for nsis script.
|
||||||
with open('VERSION.tmp', 'w') as ver_file:
|
with open('VERSION.tmp', 'w') as ver_file:
|
||||||
ver_file.write("build_version = \"%s\"" % build_version)
|
ver_file.write("build_version = \"%s\"" % build_version)
|
||||||
|
|
||||||
|
# Create the install and uninstall file list for NSIS.
|
||||||
|
filedir_list = []
|
||||||
|
for root, dirnames, filenames in os.walk(build_dir):
|
||||||
|
dirnames.sort()
|
||||||
|
filenames.sort()
|
||||||
|
filedir_list.append((root[len(build_dir):], filenames))
|
||||||
|
|
||||||
|
with open('install_files.nsh', 'w') as f:
|
||||||
|
f.write('; Files to install\n')
|
||||||
|
for dirname, files in filedir_list:
|
||||||
|
if not dirname:
|
||||||
|
dirname = os.sep
|
||||||
|
f.write('\nSetOutPath "$INSTDIR%s"\n' % dirname)
|
||||||
|
for filename in files:
|
||||||
|
f.write('File "${BBFREEZE_DIR}%s"\n' % os.path.join(dirname, filename))
|
||||||
|
|
||||||
|
with open('uninstall_files.nsh', 'w') as f:
|
||||||
|
f.write('; Files to uninstall\n')
|
||||||
|
for dirname, files in reversed(filedir_list):
|
||||||
|
f.write('\n')
|
||||||
|
if not dirname:
|
||||||
|
dirname = os.sep
|
||||||
|
for filename in files:
|
||||||
|
f.write('Delete "$INSTDIR%s"\n' % os.path.join(dirname, filename))
|
||||||
|
f.write('RMDir "$INSTDIR%s"\n' % dirname)
|
||||||
|
|
|
@ -13,7 +13,7 @@ SetCompressor /FINAL /SOLID lzma
|
||||||
SetCompressorDictSize 64
|
SetCompressorDictSize 64
|
||||||
|
|
||||||
# Script version; displayed when running the installer
|
# Script version; displayed when running the installer
|
||||||
!define DELUGE_INSTALLER_VERSION "0.7"
|
!define DELUGE_INSTALLER_VERSION "0.8"
|
||||||
|
|
||||||
# Deluge program information
|
# Deluge program information
|
||||||
!define PROGRAM_NAME "Deluge"
|
!define PROGRAM_NAME "Deluge"
|
||||||
|
@ -75,6 +75,15 @@ SetCompressorDictSize 64
|
||||||
# Language files
|
# Language files
|
||||||
!insertmacro MUI_LANGUAGE "English"
|
!insertmacro MUI_LANGUAGE "English"
|
||||||
|
|
||||||
|
VIProductVersion "${DELUGE_INSTALLER_VERSION}.0.0"
|
||||||
|
VIAddVersionKey ProductName "${PROGRAM_NAME}"
|
||||||
|
VIAddVersionKey Comments "Deluge Bittorrent Client"
|
||||||
|
VIAddVersionKey CompanyName "Deluge Team"
|
||||||
|
VIAddVersionKey LegalCopyright "Deluge Team"
|
||||||
|
VIAddVersionKey FileDescription "${PROGRAM_NAME} Application Installer"
|
||||||
|
VIAddVersionKey FileVersion "${DELUGE_INSTALLER_VERSION}.0.0"
|
||||||
|
VIAddVersionKey ProductVersion "${PROGRAM_VERSION}.0"
|
||||||
|
VIAddVersionKey OriginalFilename "deluge-${PROGRAM_VERSION}-win32-setup.exe"
|
||||||
|
|
||||||
# --- Functions ---
|
# --- Functions ---
|
||||||
|
|
||||||
|
@ -93,24 +102,17 @@ Function un.onUninstSuccess
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
Function un.onInit
|
Function un.onInit
|
||||||
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Do you want to completely remove $(^Name) and all of its components?" /SD IDYES IDYES +2
|
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Do you want to completely remove $(^Name)?" /SD IDYES IDYES +2
|
||||||
Abort
|
Abort
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
# --- Installation sections ---
|
# --- Installation sections ---
|
||||||
|
|
||||||
# Compare versions
|
|
||||||
!include "WordFunc.nsh"
|
|
||||||
|
|
||||||
!define PROGRAM_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}"
|
!define PROGRAM_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}"
|
||||||
!define PROGRAM_UNINST_ROOT_KEY "HKLM"
|
!define PROGRAM_UNINST_ROOT_KEY "HKLM"
|
||||||
|
|
||||||
# Branding text
|
|
||||||
BrandingText "Deluge Windows Installer v${DELUGE_INSTALLER_VERSION}"
|
BrandingText "Deluge Windows Installer v${DELUGE_INSTALLER_VERSION}"
|
||||||
|
|
||||||
Name "${PROGRAM_NAME} ${PROGRAM_VERSION}"
|
Name "${PROGRAM_NAME} ${PROGRAM_VERSION}"
|
||||||
OutFile "${BUILD_DIR}\deluge-${PROGRAM_VERSION}-win32-setup.exe"
|
OutFile "${BUILD_DIR}\deluge-${PROGRAM_VERSION}-win32-setup.exe"
|
||||||
|
|
||||||
InstallDir "$PROGRAMFILES\Deluge"
|
InstallDir "$PROGRAMFILES\Deluge"
|
||||||
|
|
||||||
ShowInstDetails show
|
ShowInstDetails show
|
||||||
|
@ -119,11 +121,10 @@ ShowUnInstDetails show
|
||||||
# Install main application
|
# Install main application
|
||||||
Section "Deluge Bittorrent Client" Section1
|
Section "Deluge Bittorrent Client" Section1
|
||||||
SectionIn RO
|
SectionIn RO
|
||||||
|
!include "install_files.nsh"
|
||||||
SetOutPath $INSTDIR
|
|
||||||
File /r "${BBFREEZE_DIR}\*.*"
|
|
||||||
|
|
||||||
SetOverwrite ifnewer
|
SetOverwrite ifnewer
|
||||||
|
SetOutPath "$INSTDIR"
|
||||||
File "..\..\LICENSE"
|
File "..\..\LICENSE"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
@ -133,19 +134,19 @@ Section -StartMenu_Desktop_Links
|
||||||
SetShellVarContext all
|
SetShellVarContext all
|
||||||
CreateDirectory "$SMPROGRAMS\Deluge"
|
CreateDirectory "$SMPROGRAMS\Deluge"
|
||||||
CreateShortCut "$SMPROGRAMS\Deluge\Deluge.lnk" "$INSTDIR\deluge.exe"
|
CreateShortCut "$SMPROGRAMS\Deluge\Deluge.lnk" "$INSTDIR\deluge.exe"
|
||||||
CreateShortCut "$SMPROGRAMS\Deluge\Project homepage.lnk" "$INSTDIR\Homepage.url"
|
CreateShortCut "$SMPROGRAMS\Deluge\Website.lnk" "$INSTDIR\homepage.url"
|
||||||
CreateShortCut "$SMPROGRAMS\Deluge\Uninstall Deluge.lnk" "$INSTDIR\Deluge-uninst.exe"
|
CreateShortCut "$SMPROGRAMS\Deluge\Uninstall Deluge.lnk" "$INSTDIR\deluge-uninst.exe"
|
||||||
CreateShortCut "$DESKTOP\Deluge.lnk" "$INSTDIR\deluge.exe"
|
CreateShortCut "$DESKTOP\Deluge.lnk" "$INSTDIR\deluge.exe"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section -Uninstaller
|
Section -Uninstaller
|
||||||
WriteUninstaller "$INSTDIR\Deluge-uninst.exe"
|
WriteUninstaller "$INSTDIR\deluge-uninst.exe"
|
||||||
WriteRegStr ${PROGRAM_UNINST_ROOT_KEY} "${PROGRAM_UNINST_KEY}" "DisplayName" "$(^Name)"
|
WriteRegStr ${PROGRAM_UNINST_ROOT_KEY} "${PROGRAM_UNINST_KEY}" "DisplayName" "$(^Name)"
|
||||||
WriteRegStr ${PROGRAM_UNINST_ROOT_KEY} "${PROGRAM_UNINST_KEY}" "UninstallString" "$INSTDIR\Deluge-uninst.exe"
|
WriteRegStr ${PROGRAM_UNINST_ROOT_KEY} "${PROGRAM_UNINST_KEY}" "UninstallString" "$INSTDIR\deluge-uninst.exe"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
# Create file association for .torrent
|
# Create file association for .torrent
|
||||||
Section "Create .torrent file association for Deluge" Section2
|
Section "Associate .torrent files with Deluge" Section2
|
||||||
# Set up file association for .torrent files
|
# Set up file association for .torrent files
|
||||||
DeleteRegKey HKCR ".torrent"
|
DeleteRegKey HKCR ".torrent"
|
||||||
WriteRegStr HKCR ".torrent" "" "Deluge"
|
WriteRegStr HKCR ".torrent" "" "Deluge"
|
||||||
|
@ -159,20 +160,17 @@ Section "Create .torrent file association for Deluge" Section2
|
||||||
WriteRegStr HKCR "Deluge\shell\open\command" "" '"$INSTDIR\deluge.exe" "%1"'
|
WriteRegStr HKCR "Deluge\shell\open\command" "" '"$INSTDIR\deluge.exe" "%1"'
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
|
||||||
# Create magnet uri association
|
# Create magnet uri association
|
||||||
Section "Create magnet uri link association for Deluge" Section3
|
Section "Associate Magnet URI links with Deluge" Section3
|
||||||
DeleteRegKey HKCR "Magnet"
|
DeleteRegKey HKCR "Magnet"
|
||||||
WriteRegStr HKCR "Magnet" "" "URL:Magnet Protocol"
|
WriteRegStr HKCR "Magnet" "" "URL:Magnet Protocol"
|
||||||
WriteRegStr HKCR "Magnet" "URL Protocol" ""
|
WriteRegStr HKCR "Magnet" "URL Protocol" ""
|
||||||
|
|
||||||
WriteRegStr HKCR "Magnet\shell\open\command" "" '"$INSTDIR\deluge.exe" "%1"'
|
WriteRegStr HKCR "Magnet\shell\open\command" "" '"$INSTDIR\deluge.exe" "%1"'
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
|
||||||
LangString DESC_Section1 ${LANG_ENGLISH} "Install Deluge Bittorrent client."
|
LangString DESC_Section1 ${LANG_ENGLISH} "Install Deluge Bittorrent client."
|
||||||
LangString DESC_Section2 ${LANG_ENGLISH} "Select this option unless you have another torrent client which you want to use for opening .torrent files."
|
LangString DESC_Section2 ${LANG_ENGLISH} "Select this option to let Deluge handle the opening of .torrent files."
|
||||||
LangString DESC_Section3 ${LANG_ENGLISH} "Select this option to have Deluge handle magnet links."
|
LangString DESC_Section3 ${LANG_ENGLISH} "Select this option to let Deluge handle Magnet URI links from the web-browser."
|
||||||
|
|
||||||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} $(DESC_Section1)
|
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} $(DESC_Section1)
|
||||||
|
@ -180,29 +178,27 @@ LangString DESC_Section3 ${LANG_ENGLISH} "Select this option to have Deluge hand
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${Section3} $(DESC_Section3)
|
!insertmacro MUI_DESCRIPTION_TEXT ${Section3} $(DESC_Section3)
|
||||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||||
|
|
||||||
|
# --- Uninstallation section ---
|
||||||
# --- Uninstallation section(s) ---
|
|
||||||
|
|
||||||
Section Uninstall
|
Section Uninstall
|
||||||
RmDir /r "$INSTDIR"
|
Delete "$INSTDIR\LICENSE"
|
||||||
|
Delete "$INSTDIR\homepage.url"
|
||||||
|
Delete "$INSTDIR\deluge-uninst.exe"
|
||||||
|
!include "uninstall_files.nsh"
|
||||||
|
|
||||||
SetShellVarContext all
|
SetShellVarContext all
|
||||||
Delete "$SMPROGRAMS\Deluge\Deluge.lnk"
|
Delete "$SMPROGRAMS\Deluge\Deluge.lnk"
|
||||||
Delete "$SMPROGRAMS\Deluge\Uninstall Deluge.lnk"
|
Delete "$SMPROGRAMS\Deluge\Uninstall Deluge.lnk"
|
||||||
Delete "$SMPROGRAMS\Deluge\Project homepage.lnk"
|
Delete "$SMPROGRAMS\Deluge\Deluge Website.lnk"
|
||||||
Delete "$DESKTOP\Deluge.lnk"
|
|
||||||
|
|
||||||
RmDir "$SMPROGRAMS\Deluge"
|
RmDir "$SMPROGRAMS\Deluge"
|
||||||
|
Delete "$DESKTOP\Deluge.lnk"
|
||||||
|
|
||||||
DeleteRegKey ${PROGRAM_UNINST_ROOT_KEY} "${PROGRAM_UNINST_KEY}"
|
DeleteRegKey ${PROGRAM_UNINST_ROOT_KEY} "${PROGRAM_UNINST_KEY}"
|
||||||
|
|
||||||
# Only delete the .torrent association if Deluge owns it
|
# Only delete the .torrent association if Deluge owns it
|
||||||
ReadRegStr $1 HKCR ".torrent" ""
|
ReadRegStr $1 HKCR ".torrent" ""
|
||||||
StrCmp $1 "Deluge" 0 DELUGE_skip_delete
|
StrCmp $1 "Deluge" 0 DELUGE_skip_delete
|
||||||
|
# Delete the key since it is owned by Deluge; afterwards there is no .torrent association
|
||||||
# Delete the key since it is owned by Deluge; afterwards there is no .torrent association
|
DeleteRegKey HKCR ".torrent"
|
||||||
DeleteRegKey HKCR ".torrent"
|
|
||||||
|
|
||||||
DELUGE_skip_delete:
|
DELUGE_skip_delete:
|
||||||
# This key is only used by Deluge, so we should always delete it
|
# This key is only used by Deluge, so we should always delete it
|
||||||
DeleteRegKey HKCR "Deluge"
|
DeleteRegKey HKCR "Deluge"
|
||||||
|
|
Loading…
Reference in New Issue