diff options
| author | David Lönnhager <david.l@mullvad.net> | 2020-12-10 12:01:40 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2020-12-10 16:00:20 +0100 |
| commit | bf9801767d2786e1881dfb41e2a7eb31b39957ec (patch) | |
| tree | fbc88f5cca448030afa97c54bb5b6eddf0aad652 | |
| parent | 72d3e6148a4c9fff33d5cc6bec99b18873cfcb2f (diff) | |
| download | mullvadvpn-bf9801767d2786e1881dfb41e2a7eb31b39957ec.tar.xz mullvadvpn-bf9801767d2786e1881dfb41e2a7eb31b39957ec.zip | |
Install KB2921916 on Windows 7 if it's missing
| -rw-r--r-- | dist-assets/windows/installer.nsh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/dist-assets/windows/installer.nsh b/dist-assets/windows/installer.nsh index 390c734046..149468cdc4 100644 --- a/dist-assets/windows/installer.nsh +++ b/dist-assets/windows/installer.nsh @@ -78,6 +78,49 @@ !define ExtractMullvadSetup '!insertmacro "ExtractMullvadSetup"' # +# InstallWin7Hotfix +# +# Installs KB2921916. Fixes the "untrusted publisher" issue on Windows 7. +# +!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 + ${EndIf} + + 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"' + Pop $0 + Pop $1 + + IntFmt $0 "0x%X" $0 + log::Log "wusa.exe result: $0" + + InstallWin7Hotfix_return: + + log::Log "InstallWin7Hotfix() completed" + + Pop $1 + Pop $0 +!macroend +!define InstallWin7Hotfix '!insertmacro "InstallWin7Hotfix"' + +# # RemoveWintun # # Try to remove Wintun @@ -564,6 +607,10 @@ ${RemoveRelayCache} ${RemoveApiAddressCache} + ${If} ${AtMostWin7} + ${InstallWin7Hotfix} + ${EndIf} + ${InstallService} ${If} $R0 != 0 |
