3

Does any one know how to add outbound firewall rule or how to specify direction in innosetup script. i am able to add inbound rule with out specifying direction but not outbound rule,

it should be something like,

FirewallObject := CreateOleObject('HNetCfg.FwAuthorizedApplication');
FirewallObject.ProcessImageFileName := FileName;
FirewallObject.Name := AppName;
FirewallObject.Scope := NET_FW_SCOPE_ALL;
FirewallObject.IpVersion := NET_FW_IP_VERSION_ANY;
FirewallObject.Enabled := True;
//I am not sure how to give direction here for outbound
//FirewallObject.Direction = NET_FW_RULE_DIR_OUT;
FirewallManager := CreateOleObject('HNetCfg.FwMgr');
FirewallProfile := FirewallManager.LocalPolicy.CurrentProfile;
FirewallProfile.AuthorizedApplications.Add(FirewallObject);
Mahesh
  • 823
  • 1
  • 11
  • 29

1 Answers1

1

You may want to look at this answer - it describes how to allow outbound traffic through the windows firewall

https://stackoverflow.com/a/9104111

John Crnjanin
  • 78
  • 1
  • 4