Well, since you asked this originally on stack overflow, which is a programming website, not an ethics website, I suggested you read more technical information, and see if what you have to do figures into this, as well as what you "should" do.
So here is some C# information. It suggests you look into NetFw Type Library. As does this C++ example. Both are showing the use of COM interfaces built into windows.
Delphi can import a type library which will create a NetFw_TLB.pas file, which you can build into your application, giving you access to these COM objects. You might also try importing the functions from the FirewallAPI.dll.
As the commenter says, you should ask users, but I suspect, that even if you don't, such an action as modifying the firewall rules through this interface is likely to invoke UAC and tell the user that your application wants to modify this setting. It might be necessary for you to write this part as a separate executable that you run with elevated priveleges, in order for this whole ordeal to work. Perhaps you might want to consider doing this part from your installer, and having a checkbox for it, and this will be usually done by someone who is expecting the UAC prompts, and who has Administrator priveleges, so they will be allowed to run the install.
So, in the end, since windows is going to ask you at least once about this, adding a second one, might make TWO dialogs. But on systems without UAC, you might want to consider adding a special notification to the user.