Definition of outbound FirewallException not supported? #1603
-
Hello, Thanks for the work on WixSharp. It's a great project. I'm having trouble figuring out how to add an in/out firewall rule. I have successfully added firewall rules, but it only creates an inbound rule. I need to be able to configure both inbound and outbound type rules. Is that possible with WixSharp? It is supported by Wix4 itself, according to their Schema documentation: Here is what I'm doing in WixSharp; I've got a json config that defines the firewall rules, among other things, and it parses that on run: "FirewallRules": [
{
"Name": "Firewall Rule 1",
"Description": "Allow Inbound/Outbound on 12345",
"RemoteAddresses": [
"0.0.0.0"
],
"Port": "12345",
"Protocol": "TCP"
},
{
"Name": "Firewall Rule 2",
"Description": "Allow Inbound/Outbound on 80",
"RemoteAddresses": [
"0.0.0.0"
],
"Port": "80",
"Protocol": "TCP"
}
] foreach (FirewallRules rule in config.FirewallRules)
{
project.Add(new FirewallException(rule.Name)
{
Name = rule.Name,
Description = rule.Description,
RemoteAddress = rule.RemoteAddresses,
Port = rule.Port.ToString(),
Protocol = rule.Protocol == FirewallRuleProtocol.TCP
? FirewallExceptionProtocol.tcp
: FirewallExceptionProtocol.udp
});
} Is there a way to define the rule as inbound/outbound, or just both? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
Beta Was this translation helpful? Give feedback.
-
While the property is there, switching to Wix5 has apparently completely broken the FirewallException class.
Later on, I see:
This is with the simplest possible firewall exception, added directly to the project.Add((new FirewallException("Configuration Utility")
{
Port = "80"
})); When I used Wix4, the rules were created without issue, but the Outbound property was not available. Updating the WixSharp Nuget package brought the property in, but it did not work correctly until I updated the wix tool and its extensions to v5. I'm running out of ideas. I've tried various combinations of properties but nothing seems to work. I'd be happy to provide any other info that you think would help - I may have to redact some words though since this is for a customer. I'm going to switch to a basic Wix UI rather than a Managed one and see if it helps. EDIT:
The Is it possible for WixSharp to conditionally insert this attribute only when the ICMPv4 protocol is selected (or just omit the attribute since WixSharp doesn't seem to support ICMPv4 protocol)? |
Beta Was this translation helpful? Give feedback.
FirewallException.Outbound = true;
You can do it the same way as it is described in the WiX doc with the property
Outbound
.