summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2020-12-10 15:10:55 +0100
committerDavid Lönnhager <david.l@mullvad.net>2020-12-10 16:00:20 +0100
commit47c362105cbed330e1f1f4bcb87cd08c0c9b1bec (patch)
tree967f0956edb048def011f9e2b8ca97bc3c8825d6
parent01ea1428e1a393ea96c84dd216694d11c22b0744 (diff)
downloadmullvadvpn-47c362105cbed330e1f1f4bcb87cd08c0c9b1bec.tar.xz
mullvadvpn-47c362105cbed330e1f1f4bcb87cd08c0c9b1bec.zip
Abort installation if the hotfix is rejected
-rw-r--r--dist-assets/windows/installer.nsh37
1 files changed, 29 insertions, 8 deletions
diff --git a/dist-assets/windows/installer.nsh b/dist-assets/windows/installer.nsh
index fb048fdd24..704b0773b4 100644
--- a/dist-assets/windows/installer.nsh
+++ b/dist-assets/windows/installer.nsh
@@ -81,6 +81,7 @@
# 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
@@ -94,10 +95,10 @@
${If} $0 == 0
log::Log "KB2921916 is already installed"
- Goto InstallWin7Hotfix_return
+ Goto InstallWin7Hotfix_return_success
${EndIf}
- MessageBox MB_ICONINFORMATION|MB_YESNO "Windows hotfix KB2921916 must be installed for the app to work on Windows 7. Do you want to install it now?" IDNO InstallWin7Hotfix_return
+ 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"
@@ -110,19 +111,36 @@
Pop $0
Pop $1
- ${If} $0 == 3010
- MessageBox MB_OK "You may need to restart your computer for the patch to take effect."
+ ${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}
- IntFmt $0 "0x%X" $0
- log::Log "wusa.exe result: $0"
+ InstallWin7Hotfix_return_success:
- InstallWin7Hotfix_return:
+ Push 0
+ Pop $R0
+
+ log::Log "InstallWin7Hotfix() completed successfully"
+
+ Goto InstallWin7Hotfix_return
- log::Log "InstallWin7Hotfix() completed"
+ InstallWin7Hotfix_return_abort:
+
+ Push 1
+ Pop $R0
+
+ log::Log "InstallWin7Hotfix() failed"
+
+ InstallWin7Hotfix_return:
Pop $1
Pop $0
+
!macroend
!define InstallWin7Hotfix '!insertmacro "InstallWin7Hotfix"'
@@ -615,6 +633,9 @@
${If} ${AtMostWin7}
${InstallWin7Hotfix}
+ ${If} $R0 != 0
+ Goto customInstall_abort_installation
+ ${EndIf}
${EndIf}
${InstallService}