Skip to main content

Add Firewall Exception

Use this predefined action to create Windows Firewall rules during installation and remove them during uninstall.

Rules created with this action appear in Windows Defender Firewall with Advanced Security under Inbound Rules or Outbound Rules.

Master Packager Advanced Editor - Predefined Custom Actions - Add Firewall Exception

note

To remove a firewall exception during uninstall, use the same Exception Name that was used when the rule was created.

Fields

FieldDescription
Exception NameDefines the firewall rule name.
PathSpecifies the full path to the executable that needs the firewall rule.
DirectionChooses whether the rule is Inbound or Outbound.
ProfilesSelects where the rule applies: Public for public networks such as cafés or airports, Private for trusted networks, and Domain for organization-managed networks.
ProtocolSelects TCP for connection-based communication or UDP for connectionless communication.
Remove firewall exceptionRemoves the rule during uninstall when you use the same Exception Name.

Steps

  1. Open the MSI or MST in Master Packager.
  2. In the left pane, select Custom Actions.
  3. Open the Predefined Actions tab.
  4. Click Add New Predefined Action and select Add Firewall Exception.
  5. Enter a value in Exception Name.
  6. Set Path to the executable that requires the rule.
  7. Choose the appropriate Direction, Profiles, and Protocol.
  8. If the rule should be removed during uninstall, configure Remove firewall exception with the same Exception Name.
tip

You can define multiple firewall rules in the same package.