Reputation: 241
I am working on an application in .NET which runs a server by binding itself to a random open port. The user gets a popup letting the them know that it has blocked my application or some of its features.
But when I write the same program in Python, the firewall has no objections to this.
I run my Python and my .NET application as a standard user (with no admin permissions) and I don't understand the firewall popup only occurs .NET and not python.
Thanks for your help.
Upvotes: 1
Views: 174
Reputation: 70701
As Jim implies, the firewall rules have a variety of criteria that can be used to trigger a given rule, but in terms of a running program, it's done based on the .exe that's running. Since the Python interpreter is a single .exe, it sounds as though in your scenario there is already a permission rule allowing Python to listen on the network (i.e. act as a server).
The popup displayed to the user in your case should not just be a notice. It should actually allow a user who knows the admin credentials to click a button and automatically update the firewall rules to allow your program access.
If you want to customize the user experience, you can add code to your program to manage the firewall settings. Of course, your process will still need to run elevated at least once to do this. But that part could be done as part of an installer's process, when the process is already running as admin.
See here for more details about that: http://msdn.microsoft.com/en-us/library/windows/desktop/ff956124(v=vs.85).aspx
Upvotes: 1