Wix boostrapper settings to prevent the firewall from blocking the application

余生长醉 提交于 2020-05-17 05:57:10

问题


I can't find anywhere how to set parameters in the wix bootstrapper so that firewalls and anti-viruses do not treat it as a threat. My bootstrapper on other devices displays information that it is a threat. Or it doesn't start without any information.

Edit:

I create something like this:

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

The code is compiling but it looks like Directory has never started. No new rule is added.


回答1:


If you want to add a firewall exception to the program installed on client, then you must add a rule for the program that runs on the client. From the code you shown, what I could understand is that you have added the Bootstrapper exe as exception program. (Correct me if its wrong)

Following is a code snippet which I used recently for one of my project to add inbound exception rule for udp packets (ie an exception in Firewall to allow listening for UDP packets from network). This is actually written in the Msi project (in your case 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>

For the program, it is the file id of the exe that gets installed on client machine.

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


来源:https://stackoverflow.com/questions/61655355/wix-boostrapper-settings-to-prevent-the-firewall-from-blocking-the-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!