Scoop icon indicating copy to clipboard operation
Scoop copied to clipboard

[Feature] Standardize what Scoop should do with leftovers outside `%scoop%` on `uninstall --purge`

Open o-l-a-v opened this issue 1 month ago • 3 comments

Feature Request

Is your feature request related to a problem? Please describe.

A discussion came up in following PR: https://github.com/ScoopInstaller/Extras/pull/16542.

Ideally an app should allow setting a different data directory, so that Scoop can tell it to store it inside %scoop%, but this is wishful thinking.

I prefer and value if a package manager also removes leftovers outside %scoop% on uninstall --purge. But I also see the point about that Scoop shouldn't touch anything outside what it manages.

This should be thought about, discussed, standardized and documented, so that all manifests handles this in the same way. Some suggestions:

  • Let --purge also remove data outside %scoop%; there are manifests that do this now.
  • Let --purge output directories outside %scoop% if they exist to the terminal.
  • Prompt the user to remove directories outside %scoop%.
  • Add one more option to uninstall, like --nuke, --remove-all-data or something similar.

Describe the solution you'd like

  • Let --purge also remove data outside %scoop%; there are manifests that do this now.

Describe alternatives you've considered

See above.

o-l-a-v avatar Nov 08 '25 19:11 o-l-a-v

As discussed in https://github.com/ScoopInstaller/Extras/pull/16542#discussion_r2500699781, I'd advise against adding any operations in package manifest that modify files outside the Scoop root directory. My concerns are mainly as follows:

  1. For global installations, we cannot handle files or registry entries under all user profiles properly. We cannot even determine whether those items were created by the package installed via Scoop.
  2. These files or registry entries are generated by the package itself. If the manifest is misconfigured, there is a risk that the entire $env:APPDATA directory could be removed.

This may be related to:

  • https://github.com/ScoopInstaller/Scoop/issues/2782
  • https://github.com/ScoopInstaller/Scoop/discussions/5389

z-Fng avatar Nov 18 '25 15:11 z-Fng

As I also wrote in that discussion, if Scoop allow manifests with apps that will write outside %scoop%, I think you've already crossed that line. And thus I disagree if not adding any option to remove leftovers is the conclusion.

I agree that it must be done safe and standardized. Probably by avoiding uninstall scripts.

o-l-a-v avatar Nov 18 '25 15:11 o-l-a-v

There have indeed been cases in the past where PRs performed operations outside the Scoop root directory, which could have been caused by various reasons.

For packages that don't fully support portable mode, it's indeed difficult for Scoop to balance usability and portability. On one hand, for better usability, we may need to copy files or create junctions outside the Scoop root directory. On the other hand, for better portability, we shouldn’t modify any files outside the Scoop root directory.

I'd advise against adding any operations in package manifest that modify files outside the Scoop root directory.

For existing PRs, I will allow some of these operations. I hope we can quickly establish standards or consensus, as many PRs are currently blocked because of this.

z-Fng avatar Nov 19 '25 10:11 z-Fng