Support adding of windows firewall rule.

This commit is contained in:
sledgehammer999 2013-01-27 19:57:20 +02:00
parent 422d0c9210
commit 735247f41f
3 changed files with 16 additions and 0 deletions

View file

@ -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_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_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_registry ${LANG_ENGLISH} "Remove registry keys"
;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files" ;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files"
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"

View file

@ -92,6 +92,12 @@ Section $(inst_magnet) ;"Open magnet links with qBittorrent"
SectionEnd SectionEnd
Section $(inst_firewall)
nsisFirewall::AddAuthorizedApplication "$INSTDIR\qbittorrent.exe" "qBittorrent"
SectionEnd
;-------------------------------- ;--------------------------------
Function .onInit Function .onInit

View file

@ -62,6 +62,12 @@ Section "un.$(remove_registry)" ;"un.Remove registry keys"
DeleteRegKey HKLM "Software\qbittorrent" DeleteRegKey HKLM "Software\qbittorrent"
SectionEnd SectionEnd
Section "un.$(remove_firewall)" ;
nsisFirewall::RemoveAuthorizedApplication "$INSTDIR\qbittorrent.exe"
SectionEnd
Section /o "un.$(remove_conf)" ;"un.Remove configuration files" Section /o "un.$(remove_conf)" ;"un.Remove configuration files"
System::Call 'shell32::SHGetSpecialFolderPath(i $HWNDPARENT, t .r1, i ${CSIDL_APPDATA}, i0)i.r0' System::Call 'shell32::SHGetSpecialFolderPath(i $HWNDPARENT, t .r1, i ${CSIDL_APPDATA}, i0)i.r0'
RMDir /r "$1\qBittorrent" RMDir /r "$1\qBittorrent"