summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2020-08-26 18:00:52 +0200
committerDavid Lönnhager <david.l@mullvad.net>2020-08-28 10:48:55 +0200
commit7b5d5274c242ea8e59ca75cfaa666b8a40163983 (patch)
tree52f6ff2c6827da8e629f5a151f94fd2ba5d4f87f
parent3505cc106c7a88e8a99bbbc24130108f1a2e6269 (diff)
downloadmullvadvpn-7b5d5274c242ea8e59ca75cfaa666b8a40163983.tar.xz
mullvadvpn-7b5d5274c242ea8e59ca75cfaa666b8a40163983.zip
Purge WFP filters during a full uninstall if always-require-vpn is enabled
-rw-r--r--dist-assets/windows/installer.nsh39
1 files changed, 30 insertions, 9 deletions
diff --git a/dist-assets/windows/installer.nsh b/dist-assets/windows/installer.nsh
index d1b9db702b..a1d89af532 100644
--- a/dist-assets/windows/installer.nsh
+++ b/dist-assets/windows/installer.nsh
@@ -561,6 +561,33 @@
!define RemoveCLIFromEnvironPath '!insertmacro "RemoveCLIFromEnvironPath"'
#
+# ClearFirewallRules
+#
+# Removes any WFP filters added by the daemon, using mullvad-setup.
+# This fails if the daemon is running.
+#
+!macro ClearFirewallRules
+
+ Push $0
+ Push $1
+
+ SetOutPath "$TEMP"
+ File "${BUILD_RESOURCES_DIR}\mullvad-setup.exe"
+ File "${BUILD_RESOURCES_DIR}\..\windows\winfw\bin\x64-Release\winfw.dll"
+ nsExec::ExecToStack '"$TEMP\mullvad-setup.exe" reset-firewall'
+ Pop $0
+ Pop $1
+
+ log::Log "Resetting firewall: $0 $1"
+
+ Pop $1
+ Pop $0
+
+!macroend
+
+!define ClearFirewallRules '!insertmacro "ClearFirewallRules"'
+
+#
# customInit
#
# This macro is activated right when the installer first starts up.
@@ -681,15 +708,7 @@
${If} $0 == 0
MessageBox MB_ICONEXCLAMATION|MB_YESNO "Do you wish to unblock your internet access? Doing so will leave you with an unsecure connection." IDNO customInstall_abortInstallation_skip_firewall_revert
-
- SetOutPath "$TEMP"
- File "${BUILD_RESOURCES_DIR}\mullvad-setup.exe"
- File "${BUILD_RESOURCES_DIR}\..\windows\winfw\bin\x64-Release\winfw.dll"
- nsExec::ExecToStack '"$TEMP\mullvad-setup.exe" reset-firewall'
- Pop $0
- Pop $1
-
- log::Log "Resetting firewall: $0 $1"
+ ${ClearFirewallRules}
${EndIf}
customInstall_abortInstallation_skip_firewall_revert:
@@ -776,6 +795,8 @@
# If not ran silently
${If} $FullUninstall == 1
+ ${ClearFirewallRules}
+
# Remove Wintun
${ExtractWintun}
${RemoveWintun}