I have this chunk of code which I found and implemented according to http://www.activexperts.com/activmonitor/windowsmanagement/scripts/networking/windowsfirewall/
procedure AddExceptionToFirewall (Caption: String; Executable: String);
var
FirewallMsg: OleVariant;
Application: OleVariant;
CurrentProfile: OleVariant;
begin
FirewallMsg:= CreateOLEObject ('HNetCfg.FwMgr');
CurrentProfile:= FirewallMsg.LocalPolicy.CurrentProfile;
Application:= CreateOLEObject ('HNetCfg.FwAuthorizedApplication');
Application.ProcessImageFileName:= Executable;
Application.Name:= Caption;
Application.Scope:= FW_SCOPE_ALL;
Application.IpVersion:= FW_IP_VERSION_ANY;
Application.Enabled:= True;
CurrentProfile.AuthorizedApplications.Add (Application);
end;
The thing is, on Windows 7, it adds the exception only as Public and not as Private as you can see circled in RED in here
When set to Public only, my program has problems accessing my host via an FTP connection, thus rendering my program useless. This problem is particular only for Windows Vista/7; on XP, the current configuration works fine.
Please if you have any clue or helpful pointers, share them.