From f3dd40e2609c544374cddd1b104aeab3a558fb0f Mon Sep 17 00:00:00 2001 From: Hagai Gold Date: Mon, 9 Oct 2023 21:28:52 +0300 Subject: [PATCH 1/2] fix `scoop uninstall scoop` (#5683) --- bin/uninstall.ps1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/uninstall.ps1 b/bin/uninstall.ps1 index 3baf30ba42..d2d1068121 100644 --- a/bin/uninstall.ps1 +++ b/bin/uninstall.ps1 @@ -41,13 +41,19 @@ function do_uninstall($app, $global) { $architecture = $install.architecture Write-Output "Uninstalling '$app'" + + Invoke-HookScript -HookType 'pre_uninstall' -Manifest $manifest -Arch $architecture + run_uninstaller $manifest $architecture $dir rm_shims $app $manifest $global $architecture + rm_startmenu_shortcuts $manifest $global $architecture # If a junction was used during install, that will have been used # as the reference directory. Othewise it will just be the version # directory. - $refdir = unlink_current (appdir $app $global) + $refdir = unlink_current $dir + + uninstall_psmodule $manifest $refdir $global env_rm_path $manifest $refdir $global $architecture env_rm $manifest $global $architecture @@ -59,6 +65,8 @@ function do_uninstall($app, $global) { $errors = $true warn "Couldn't remove $(friendly_path $appdir): $_.Exception" } + + Invoke-HookScript -HookType 'post_uninstall' -Manifest $manifest -Arch $architecture } function rm_dir($dir) { @@ -99,6 +107,6 @@ if ($purge) { } remove_from_path (shimdir $false) -if ($global) { remove_from_path (shimdir $true) } +if ($global) { remove_from_path (shimdir $true) $true } success 'Scoop has been uninstalled.' From bafc8fef1585ca2718f2039f83ce67ea904a3448 Mon Sep 17 00:00:00 2001 From: Hagai Gold Date: Mon, 9 Oct 2023 23:11:09 +0300 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80932a9ff9..af7c130ed4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ - **scoop-checkup:** Change the message level of helpers from ERROR to WARN ([#5549](https://github.com/ScoopInstaller/Scoop/issues/5614)) - **scoop-(un)hold:** Correct output the messages when manifest not found, (already|not) held ([#5519](https://github.com/ScoopInstaller/Scoop/issues/5519)) - **scoop-update:** Change error message to a better instruction ([#5677](https://github.com/ScoopInstaller/Scoop/issues/5677)) +- **scoop-uninstall:** fix `scoop uninstall scoop` ([#5685](https://github.com/ScoopInstaller/Scoop/issues/5685)) ### Performance Improvements