Browse Source

Remove file associations only if qbt is associated. Fixes issue #307.

adaptive-webui-19844
sledgehammer999 12 years ago
parent
commit
749e668a03
  1. 4
      src/windows/installer-translations/english.nsi
  2. 16
      src/windows/uninstaller.nsi

4
src/windows/installer-translations/english.nsi

@ -41,3 +41,7 @@ LangString remove_firewallinfo ${LANG_ENGLISH} "Removing Windows Firewall rule" @@ -41,3 +41,7 @@ LangString remove_firewallinfo ${LANG_ENGLISH} "Removing Windows Firewall rule"
LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"
LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"
;LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:"
LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:"

16
src/windows/uninstaller.nsi

@ -49,9 +49,25 @@ SectionEnd @@ -49,9 +49,25 @@ SectionEnd
Section "un.$(remove_associations)" ;"un.Remove file associations"
SectionIn RO
ReadRegStr $0 HKEY_CLASSES_ROOT ".torrent" ""
StrCmp $0 "qBittorrent" torrent 0
DetailPrint "$(uninst_tor_warn) $0"
Goto qbt
torrent:
DeleteRegKey HKEY_CLASSES_ROOT ".torrent"
qbt:
DeleteRegKey HKEY_CLASSES_ROOT "qBittorrent"
ReadRegStr $0 HKEY_CLASSES_ROOT "Magnet\shell\open\command" ""
StrCmp $0 '"$INSTDIR\qbittorrent.exe" "%1"' magnet 0
DetailPrint "$(uninst_mag_warn) $0"
Goto done
magnet:
DeleteRegKey HKEY_CLASSES_ROOT "Magnet"
done:
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
SectionEnd

Loading…
Cancel
Save