How does an installer add a firewall inbound rule?

takumi harayama 1 Reputation point
2022-04-05T11:07:59.763+00:00

Hi. I am implementing an installer.
Since some of executable files open sockets so Windows Defender alerts for the files. This alert stops the application. So I am going to implement adding firewall rules by an installer. In order to add the rule, I use HNetCfg object.

Is there an installer that adds rules like this?
Is it OK to add a rule automatically by an installer?
Are there any points to consider, such as the security policy of the PC?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,642 questions
0 comments No comments
{count} votes