diff --git a/CHANGELOG.md b/CHANGELOG.md index 51322fd91f..94b03b8337 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ - **decompress:** Disable progress bar to improve `Expand-Archive` performance ([#5410](https://github.com/ScoopInstaller/Scoop/issues/5410)) - **scoop-search:** Improve performance for local search ([#5324](https://github.com/ScoopInstaller/Scoop/issues/5324)) +- **scoop-update:** Check for running process before wasting time on download ([#5799](https://github.com/ScoopInstaller/Scoop/issues/5799)) - **shim:** Update kiennq-shim to v3.1.1 ([#5841](https://github.com/ScoopInstaller/Scoop/issues/5841), ([#5847](https://github.com/ScoopInstaller/Scoop/issues/5847))) ### Code Refactoring diff --git a/libexec/scoop-update.ps1 b/libexec/scoop-update.ps1 index 517aeeed1e..60c50ad4b2 100644 --- a/libexec/scoop-update.ps1 +++ b/libexec/scoop-update.ps1 @@ -241,6 +241,13 @@ function update($app, $global, $quiet = $false, $independent, $suggested, $use_c Write-Host "Updating '$app' ($old_version -> $version)" + #region Workaround for #2952 + if (test_running_process $app $global) { + Write-Host 'Running process detected, skip updating.' + return + } + #endregion Workaround for #2952 + # region Workaround # Workaround for https://github.com/ScoopInstaller/Scoop/issues/2220 until install is refactored # Remove and replace whole region after proper fix @@ -281,12 +288,6 @@ function update($app, $global, $quiet = $false, $independent, $suggested, $use_c Invoke-HookScript -HookType 'pre_uninstall' -Manifest $old_manifest -Arch $architecture - #region Workaround for #2952 - if (test_running_process $app $global) { - return - } - #endregion Workaround for #2952 - Write-Host "Uninstalling '$app' ($old_version)" run_uninstaller $old_manifest $architecture $dir rm_shims $app $old_manifest $global $architecture