Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Features

- **core:** Add pre_uninstall and post_uninstall hooks ([#4957](https://github.com/ScoopInstaller/Scoop/issues/4957))
- **core:** Add pre_uninstall and post_uninstall hooks ([#4957](https://github.com/ScoopInstaller/Scoop/issues/4957), [#4962](https://github.com/ScoopInstaller/Scoop/issues/4962))

### Bug Fixes

Expand Down
12 changes: 6 additions & 6 deletions libexec/scoop-uninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ if (!$apps) { exit 0 }
$dir = versiondir $app $version $global
$persist_dir = persistdir $app $global

$manifest = installed_manifest $app $version $global
$install = install_info $app $version $global
$architecture = $install.architecture

Invoke-HookScript -HookType 'pre_uninstall' -Manifest $manifest -Arch $architecture
Comment thread
beer-psi marked this conversation as resolved.

#region Workaround for #2952
if (test_running_process $app $global) {
continue
Expand All @@ -67,12 +73,6 @@ if (!$apps) { exit 0 }
continue
}

$manifest = installed_manifest $app $version $global
$install = install_info $app $version $global
$architecture = $install.architecture

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
Expand Down