How to add a firewall exception and show a message if it fails without rollback

In this case, I want to install the application and add a firewall exception during installation, but if this fails, the installation should not roll back, but display a notification for the user / administrator performing the installation.

I use WIX to build the installer. So far, I have used the following snippet to set a firewall exception:

<Component Id="fwException" DiskId="1" Guid="guid"> <fw:FirewallException Name="new firewall exception" Id="FirewallException" Port="1234" Protocol="tcp" Scope="any" IgnoreFailure="yes" > </fw:FirewallException> </Component> 

Everything is fine and not rollback, but how to make the installer display a notification at the end of the installation or a dialog box informing the user that a firewall exception has not been added.

As a silent refusal to add an exception to the firewall, it can be misleading to troubleshoot problems.

I'm thinking about using? fwException = INSTALLSTATE_ABSENT in some state, but I don’t know where to use it to get the desired effect.

Any hints / tips that are very much appreciated.

+4
source share
1 answer

Finishing my own user action, which asks for a dialog of ignoring, redoing, canceling, when the UILevel property indicates its interactive installation, then as I have seen, most installers (SQL Server, TFS) process this to have a preliminary check of the user interface part so that warn you about a problem.

The problem they usually check is that the firewall is disabled and therefore an exception cannot be logged. Therefore, if you later turn on the firewall, the application will not work.

Personally, as I understand it, the exception to the firewall in the installer is not bad for 90% of people. People may run other firewall products or the configuration of the firewall may change later, so it’s best to use the application for this.

+3
source

Source: https://habr.com/ru/post/1442011/


All Articles