Wix 引导程序设置以防止防火墙阻止应用程序

Wix boostrapper settings to prevent the firewall from blocking the application

我在任何地方都找不到如何在 wix 引导程序中设置参数,以便防火墙和防病毒软件不会将其视为威胁。 我在其他设备上的引导程序显示它是威胁的信息。或者没有任何信息不启动。

编辑:

我创建了这样的东西:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:fw="http://schemas.microsoft.com/wix/FirewallExtension">
<Bundle Name="Bootstrapper13" Version="1.0.0.0" Manufacturer="" UpgradeCode="86064926-b150-448f-aba9-fb0c8f4a83b5">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />       
    <Chain>
        <PackageGroupRef Id='Netfx4Full' />
  <MsiPackage Id="MainPackage" SourceFile="..\SetupProject1.msi" DisplayInternalUI="yes" Compressed="yes" Vital="yes" />
    </Chain>
</Bundle>
<Fragment>
...
<PackageGroup Id="Netfx4Full">
  ...
</PackageGroup>
</Fragment>
<Fragment>
<Directory Id="FirewallDirectory" Name="SourceDir">
  <Component Id="cmpFirewallException" Guid="87617436-AE1C-4C87-BB2D-1CA3531DBC46" KeyPath="yes">
    <fw:FirewallException Id="MyFirewallException"
            Program="..\BootstrapperSetup.exe"
            Description="Lets requests through"
            Name="InstallerWix"
            Scope="any"
            Protocol="tcp" />
  </Component>
</Directory>
</Fragment>
</Wix>

代码正在编译,但目录似乎从未启动。没有添加新规则。

如果要为客户端安装的程序添加防火墙例外,则必须为客户端上运行的程序添加规则。从您显示的代码中,我可以理解的是您已将 Bootstrapper exe 添加为异常程序。 (不对请指正)

以下是我最近在我的一个项目中使用的代码片段,用于为 udp 数据包添加入站例外规则(即防火墙中允许侦听来自网络的 UDP 数据包的例外)。这实际上是在 Msi 项目中编写的(在您的情况下为 SetupProject1)

<Component Id="ChangeFirewall" Guid="YOUR-GUID"  KeyPath="yes">
      <fw:FirewallException Id="FirewallExceptionUDP"
                  Name="AppName for UDP"
                  Scope="any"
                  Protocol="udp"
                  IgnoreFailure="yes"
                  Program="[#App_Name.exe]"
                  Profile="all" />  
</Component>

对于程序,它是安装在客户端计算机上的 exe 的文件 ID。

<Component Id="App_Name.exe" Guid="YOUR-GUID">
    <File Id="App_Name.exe" Name="App_Name.exe" Source="$(var.Project_TargetDir)App_Name.exe">
    </File>
</Component>