[Feature] Standardize what Scoop should do with leftovers outside `%scoop%` on `uninstall --purge`
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
--purgealso remove data outside%scoop%; there are manifests that do this now. - Let
--purgeoutput 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-dataor something similar.
Describe the solution you'd like
- Let
--purgealso remove data outside%scoop%; there are manifests that do this now.
Describe alternatives you've considered
See above.
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:
- 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.
- These files or registry entries are generated by the package itself. If the manifest is misconfigured, there is a risk that the entire
$env:APPDATAdirectory could be removed.
This may be related to:
- https://github.com/ScoopInstaller/Scoop/issues/2782
- https://github.com/ScoopInstaller/Scoop/discussions/5389
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.
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.