microsoft / microsoft/winget-cli
Default (user) installations as admin should warn (or block without a flag) that the package may be impossible to uninstall
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Relevant area(s)
WinGet CLI
Description of the new feature / enhancement
If you install an app under admin (but with the default "user" scope) to be able to install to Program Files, you won't be able to uninstall this app using Winget since it blocks such uninstalls for security reasons
https://github.com/microsoft/winget-cli/pull/6345#issuecomment-4871808323
Winget should try to prevent such situations from appearing in the first place
Proposed technical implementation details
I think that at least there should be a warning when you try to install elevated , something like
- ~"App is being installed for the current user, not machine, but with admin rights. You'll not be able to run the uninstaller via Winget with admin rights, so if you install to an admin-protected location you won't be able to remove it (link to the docs for details)"
And maybe an even more drastic restriction could be - you should pass an extra flag to allow such an operation, so winget should prevent installation under such conditions without a flag
Maybe there could be a smarter way where the warning/block only happens if the target directory is admin-protected, but not sure Winget has the full knowledge of all the folders the installer will modify for this
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the WinGet CLI install and uninstall flows, focusing on elevated installs using the default user scope and targets such as Program Files. Review how admin rights and uninstall restrictions are currently handled. Done would be an agreed warning or flag-gated block for risky installations, with behavior covering the scope and target-directory cases described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli, operating-systems, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100