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_registry)" ;"un.Remove registry keys"
24 ; Remove registry keys
25 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\qBittorrent"
26 DeleteRegKey HKLM "Software\qBittorrent"
28 DeleteRegKey HKLM "Software\Classes\qBittorrent.File.Torrent"
29 DeleteRegKey HKLM "Software\Classes\qBittorrent.Url.Magnet"
30 System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, p 0, p 0)'
33 Section "un.$(remove_firewall)" ;
35 DetailPrint $(remove_firewallinfo)
36 nsisFirewallW::RemoveAuthorizedApplication "$INSTDIR\qbittorrent.exe"
40 Section /o "un.$(remove_conf)" ;"un.Remove configuration files"
42 !insertmacro UAC_AsUser_Call Function un.remove_conf_user ${UAC_SYNCREGISTERS}|${UAC_SYNCOUTDIR}|${UAC_SYNCINSTDIR}
46 Function un.remove_conf_user
48 System::Call 'shell32::SHGetSpecialFolderPath(i $HWNDPARENT, t .r1, i ${CSIDL_APPDATA}, i0)i.r0'
49 RMDir /r "$1\qBittorrent"
53 Section /o "un.$(remove_cache)"
55 !insertmacro UAC_AsUser_Call Function un.remove_cache_user ${UAC_SYNCREGISTERS}|${UAC_SYNCOUTDIR}|${UAC_SYNCINSTDIR}
59 Function un.remove_cache_user
61 System::Call 'shell32::SHGetSpecialFolderPath(i $HWNDPARENT, t .r1, i ${CSIDL_LOCALAPPDATA}, i0)i.r0'
62 RMDir /r "$1\qBittorrent\"
66 ;--------------------------------
67 ;Uninstaller Functions
71 !insertmacro Init "uninstaller"
72 !insertmacro MUI_UNGETLANGUAGE
76 Function un.check_instance
79 FindProcDLL::FindProc "qbittorrent.exe"
80 StrCmp $R0 "1" 0 notfound
81 MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(uninst_warning) /SD IDCANCEL IDRETRY check IDCANCEL canceled
84 SetErrorLevel 15618 # WinError.h: `ERROR_PACKAGES_IN_USE`
91 Function un.onUninstSuccess