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
#6345 (comment)
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?)
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
#6345 (comment)
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
(the hashed data might be limited to just the uninstall command field?)