From 685f5d6975decfbffb63625de55761692a41760e Mon Sep 17 00:00:00 2001 From: David Watson Date: Tue, 6 Feb 2024 14:11:57 -0500 Subject: [PATCH 1/3] Check for running process before wasting time on download --- libexec/scoop-update.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libexec/scoop-update.ps1 b/libexec/scoop-update.ps1 index 50f82090a5..351a8b7825 100644 --- a/libexec/scoop-update.ps1 +++ b/libexec/scoop-update.ps1 @@ -240,6 +240,12 @@ 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) { + 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 @@ -280,12 +286,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 From 856ffe01967ca63500671ee0ceef1847fed967c5 Mon Sep 17 00:00:00 2001 From: Chawye Hsu Date: Wed, 27 Mar 2024 18:49:15 +0800 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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 From f9afe242ec5f5cfbba04662a5bcb972b96678d06 Mon Sep 17 00:00:00 2001 From: Hsiao-nan Cheung Date: Thu, 28 Mar 2024 02:53:47 +0800 Subject: [PATCH 3/3] Update libexec/scoop-update.ps1 --- libexec/scoop-update.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/scoop-update.ps1 b/libexec/scoop-update.ps1 index 08e98b2dff..60c50ad4b2 100644 --- a/libexec/scoop-update.ps1 +++ b/libexec/scoop-update.ps1 @@ -243,6 +243,7 @@ function update($app, $global, $quiet = $false, $independent, $suggested, $use_c #region Workaround for #2952 if (test_running_process $app $global) { + Write-Host 'Running process detected, skip updating.' return } #endregion Workaround for #2952