winget-cli
winget-cli copied to clipboard
Access denied while uninstalling preinstalled windows app
Brief description of your issue
While running a winget uninstall command I am getting a access denied. I am pretty sure it worked some weeks ago without issues.
Steps to reproduce
Sign in with a new user without administrator permissions. Restart the PC and then run a uninstallation command to uninstall preinstalled software. It works without any issues for manually installed winget apps, but cant get it to work for any preinstalled windows applications.
winget uninstall Microsoft.MicrosoftOfficeHub_8wekyb3d8bbwe
Found Microsoft 365 (Office) [Microsoft.MicrosoftOfficeHub_8wekyb3d8bbwe]
Starting package uninstallation...
Unexpected error running command:
0x80070005 : Access denied
Winget Log:
2023-02-20 12:06:32.271 [CORE] WinGet, version [1.4.10173], activity [{5ED5F412-0F3B-42A2-917E-0F39EA5A36F8}]
2023-02-20 12:06:32.271 [CORE] OS: Windows.Desktop v10.0.22621.1105
2023-02-20 12:06:32.271 [CORE] Command line Args: "C:\Users\Test.IT-Global\AppData\Local\Microsoft\WindowsApps\winget.exe" uninstall Microsoft.MicrosoftOfficeHub_8wekyb3d8bbwe
2023-02-20 12:06:32.271 [CORE] Package: Microsoft.DesktopAppInstaller v1.19.10173.0
2023-02-20 12:06:32.271 [CORE] IsCOMCall:0; Caller: winget-cli
2023-02-20 12:06:32.277 [CLI ] WinGet invoked with arguments: 'uninstall' 'Microsoft.MicrosoftOfficeHub_8wekyb3d8bbwe'
2023-02-20 12:06:32.277 [CLI ] Found subcommand: uninstall
2023-02-20 12:06:32.277 [CLI ] Leaf command to execute: root:uninstall
2023-02-20 12:06:32.282 [CLI ] Executing command: uninstall
2023-02-20 12:06:32.293 [REPO] GetCurrentSourceRefs: Source named 'microsoft.builtin.desktop.frameworks' from origin Default is hidden and is dropped.
2023-02-20 12:06:32.293 [REPO] Default source requested, multiple sources available, adding all to source references.
2023-02-20 12:06:32.293 [REPO] Adding to source references msstore
2023-02-20 12:06:32.293 [REPO] Adding to source references winget
2023-02-20 12:06:32.293 [REPO] Source past auto update time [5 mins]; it has been at least 22 mins
2023-02-20 12:06:32.294 [REPO] Source past auto update time [5 mins]; it has been at least 22 mins
2023-02-20 12:06:32.561 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
2023-02-20 12:06:32.561 [CORE] Found matching extension.
2023-02-20 12:06:32.566 [REPO] Remote source data was not newer than existing, no update needed
2023-02-20 12:06:32.576 [REPO] Multiple sources available, creating aggregated source.
2023-02-20 12:06:32.576 [REPO] Adding to aggregated source: msstore
2023-02-20 12:06:32.577 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information
2023-02-20 12:06:32.698 [REPO] Response status: 200
2023-02-20 12:06:32.698 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information
2023-02-20 12:06:32.716 [REPO] Response status: 200
2023-02-20 12:06:32.716 [REPO] Adding to aggregated source: winget
2023-02-20 12:06:32.725 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
2023-02-20 12:06:32.725 [CORE] Found matching extension.
2023-02-20 12:06:32.820 [REPO] Opening SQLite Index for ImmutableRead at 'C:\Program Files\WindowsApps\Microsoft.Winget.Source_2023.220.1029.760_neutral__8wekyb3d8bbwe\Public\index.db'
2023-02-20 12:06:32.820 [SQL ] Opening SQLite connection #1: 'C:\Program Files\WindowsApps\Microsoft.Winget.Source_2023.220.1029.760_neutral__8wekyb3d8bbwe\Public\index.db' [1, 40]
2023-02-20 12:06:32.821 [REPO] Opened SQLite Index with version [1.6], last write [2023-02-20 10:28:25.000]
2023-02-20 12:06:32.925 [REPO] Creating PredefinedInstalledSource with filter [None]
2023-02-20 12:06:32.926 [REPO] Creating new SQLite Index [4294967295.4294967295] at ':memory:'
2023-02-20 12:06:32.926 [SQL ] Opening SQLite connection #2: ':memory:' [6, 0]
2023-02-20 12:06:32.977 [REPO] Reading MSI UpgradeCodes
2023-02-20 12:06:32.983 [REPO] Examining ARP entries for Machine | X64
2023-02-20 12:06:33.005 [REPO] Examining ARP entries for Machine | X86
2023-02-20 12:06:33.026 [REPO] Reading MSI UpgradeCodes
2023-02-20 12:06:33.030 [REPO] Examining ARP entries for User | X64
2023-02-20 12:06:33.561 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\Test.IT-Global\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\StoreEdgeFD\installed.db'
2023-02-20 12:06:33.561 [SQL ] Opening SQLite connection #3: 'C:\Users\Test.IT-Global\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\StoreEdgeFD\installed.db' [2, 0]
2023-02-20 12:06:33.563 [REPO] Opened SQLite Index with version [1.6], last write [2023-02-14 17:05:33.000]
2023-02-20 12:06:33.618 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\Test.IT-Global\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db'
2023-02-20 12:06:33.618 [SQL ] Opening SQLite connection #4: 'C:\Users\Test.IT-Global\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db' [2, 0]
2023-02-20 12:06:33.620 [REPO] Opened SQLite Index with version [1.6], last write [2023-02-14 17:01:21.000]
2023-02-20 12:06:33.668 [REPO] Sending http POST request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/manifestSearch
2023-02-20 12:06:33.687 [REPO] Response status: 200
2023-02-20 12:06:33.701 [CLI ] Found one app. App id: Microsoft.MicrosoftOfficeHub_8wekyb3d8bbwe App name: Microsoft 365 (Office)
2023-02-20 12:06:33.714 [FAIL] WindowsPackageManager.dll!00007FFF16AD201E: LogHr(1) tid(29d0) 80070005 Zugriff verweigert
2023-02-20 12:06:33.714 [CLI ] Caught winrt::hresult_error: 0x80070005 : Zugriff verweigert
Expected behavior
The uninstallaton to work
Actual behavior
Winget throws an error and wont uninstall the program
Environment
Windows-Paket-Manager v1.4.10173
Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.
Windows: Windows.Desktop v10.0.22621.1105
Systemarchitektur: X64
Paket: Microsoft.DesktopAppInstaller v1.19.10173.0
Protokolle: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
Benutzereinstellungen: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
I'm having a similar issue. These look related to #2928
If I install the Intune Company Portal with or without winget I then can't uninstall it using unelevated winget.

Related to:
- #2928