NSIS Simple Firewall Plugin

From NSIS Wiki
Jump to navigationJump to search

Links

GitHub repository - source code, documentation and issue tracker

Download the latest version (ANSI and Unicode builds)

Description

SimpleFC is an NSIS plugin to configure the Windows Firewall. It contains functions to enable, check, add or remove programs or ports to the firewall exception list, to manage rules of the Windows Firewall with Advanced Security, to check the firewall status, to enable or disable the firewall and to control the firewall service.

Installation

  • ANSI build: copy SimpleFC.dll to Plugins\x86-ansi (NSIS 3) or Plugins (NSIS 2)
  • Unicode build: copy SimpleFC.dll to Plugins\x86-unicode (NSIS 3 with Unicode true)

Example

; Add an application to the firewall exception list - All Networks - All IP Version - Enabled
  SimpleFC::AddApplication "My Application" "PathToApplication" 0 2 "" 1
  Pop $0 ; return error(1)/success(0)
 
; Remove an application from the firewall exception list
  SimpleFC::RemoveApplication "PathToApplication"
  Pop $0 ; return error(1)/success(0)

The complete function reference with all parameters and examples is available in the README on GitHub.

Questions and bug reports

Please use the issue tracker on GitHub.