I am in the process of coding a console application that will create a firewall exception for my main app called Client.exe which uploads a few documents to our servers via
If you want to use COM - objects you will have to call CoInitialize with corresponding CoUninitialize.
In a usual application this will be already done.
As far as your program is a console program you will have to call it on your own.
.....
CoInitialize(nil);
try
try
{ TODO -oUser -cConsole Main : Insert code here }
ExecName := GetCurrentDir + '\' + 'Client.exe';
AddExceptionToFirewall('SIP Inventory',ExecName);
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
finally
CoUninitialize;
end;
.....