Scoop icon indicating copy to clipboard operation
Scoop copied to clipboard

[Bug] `scoop uninstall scoop` is broken

Open hagaigold opened this issue 1 year ago • 0 comments

Bug Report

Current Behavior

scoop uninstall scoop is broken since commit 285ffd0 Each specific app uninstall is failing.

Expected Behavior

Uninstall of scoop & all apps.

Possible Solution

In uninstall.ps1, unlink_current is failing because of an invalid directory:

function do_uninstall($app, $global) {
    $version = Select-CurrentVersion -AppName $app -Global:$global
    $dir = versiondir $app $version $global
    ...
    ...
    # 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)   <<<<=============

While the fix is relatively easy, I wonder if the uninstall app procedure do_uninstall in uninstall.ps1, should be used at all.
There is a different procedure in scoop-uninstall.ps1, that is use when uninstall is called for a single app- scoop uninstall me.
On top of that, there is uninstall procedure in scoop-update.ps1.

[updated] I see ~~at least 2~~ disparities between uninstall.ps1 and scoop-uninstall.ps1:

  • Invoke-HookScript -HookType 'pre_uninstall' -Manifest $manifest -Arch $architecture
  • rm_startmenu_shortcuts $manifest $global $architecture
  • uninstall_psmodule $manifest $refdir $global
  • Invoke-HookScript -HookType 'post_uninstall' -Manifest $manifest -Arch $architecture

hagaigold avatar Oct 09 '23 17:10 hagaigold