microsoft / microsoft/winget-cli
Uninstall user scope under admin via a custom integrity verification
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
But then I've noticed that winget creates hidden file droppings on some installations and tought - why can't you simply store the hash of the uninstaller user registry data in the same admin protected folder so that on admin uninstall you can verify that the uninstaller registry hadn't been tampered with?
Then you'd be able to not block admin uninstalls
Proposed technical implementation details
- on install of user scoped app in an admin protected location: store a hash of the user registry uninstall entry in the hidden winget database file when a user supported
- alternative (since I afaik the issue is broader than just admin protected folders): when installing with admin privileges store this verification in an admin-protected registry ?
- on uninstall - instead of rejecting outright verify that the uninstall entry matches the admin-protected hash and if it does, proceed with the uninstall. If it doesn't, warn the user of the changes.
(the hashed data might be limited to just the uninstall command field?)
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 by reading the WinGet CLI install and uninstall entry points, then review the linked pull request discussion and how hidden database files or admin-protected registry data are handled. Define the verification design, its security boundaries, and the behavior for matching and changed uninstall entries before implementation; done means the accepted design is implemented and covered by relevant tests.
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
- Needs clarification
- Newbie friendliness
- 35/100