diff --git a/src/windows/installer-translations/english.nsi b/src/windows/installer-translations/english.nsi index 2a5d2a210..1ff59dbca 100644 --- a/src/windows/installer-translations/english.nsi +++ b/src/windows/installer-translations/english.nsi @@ -10,6 +10,8 @@ LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut" LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent" ;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent" LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent" +;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule" +LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule" ;------------------------------------ @@ -25,3 +27,5 @@ LangString remove_associations ${LANG_ENGLISH} "Remove file associations" LangString remove_registry ${LANG_ENGLISH} "Remove registry keys" ;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files" LangString remove_conf ${LANG_ENGLISH} "Remove configuration files" +;LangString remove_firewall ${LANG_ENGLISH} "Remove Windows Firewall rule" +LangString remove_firewall ${LANG_ENGLISH} "Remove Windows Firewall rule" diff --git a/src/windows/installer.nsi b/src/windows/installer.nsi index 86b175606..7a16c0d36 100644 --- a/src/windows/installer.nsi +++ b/src/windows/installer.nsi @@ -92,6 +92,12 @@ Section $(inst_magnet) ;"Open magnet links with qBittorrent" SectionEnd +Section $(inst_firewall) + + nsisFirewall::AddAuthorizedApplication "$INSTDIR\qbittorrent.exe" "qBittorrent" + +SectionEnd + ;-------------------------------- Function .onInit diff --git a/src/windows/uninstaller.nsi b/src/windows/uninstaller.nsi index 606ec2492..9f6e16a8e 100644 --- a/src/windows/uninstaller.nsi +++ b/src/windows/uninstaller.nsi @@ -62,6 +62,12 @@ Section "un.$(remove_registry)" ;"un.Remove registry keys" DeleteRegKey HKLM "Software\qbittorrent" SectionEnd +Section "un.$(remove_firewall)" ; + + nsisFirewall::RemoveAuthorizedApplication "$INSTDIR\qbittorrent.exe" + +SectionEnd + Section /o "un.$(remove_conf)" ;"un.Remove configuration files" System::Call 'shell32::SHGetSpecialFolderPath(i $HWNDPARENT, t .r1, i ${CSIDL_APPDATA}, i0)i.r0' RMDir /r "$1\qBittorrent"