Closed redactedscribe closed 1 month ago
Please attach the contents of the file on C:\Program Files\WingetUI\Assets\Utilities\scoop_cleanup.cmd
@echo off
echo This script will clean the Scoop cache and run the cleanup command.
echo|set/p="Press <ENTER> to continue or CLOSE this window to abort this process"&runas/u: "">NUL
cls
echo Cleaning Scoop cache...
scoop cleanup --all --global
scoop cache rm --all --global
scoop cleanup --all
scoop cache rm --all
echo Done!
pause
And running this script manually doesn't work either?
Cleaning Scoop cache...
Removing rpcs3: 0.0.31-16354
Removing zig-dev: 0.12.0-dev.3678
Everything is shiny now!
C:\Windows\System32>
Running the CMD file directly in an Administrator command prompt also does the same: Cache dir is not emptied. Only old app versions removed. Strange.
If I run scoop cache rm --all
, the Cache dir is emptied.
The Run button used to work correctly and empty the Cache dir I think. Not any more apparently.
I have no evidence for it, but it might be a conflict with Clink (it has caused me an unrelated mysterious command prompt issue in the past).
I just uninstalled Clink and tried again. Cache dir still doesn't get emptied.
What happens if you run the script on a non-admin command prompt?
Cleaning Scoop cache...
ERROR: you need admin rights to cleanup global apps
As you can see from my third comment from the top, the output of the cache clearing command is immediately followed by the old version removal command's output:
Cleaning Scoop cache...
Removing rpcs3: 0.0.31-16354
<snip>
I always presumed this to be some issue with the CMD script, because when we run scoop cache rm --all
by itself, we see what is actually being cleared and its size:
> scoop cache rm --all
Removing https_github.com_vladimir-kotikov_clink-completions_archive_v0.5.2.zip...
Removing https_github.com_chrisant996_clink_releases_download_v1.6.12_clink.1.6.12.5cd618.zip...
Removing ...
Removing http_us2-dl.techpowerup.com_files_GPU-Z.2.59.0.exe_GPU-Z.exe...
Removing https_github.com_rpcs3_rpcs3-binaries-win_releases_download_build-dff7352e2eca04ebdddff21e44c1130dcc13f0aa_rpcs3-v0.0.31-16364-dff7352e_win64.7z...
Deleted: 5 files, 40.9 MB
It is possible that the CMD script has actually never actually been clearing the cache. It explains why I found it to be 14 GB in size when I did so manually.
In any case, it would be nice if the CMD script worked, but also showed the output of cache clearing command, or at least its last line so that we can know how much was removed.
The problem should because the scoop
command is directed to the file scoop.cmd
, which is also a batch file. Running it will replace and stop scoop_cleanup.cmd
, the current batch file. We can use the command call
in scoop_cleanup.cmd
to solve this problem, like the example below:
(PUSHD "%~DP0")&(REG QUERY "HKU\S-1-5-19">NUL 2>&1)||(powershell -Command "Start-Process '%~sdpnx0' -Verb RunAs"&&EXIT)
@echo on
echo This script will clean the Scoop cache and run the cleanup command.
echo|set/p="Press <ENTER> to continue or CLOSE this window to abort this process"&runas/u: "">NUL
cls
echo Cleaning Scoop cache...
call scoop cleanup --all --global
@echo on
call scoop cache rm --all --global
@echo on
call scoop cleanup --all
@echo on
call scoop cache rm --all
@echo on
echo Done!
pause
Because scoop.cmd
contains @echo off
command, in order to echo all commands, @echo on
is needed to add after each call scoop
commands. If it is not needed, just delete them.
The first line of the program above: (PUSHD "%~DP0")&(REG QUERY "HKU\S-1-5-19">NUL 2>&1)||(powershell -Command "Start-Process '%~sdpnx0' -Verb RunAs"&&EXIT)
, is to automatically get administrator access. If it is not needed, just delete it.
I did not konw this behaviour, thanks for pointing it out!
I have already run the example on my PC, it is safe. If you care about the safety and administrator access, Only replace "scoop
" with "call scoop
" in scoop_cleanup.cmd
is also enough.
@echo off
echo This script will clean the Scoop cache and run the cleanup command.
echo|set/p="Press <ENTER> to continue or CLOSE this window to abort this process"&runas/u: "">NUL
cls
echo Cleaning Scoop cache...
call scoop cleanup --all --global
call scoop cache rm --all --global
call scoop cleanup --all
call scoop cache rm --all
echo Done!
pause
The edit is simple for you. However, the scoop_cleanup.cmd
still not be updated now, I wonder what are you caring about.
Please confirm these before moving forward
Describe your issue
The Run button for "Run cleanup and clear cache" under Scoop in the Settings only removes old versions of installed Scoop apps. It does not clear/clean/remove the cached downloads, which it should.
Steps to reproduce the issue
No response
WingetUI Log
Package Managers Logs
Relevant information
No response
Screenshots and videos
No response