NSIS Plugin --- liteFirewall
Background
There have been 3 firewall plugin for NSIS: Firewall-Disabler Plugin, NSIS Simple Firewall Plugin and NsisFirewall Plugin. But each of them has some shortcomings, so I just write one: liteFirewall. It’s based on nsisFirewall. Thanks to its author.
Firewall-Disbler plugin: No one will use it.
NsisFirewall plug-in: It doesn’t support firewall profiles (private, domain or public) on Vista/Windows 7.
NSIS Simple Firewall Plugin: It doesn’t support Unicode NSIS.
liteFirewall plug-in: It supports both Unicode NSIS and firewall profiles.
Presentation
liteFirewall is based on nsisFirewall, and it also allows you to perform easily 2 tasks:
Add an application to Windows Firewall exception list
Remove an application from Windows Firewall exception list
The advantage of liteFirewall compared to nsisFirewall is it can automatically figure out the current profile of windows firewall, and add a corresponding rule for your application.
Download
ZIP archive contains the plug-in DLL as well as documentation, source code and sample script.
Usage
liteFirewall::AddRule "<application path>" "<rule name>"
liteFirewall::RemoveRule "<application path>" "<rule name>"
Examples
; Add NOTEPAD to the authorized list
liteFirewall::AddRule "$WINDIRNotepad.exe" "liteFirewall Test"
Pop $0
; Remove NOTEPAD from the authorized list
liteFirewall::RemoveRule "$WINDIRNotepad.exe" "liteFirewall Test"
Pop $0