summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2021-06-28 10:46:57 +0200
committerDavid Lönnhager <david.l@mullvad.net>2021-06-28 15:52:14 +0200
commit5a21b9518f615b87debb4556fb817e13ca602134 (patch)
tree4156417a7ed9c44ac7d52ef320c1b41ab22efbbf
parent1d77bc771af5f39cc76c2cd69082ea9b32638216 (diff)
downloadmullvadvpn-5a21b9518f615b87debb4556fb817e13ca602134.tar.xz
mullvadvpn-5a21b9518f615b87debb4556fb817e13ca602134.zip
Always show a warning about firewall rules being reset
-rw-r--r--dist-assets/windows/installer.nsh34
1 files changed, 32 insertions, 2 deletions
diff --git a/dist-assets/windows/installer.nsh b/dist-assets/windows/installer.nsh
index 8284988703..8e2c85ac8f 100644
--- a/dist-assets/windows/installer.nsh
+++ b/dist-assets/windows/installer.nsh
@@ -568,6 +568,33 @@
!define ClearFirewallRules '!insertmacro "ClearFirewallRules"'
+!macro FirewallWarningCheck
+
+ Push $0
+ Push $1
+ Push $2
+
+ nsExec::ExecToStack '"$SYSDIR\netsh.exe" wfp show security FILTER ${BLOCK_OUTBOUND_IPV4_FILTER_GUID}'
+ Pop $1
+ Pop $0
+
+ nsExec::ExecToStack '"$SYSDIR\netsh.exe" wfp show security FILTER ${PERSISTENT_BLOCK_OUTBOUND_IPV4_FILTER_GUID}'
+ Pop $2
+ Pop $0
+
+ ${If} $1 == 0
+ ${OrIf} $2 == 0
+ MessageBox MB_ICONEXCLAMATION|MB_OK "Installation failed. Your internet access will be unblocked."
+ ${EndIf}
+
+ Pop $2
+ Pop $1
+ Pop $0
+
+!macroend
+
+!define FirewallWarningCheck '!insertmacro "FirewallWarningCheck"'
+
#
# RemoveWireGuardKey
#
@@ -742,6 +769,7 @@
#
Delete "$INSTDIR\mullvad vpn.exe"
+ ${FirewallWarningCheck}
${ExtractMullvadSetup}
${ClearFirewallRules}
@@ -787,6 +815,7 @@
customUnInstallCheck_Abort:
+ ${FirewallWarningCheck}
${ExtractMullvadSetup}
${ClearFirewallRules}
@@ -1000,8 +1029,9 @@
# Break the install due to inconsistent state
Delete "$INSTDIR\mullvad vpn.exe"
- # Clear firewall rules, or risk leaving persistent filters
- ${ClearFirewallRules}
+ ${If} $FullUninstall == 1
+ ${ClearFirewallRules}
+ ${EndIf}
log::Log "Aborting uninstaller"
SetErrorLevel 1