Skip to content

Commit

Permalink
Fix firewall rule removal
Browse files Browse the repository at this point in the history
Closes qzind#884
  • Loading branch information
tresf committed Nov 17, 2021
1 parent c827518 commit 306402d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/qz/installer/WindowsInstaller.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public Installer removeSystemSettings() {
}

// Cleanup firewall rules
ShellUtilities.execute("netsh.exe", "advfirewall", "delete", "rule", String.format("name=%s", ABOUT_TITLE));
ShellUtilities.execute("netsh.exe", "advfirewall", "firewall", "delete", "rule", String.format("name=%s", ABOUT_TITLE));
return this;
}

Expand Down Expand Up @@ -146,7 +146,7 @@ public Installer addSystemSettings() {

// Firewall rules
String ports = StringUtils.join(PrintSocketServer.SECURE_PORTS, ",") + "," + StringUtils.join(PrintSocketServer.INSECURE_PORTS, ",");
ShellUtilities.execute("netsh.exe", "advfirewall", "delete", "rule", String.format("name=%s", ABOUT_TITLE));
ShellUtilities.execute("netsh.exe", "advfirewall", "firewall", "delete", "rule", String.format("name=%s", ABOUT_TITLE));
ShellUtilities.execute("netsh.exe", "advfirewall", "firewall", "add", "rule", String.format("name=%s", ABOUT_TITLE),
"dir=in", "action=allow", "profile=any", String.format("localport=%s", ports), "localip=any", "protocol=tcp");
return this;
Expand Down

0 comments on commit 306402d

Please sign in to comment.