1 Section "un.$(remove_files)" ;"un.Remove files"
4 ; Remove files and uninstaller
5 Delete "$INSTDIR\qbittorrent.exe"
6 Delete "$INSTDIR\qbittorrent.pdb"
7 Delete "$INSTDIR\qt.conf"
8 Delete "$INSTDIR\uninst.exe"
10 ; Remove directories used
11 RMDir /r
"$INSTDIR\translations"
15 Section "un.$(remove_shortcuts)" ;"un.Remove shortcuts"
17 ; Remove shortcuts, if any
18 RMDir /r
"$SMPROGRAMS\qBittorrent"
19 Delete "$DESKTOP\qBittorrent.lnk"
22 Section "un.$(remove_associations)" ;"un.Remove file associations"
24 ReadRegStr $0 HKLM "Software\Classes\.torrent" ""
25 StrCmp $0 "qBittorrent" 0 torrent_end
26 DetailPrint "$(uninst_tor_warn) $0"
27 DeleteRegValue HKLM "Software\Classes\.torrent" ""
28 DeleteRegKey /ifempty
HKLM "Software\Classes\.torrent"
31 ReadRegStr $0 HKLM "Software\Classes\magnet\shell\open\command" ""
32 StrCmp $0 '"$INSTDIR\qbittorrent.exe" "%1"' 0 magnet_end
33 DetailPrint "$(uninst_mag_warn) $0"
34 DeleteRegKey HKLM "Software\Classes\magnet"
37 !insertmacro UAC_AsUser_Call
Function un
.remove_associations_user
${UAC_SYNCREGISTERS}|
${UAC_SYNCOUTDIR}|
${UAC_SYNCINSTDIR}
39 System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, p 0, p 0)'
42 Function un
.remove_associations_user
43 ReadRegStr $0 HKCU "Software\Classes\.torrent" ""
44 StrCmp $0 "qBittorrent" 0 torrent_end
45 DetailPrint "$(uninst_tor_warn) $0"
46 DeleteRegValue HKCU "Software\Classes\.torrent" ""
47 DeleteRegKey /ifempty
HKCU "Software\Classes\.torrent"
50 ReadRegStr $0 HKCU "Software\Classes\magnet\shell\open\command" ""
51 StrCmp $0 '"$INSTDIR\qbittorrent.exe" "%1"' 0 magnet_end
52 DetailPrint "$(uninst_mag_warn) $0"
53 DeleteRegKey HKCU "Software\Classes\magnet"
57 Section "un.$(remove_registry)" ;"un.Remove registry keys"
59 ; Remove registry keys
60 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\qBittorrent"
61 DeleteRegKey HKLM "Software\qBittorrent"
62 DeleteRegKey HKLM "Software\Classes\qBittorrent"
64 System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, p 0, p 0)'
67 Section "un.$(remove_firewall)" ;
69 DetailPrint $(remove_firewallinfo
)
70 nsisFirewallW::RemoveAuthorizedApplication
"$INSTDIR\qbittorrent.exe"
74 Section /o
"un.$(remove_conf)" ;"un.Remove configuration files"
76 !insertmacro UAC_AsUser_Call
Function un
.remove_conf_user
${UAC_SYNCREGISTERS}|
${UAC_SYNCOUTDIR}|
${UAC_SYNCINSTDIR}
80 Function un
.remove_conf_user
82 System::Call 'shell32::SHGetSpecialFolderPath(i $HWNDPARENT, t .r1, i ${CSIDL_APPDATA}, i0)i.r0'
83 RMDir /r
"$1\qBittorrent"
87 Section /o
"un.$(remove_cache)"
89 !insertmacro UAC_AsUser_Call
Function un
.remove_cache_user
${UAC_SYNCREGISTERS}|
${UAC_SYNCOUTDIR}|
${UAC_SYNCINSTDIR}
93 Function un
.remove_cache_user
95 System::Call 'shell32::SHGetSpecialFolderPath(i $HWNDPARENT, t .r1, i ${CSIDL_LOCALAPPDATA}, i0)i.r0'
96 RMDir /r
"$1\qBittorrent\"
100 ;--------------------------------
101 ;Uninstaller Functions
105 !insertmacro Init
"uninstaller"
106 !insertmacro MUI_UNGETLANGUAGE
110 Function un
.check_instance
113 FindProcDLL::FindProc
"qbittorrent.exe"
114 StrCmp $R0 "1" 0 notfound
115 MessageBox MB_RETRYCANCEL|
MB_ICONEXCLAMATION $(uninst_warning
) IDRETRY check
IDCANCEL done
124 Function un
.onUninstSuccess