ScoopInstaller / Scoop

A command-line installer for Windows.
https://scoop.sh
Other
20.91k stars 1.39k forks source link

[Bug] Cannot uninstall scoop: `Access is denied` when deleting persistent dirs' junction #5736

Open KoltesDigital opened 9 months ago

KoltesDigital commented 9 months ago

Bug Report

Scoop fails to uninstall if apps with persistent dirs are installed.

Not a duplicate of https://github.com/ScoopInstaller/Scoop/issues/4701: these dirs are not in use, and it's even possible to remove them from the File Explorer.

Current Behavior

> irm get.scoop.sh | iex
# ...OK

> scoop install main/7zip
# ...OK

> scoop uninstall scoop
WARN  This will uninstall Scoop and all the programs that have been installed with Scoop!
Are you sure? (yN): y
Uninstalling '7zip'
Removing shim '7z.shim'.
Removing shim '7z.exe'.
Removing shim '7zFM.shim'.
Removing shim '7zFM.exe'.
Removing shim '7zG.shim'.
Removing shim '7zG.exe'.
WARN  Couldn't remove ~\scoop\apps\7zip: Cannot remove item C:\Users\X\scoop\apps\7zip\23.01\Codecs: Access to the path 'C:\Users\X\scoop\apps\7zip\23.01\Codecs' is denied..Exception
Couldn't remove ~\scoop\apps: Cannot remove item C:\Users\X\scoop\apps\7zip\23.01\Codecs: Access to the path 'C:\Users\X\scoop\apps\7zip\23.01\Codecs' is denied.

Expected Behavior

Should uninstall.

Additional context/output

Note that scoop uninstall 7zip works! Afterwards scoop uninstall scoop then works.

Possible Solution

Uninstalling Scoop should uninstall packages first... but I believe it's already supposed to do so.

Workaround: just that. scoop list | %{ scoop uninstall $_.Name }

System details

Windows version: occurs on 10 and 11

OS architecture: 64bit

PowerShell version: occurs on 5.1 and 7.3

Additional software: Windows Terminal

Scoop Configuration

N/A

HUMORCE commented 8 months ago

5552

KoltesDigital commented 8 months ago

@HUMORCE thanks. But isn't the fix supposed to have been released already?

HUMORCE commented 8 months ago

No, it just merged into develop branch.