From 2fbc9791364ea29159622be58be0ad3f4d4d0376 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sun, 13 Jan 2013 17:51:22 +0200 Subject: [PATCH 1/2] Remove qBittorrent Start Menu folder when uninstalling. Partially fixes #291. --- src/windows/qbittorrent.nsi | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/windows/qbittorrent.nsi b/src/windows/qbittorrent.nsi index c2b7c4724..ce880460d 100644 --- a/src/windows/qbittorrent.nsi +++ b/src/windows/qbittorrent.nsi @@ -279,16 +279,15 @@ Section "un.Remove files" Delete "$INSTDIR\translations\qt_zh_TW.qm" Delete "$INSTDIR\uninst.exe" - ; Remove directories used - RMDir "$SMPROGRAMS\qBittorrent" - RMDir "$INSTDIR\translations" + ; Remove directories used + RMDir /r "$INSTDIR\translations" RMDir "$INSTDIR" SectionEnd Section "un.Remove shortcuts" SectionIn RO ; Remove shortcuts, if any - Delete "$SMPROGRAMS\qBittorrent\*.*" + RMDir /r "$SMPROGRAMS\qBittorrent" Delete "$DESKTOP\qBittorrent.lnk" SectionEnd From 4f1cb5ab7c2119861981663f18e9d58a50fbebc0 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sun, 13 Jan 2013 18:00:00 +0200 Subject: [PATCH 2/2] Store language settings for the installer. Use them in the unistaller too. --- src/windows/qbittorrent.nsi | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/windows/qbittorrent.nsi b/src/windows/qbittorrent.nsi index ce880460d..4a1fa86fe 100644 --- a/src/windows/qbittorrent.nsi +++ b/src/windows/qbittorrent.nsi @@ -35,9 +35,7 @@ InstallDirRegKey HKLM Software\qbittorrent InstallLocation RequestExecutionLevel admin ;-------------------------------- - -; Pages -;Interface Settings +;General Settings !define MUI_ABORTWARNING !define MUI_HEADERIMAGE !define MUI_COMPONENTSPAGE_NODESC @@ -45,18 +43,29 @@ RequestExecutionLevel admin !define MUI_LICENSEPAGE_CHECKBOX !define MUI_LANGDLL_ALLLANGUAGES +;-------------------------------- +;Remember the unistaller/installer language +!define MUI_LANGDLL_REGISTRY_ROOT "HKLM" +!define MUI_LANGDLL_REGISTRY_KEY "Software\qbittorrent" +!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" + +;-------------------------------- +;Installer Pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "license.txt" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES - - +;-------------------------------- +;Uninstaller Pages !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_COMPONENTS !insertmacro MUI_UNPAGE_INSTFILES +;-------------------------------- +;Languages + !insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "Afrikaans" !insertmacro MUI_LANGUAGE "Albanian" @@ -313,3 +322,12 @@ Section /o "un.Remove configuration files" System::Call 'shell32::SHGetSpecialFolderPath(i $HWNDPARENT, t .r1, i ${CSIDL_LOCALAPPDATA}, i0)i.r0' RMDir /r "$1\qBittorrent\" SectionEnd + +;-------------------------------- +;Uninstaller Functions + +Function un.onInit + + !insertmacro MUI_UNGETLANGUAGE + +FunctionEnd