How to add firewall rules to msix packages

Copper Contributor

Hi!
Sorry if this is not the right place to ask newbie questions but I take the chance.
Anyway, I have created a msix packages but need to add firewall rules. The problem is that I do not really know how ... I have followed the guide from Advanced Installer but it does not work.
There are 3 rules to be created and I attach a picture of what they look like.
The question is whether it is possible to fix this?
If I want to install it manually (not msix) I can run this powershell command but how do I include it in a msix packages?

New-NetFirewallRule -DisplayName "M5 Port" -Direction inbound -Profile Any -Action Allow -LocalPort 123 -Protocol TCP -RemoteAddress LocalSubnet
        New-NetFirewallRule -DisplayName "R-CARD M5 Client" -Description "R-CARD M5 Client" -Direction Inbound -Program "C:\program files (x86)\rco security ab\r-card m5\raclient.exe" -Profile Domain -RemoteAddress LocalSubnet -Action Allow -Protocol TCP
        New-NetFirewallRule -DisplayName "R-CARD M5 Client" -Description "R-CARD M5 Client" -Direction Inbound -Program "C:\program files (x86)\rco security ab\r-card m5\raclient.exe" -Profile Domain -RemoteAddress LocalSubnet -Action Allow -Protocol UDP

 

M5port.pngr-card.png

 

Regards

Patrik Karlsson

Sweden

2 Replies
Have you manually added the extension in the manifest as we explain in the article (https://www.advancedinstaller.com/firewall-rules-msix.html) while creating the package the MSIX Packaging Tool or have you created the package with Advanced Installer.

If you didn't created the package with Advanced Installer, you can download a trial version to create a test package, then extract and compare its manifest with the one you manually created, to see if you missed something ;)

@Bogdan Mitrache 

Thank you for the reply. However, my problem Is how to add:

1. Local port (an external server needs to have a port open with the application).
M5port.png


2. Allow subnet for an executable

r-card.png
(Lokalt undernät = Local Subnet)

I have downloaded and tested Advanced Installer but I just can't find the option for adding "local subnet" or to allow a port for the server to contact the application.

I guess I'm missing something here but I'm pretty new to all of this.

Regards
Patrik