Link to home
Create AccountLog in
Avatar of johnnyex
johnnyex

asked on

windows firewall

what is the best method to disable easy windows firewall to some app?
I mean want to build setup which will exclude app without waiting for windows firewall asking. Is there andy delphi code or inno setup code which do it  or other easy to use solution ?
Avatar of jkr
jkr
Flag of Germany image

I don't have a delphi example, but using 'netsh.exe', you could execute the following during setup:

netsh advfirewall firewall add rule name="allow myapp" dir=in program="c:\program files\myapp\myapp.exe" security=authenticate action=allow

Open in new window


Since you posted this in the C++ Zone as well, here's a (extensive) C++ example to do that: http://msdn.microsoft.com/en-us/library/windows/desktop/dd607244%28v=vs.85%29.aspx ("Adding an Application Rule to Allow Dynamic Edge Traversal")
Avatar of johnnyex
johnnyex

ASKER

thx, do netsh will work on all Os from xp to 8 ?
Also is there an option to specify, port and direction(outgoing/ingoing) all etc....
 ?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer