summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2020-12-10 16:00:35 +0100
committerDavid Lönnhager <david.l@mullvad.net>2020-12-10 16:00:35 +0100
commita688883883a567b6be0d331fac4006d2b610eb9c (patch)
tree967f0956edb048def011f9e2b8ca97bc3c8825d6
parent36b126a1b8c92445508e901ddcdca6d8ebf940c4 (diff)
parent47c362105cbed330e1f1f4bcb87cd08c0c9b1bec (diff)
downloadmullvadvpn-a688883883a567b6be0d331fac4006d2b610eb9c.tar.xz
mullvadvpn-a688883883a567b6be0d331fac4006d2b610eb9c.zip
Merge branch 'add-win7-hotfix'
m---------dist-assets/binaries0
-rw-r--r--dist-assets/windows/installer.nsh74
2 files changed, 74 insertions, 0 deletions
diff --git a/dist-assets/binaries b/dist-assets/binaries
-Subproject 36c119f6e98576bbbff23f959fa7cc620554d8f
+Subproject fa76f058d6f5fa66e62f9c4a291e6079cea22e3
diff --git a/dist-assets/windows/installer.nsh b/dist-assets/windows/installer.nsh
index 390c734046..704b0773b4 100644
--- a/dist-assets/windows/installer.nsh
+++ b/dist-assets/windows/installer.nsh
@@ -78,6 +78,73 @@
!define ExtractMullvadSetup '!insertmacro "ExtractMullvadSetup"'
#
+# InstallWin7Hotfix
+#
+# Installs KB2921916. Fixes the "untrusted publisher" issue on Windows 7.
+# Returns: 0 in $R0 on success. Otherwise, a non-zero value is returned.
+#
+!macro InstallWin7Hotfix
+ Push $0
+ Push $1
+
+ log::Log "InstallWin7Hotfix()"
+
+ nsExec::ExecToStack '"$SYSDIR\cmd.exe" /c ""$SYSDIR\wbem\wmic.exe" qfe get hotfixid | "$SYSDIR\find.exe" "KB2921916""'
+ Pop $0
+ Pop $1
+
+ ${If} $0 == 0
+ log::Log "KB2921916 is already installed"
+ Goto InstallWin7Hotfix_return_success
+ ${EndIf}
+
+ MessageBox MB_ICONINFORMATION|MB_YESNO "Windows hotfix KB2921916 must be installed for this app to work. Continue?" IDNO InstallWin7Hotfix_return_abort
+
+ log::Log "Extracting KB2921916"
+
+ SetOutPath "$TEMP"
+ File "${BUILD_RESOURCES_DIR}\binaries\x86_64-pc-windows-msvc\Windows6.1-KB2921916-x64.msu"
+
+ log::Log "Installing KB2921916"
+
+ nsExec::ExecToStack '"$SYSDIR\wusa.exe" "$TEMP\Windows6.1-KB2921916-x64.msu" /quiet /norestart'
+ Pop $0
+ Pop $1
+
+ ${If} $0 != 0
+ ${If} $0 == 3010
+ MessageBox MB_OK "You may need to restart your computer for the patch to take effect."
+ ${Else}
+ MessageBox MB_OK "Failed to install the hotfix."
+ Goto InstallWin7Hotfix_return_abort
+ ${EndIf}
+ ${EndIf}
+
+ InstallWin7Hotfix_return_success:
+
+ Push 0
+ Pop $R0
+
+ log::Log "InstallWin7Hotfix() completed successfully"
+
+ Goto InstallWin7Hotfix_return
+
+ InstallWin7Hotfix_return_abort:
+
+ Push 1
+ Pop $R0
+
+ log::Log "InstallWin7Hotfix() failed"
+
+ InstallWin7Hotfix_return:
+
+ Pop $1
+ Pop $0
+
+!macroend
+!define InstallWin7Hotfix '!insertmacro "InstallWin7Hotfix"'
+
+#
# RemoveWintun
#
# Try to remove Wintun
@@ -564,6 +631,13 @@
${RemoveRelayCache}
${RemoveApiAddressCache}
+ ${If} ${AtMostWin7}
+ ${InstallWin7Hotfix}
+ ${If} $R0 != 0
+ Goto customInstall_abort_installation
+ ${EndIf}
+ ${EndIf}
+
${InstallService}
${If} $R0 != 0