5

在这种情况下,我想安装一个应用程序并在安装时添加防火墙例外,但是当安装失败时,安装不应该回滚,而是向执行安装的用户/管理员显示通知。

我使用 WIX 构建安装程序。到目前为止,我有以下安装防火墙异常的部分:

<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>

一切都很好并且不会回滚,但是如何让安装程序在安装结束时显示通知或对话框,通知用户尚未添加防火墙例外。

因为在排除故障时,将异常添加到防火墙的静默失败可能会产生误导。

我正在考虑在某个条件下使用 ?fwException = INSTALLSTATE_ABSENT ,但不知道在哪里使用它来获得预期的效果。

非常感谢任何提示/提示。

4

1 回答 1

3

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.

于 2012-10-25T11:23:00.303 回答