Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect FirewallException.IcmpTypesAndCodes property type #1606

Closed
oleg-shilo opened this issue Aug 10, 2024 Discussed in #1603 · 3 comments
Closed

Incorrect FirewallException.IcmpTypesAndCodes property type #1606

oleg-shilo opened this issue Aug 10, 2024 Discussed in #1603 · 3 comments

Comments

@oleg-shilo
Copy link
Owner

Discussed in #1603

Originally posted by dbieber-rfideas August 8, 2024
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:
FirewallException
Outbound (wxs:YesNoTypeUnion) : If "yes", registers an outbound firewall rule. The default is "no".

. . .

Is there a way to define the rule as inbound/outbound, or just both?


The issue is caused by the WIX XML that WixSharp generates containing an inapplicable attribute:

        <CreateFolder />
        <RemoveFolder Id="INSTALLDIR" On="uninstall" />
      </Component>

The IcmpTypesAndCodes="no" attribute causes the installer to fail to install the rule. If I remove that attribute, the rule works. If I add it back (with both "no" and "yes" values), it fails. I think this is because that property only applies to rules that are using the ICMPv4 protocol. Since this rule is TCP, it doesn't make sense (if you look at the windows firewall advanced GUI, you will see that this setting is grayed out unless ICMPv4 protocol is selected).

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)?ICMPv4 protocol is selected

@oleg-shilo oleg-shilo changed the title Definition of outbound FirewallException not supported? Incorrect FirewallException.IcmpTypesAndCodes property type Aug 10, 2024
@oleg-shilo
Copy link
Owner Author

Oh, sorry, it was my misunderstanding.

I interpreted your description "It is caused by the WIX XML that WixSharp generates containing an inapplicable attribute:" a fact that WixSharp calculates and inserts this attribute by itself. I was wrong.

I checked the solution and this WiX4 attribute is directly mapped to the FirewallException.IcmpTypesAndCodes property thus WixSharp has no business of modifying it but rather taking the user-specified value or using the default.

Though, there is a mistake in the default value encoded in WixSharp. Instead of being declared as a string, it is declared as a bool. That's why the default attribute value is no.

Fixed. Will be available in the very next release (or sooner as a pre-release).

oleg-shilo added a commit that referenced this issue Aug 10, 2024
 Issue #1606: Incorrect FirewallException.IcmpTypesAndCodes property type
@oleg-shilo
Copy link
Owner Author

Done. Update your package from and you will have it fixed

@dbieber-rfideas
Copy link

Excellent - thank you @oleg-shilo! I really appreciate the quick action.
Tested and it appears to be working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants