diff options
| author | David Lönnhager <david.l@mullvad.net> | 2021-03-17 16:17:35 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2021-03-18 15:38:53 +0100 |
| commit | c5ca247b486a09f149f88c89837cb276cf6c2181 (patch) | |
| tree | e826dcc4a5f6ef4a19626976f6c0f1c7771d5271 | |
| parent | 1cdd63052aa2d8885e2e63ccb639acdee43a400b (diff) | |
| download | mullvadvpn-c5ca247b486a09f149f88c89837cb276cf6c2181.tar.xz mullvadvpn-c5ca247b486a09f149f88c89837cb276cf6c2181.zip | |
Remove force kill logic from InstallService, since it is too late if the service is still running at that point
| -rw-r--r-- | dist-assets/windows/installer.nsh | 56 |
1 files changed, 3 insertions, 53 deletions
diff --git a/dist-assets/windows/installer.nsh b/dist-assets/windows/installer.nsh index 3252918763..5f14fc23cc 100644 --- a/dist-assets/windows/installer.nsh +++ b/dist-assets/windows/installer.nsh @@ -247,12 +247,6 @@ Push $1 Push $2 - Var /GLOBAL InstallService_Counter - Push 0 - Pop $InstallService_Counter - - InstallService_RegisterService: - log::Log "Running $\"mullvad-daemon$\" for it to self-register as a service" nsExec::ExecToStack '"$INSTDIR\resources\mullvad-daemon.exe" --register-service' @@ -263,50 +257,6 @@ StrCpy $R0 "Failed to install Mullvad service" log::LogWithDetails $R0 $1 - # - # Parse service error - # - string::Find $1 "(os error " 0 - Pop $0 - - ${If} $0 == -1 - log::Log "Failed to parse service error" - Goto InstallService_return - ${EndIf} - - IntOp $0 $0 + 10 - - string::Find $1 ")" $0 - Pop $2 - - IntOp $2 $2 - $0 - - ${If} $2 < 1 - log::Log "Failed to parse service error" - Goto InstallService_return - ${EndIf} - - StrCpy $0 $1 $2 $0 - - StrCpy $R0 "Service error code: $0" - log::Log $R0 - - # - # Forcibly kill old process if stuck - # - ${If} $0 == ${ERROR_SERVICE_MARKED_FOR_DELETE} - log::Log "Attempt to forcibly kill stuck process" - nsExec::ExecToStack '"$SYSDIR\taskkill.exe" /f /fi "SERVICES eq mullvadvpn"' - Pop $0 - Pop $1 - - # Retry service installation - IntOp $InstallService_Counter $InstallService_Counter + 1 - ${If} $InstallService_Counter < 2 - Goto InstallService_RegisterService - ${EndIf} - ${EndIf} - Goto InstallService_return ${EndIf} @@ -833,7 +783,7 @@ ${If} $0 != 0 ${AndIf} $0 != ${ERROR_SERVICE_MARKED_FOR_DELETE} log::Log "Failed to delete the service: $0" - Goto StopAndDeleteService_done + Goto StopAndDeleteService_return_only ${EndIf} Sleep 1000 @@ -869,7 +819,7 @@ StrCpy $R0 "Failed to kill Mullvad service" log::Log $R0 - Goto StopAndDeleteService_done + Goto StopAndDeleteService_return_only ${EndIf} StopAndDeleteService_success: @@ -877,7 +827,7 @@ Push 0 Pop $R0 - StopAndDeleteService_done: + StopAndDeleteService_return_only: ${If} $R0 == 0 log::Log "StopAndDeleteService() completed successfully" |
