Martin
Martin

Reputation: 2096

How to handle error message when a package fails with a managed bootstrapper application

I created a setup that consists of a package, a managed bootstrapper application, and a bundle.

I notet that when the package fails, under certain circumstances the Error event is not called. I already looked at InstallationViewModel.cs from the WixBA setup, but did not find a solution.

How can I correctly handle this?

Details:

The package creates a

<firewall:FirewallException ... />

and I noted that when the “Windows Firewall” service is not running, this will fail. (I don’t know whether that’s a bug or a feature, but this question is not about this.)

The log file of the package contains:

ExecFirewallExceptions:  Installing firewall exception2 Foo (C:\Program Files (x86)\Foo\Foo.exe)
ExecFirewallExceptions:  Error 0x800706d9: failed trying to find existing app
ExecFirewallExceptions:  Error 0x800706d9: failed to add/update application exception for name 'Foo', file 'C:\Program Files (x86)\Foo\Foo.exe'
CustomAction WixExecFirewallExceptionsInstall returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)

The main log file contains:

e000: Error 0x80070643: Failed to install MSI package.
e000: Error 0x80070643: Failed to execute MSI package.
e000: Error 0x80070643: Failed to configure per-machine MSI package.

A rollback is executed, and that all works fine, but no error message is displayed to the user.

Which event should I handle to display an error message to the user? Any other way to handle this correctly?

Upvotes: 0

Views: 950

Answers (1)

Keith Deane
Keith Deane

Reputation: 11

You can ignore the error by adding IgnoreFailure="yes" in the <firewall:FirewallException> element.

From the documentation http://wixtoolset.org/documentation/manual/v3/xsd/firewall/firewallexception.html

Note: This will not configure the firewall rules if an error occurs, but if the firewall is disabled then it should not be an issue.

Upvotes: 1

Related Questions