oleg-shilo / wixsharp

Framework for building a complete MSI or WiX source code by using script files written with C# syntax.
MIT License
1.12k stars 175 forks source link

Error on adding FirewallException #1612

Closed Zerpico closed 1 month ago

Zerpico commented 3 months ago

Wix Version : 4.0.5 WixSharp.Core : 2.3.2 WixSharp.Msi.Core : 2.3.2

Trying to add firewall exceptions to the program I get an error when building Wix

project.Add(new FirewallException("MyProgramException") //program firewall exception
{
    Program = "[INSTALLDIR]" + "program.exe",
    Scope = FirewallExceptionScope.any,
    Profile = FirewallExceptionProfile.all,
    Protocol = FirewallExceptionProtocol.tcp
});

Got error: error WIX0004: The FirewallException element contains an unexpected attribute 'Enabled'.

In generated wxs file:

<Component Id="MyProgramException" Guid="88112f86-8200-490c-8a81-0cc1acec3d45" KeyPath="yes" Bitness="always64">
  <FirewallException Id="MyProgramException" Name="MyProgramException" Profile="all" Program="[INSTALLDIR]program.exe" Protocol="tcp" Scope="any" Enabled="no" Outbound="no" xmlns="http://wixtoolset.org/schemas/v4/wxs/firewall" />
  <CreateFolder />
  <RemoveFolder Id="INSTALLDIR" On="uninstall" />
</Component>
oleg-shilo commented 3 months ago

Enabled is a valid attribute: https://wixtoolset.org/docs/schema/firewall/firewallexception/

Ensure you are using the latest WiX. Probably you are using the older version.