This is the case, I want to install an application and add a firewall exception on installation, but when that fails the installation should not rollback, but display a notification to the user/administrator performing the installation.
I use WIX to build the installer.
What I have so far is the following piece to install the 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>
All fine and doesn’t rollback, but how do I get the installer to display a notification at end of installation or a dialog box, informing the user that the firewall exception hasn’t been added.
As silent failure to add the exception to the firewall can be misleading when troubleshooting.
I am thinking of using ?fwException = INSTALLSTATE_ABSENT in a condition somewhere, but don’t know where to use it to get the desired effect.
Any hints/tips much appreciated.
Short of rolling your own custom action that prompts an ignore, retry, cancel dialog when the UILevel property indicates it’s an interactive installation, the way I’ve seen most installers ( SQL Server, TFS ) handle it is to have a prereq check in the UI portion to warn you that a problem may exist.
The problem they typically check for is that the firewall is disabled and that therefore the exception can’t be registered. Therefore if you later enable the firewall the application will not work.
Personally, the way I handle it is the firewall exception in the installer is a nice to have for 90% of people. People may be running other firewall products or the firewall configuration may change later so it’s best to have the application itself to instrument this.