microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.35k stars 1.45k forks source link

Program 'winget.exe' failed to run: The file cannot be accessed by the systemAt line:1 char:1 #4988

Closed tenmeiiii closed 1 day ago

tenmeiiii commented 5 days ago

Brief description of your issue

Cannot run winget - immediately exits with

Program 'winget.exe' failed to run: The file cannot be accessed by the systemAt line:1 char:1
+ & "$env:LOCALAPPDATA\Microsoft\WindowsApps\winget"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
At line:1 char:1
+ & "$env:LOCALAPPDATA\Microsoft\WindowsApps\winget"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed

following readme troubleshooting, updating/installing winget errors with code 0x80073CF9 similar to #3166 ; installing via latest stable release fails with: Image

Steps to reproduce

open powershell, winget

Expected behavior

no error

Actual behavior

as above

Environment

[winget --info doesn't work as winget doesn't work; this is the version for DesktopAppInstaller as the readme]

Name              : Microsoft.DesktopAppInstaller
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : X64
ResourceId        :
Version           : 1.24.25180.0
PackageFullName   : Microsoft.DesktopAppInstaller_1.24.25180.0_x64__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.24.25180.0_x64__8wekyb3d8bbwe
IsFramework       : False
PackageFamilyName : Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
similar-issues-ai[bot] commented 5 days ago

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

stephengillie commented 5 days ago

Hi @tenmeiiii,

The package manager usually logs to %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir - are there any log files in this location?

denelon commented 5 days ago

If WinGet is in a bad state, I'd suggest trying to run the Repair cmdlet in the PowerShell module in a PowerShell prompt:

  1. Install-Module Microsoft.WinGet.Client
  2. Repair-WinGetPackageManager -Latest -Force
tenmeiiii commented 5 days ago

@stephengillie There are log files, but none of them recent (i.e. none from when this issue occured).

@denelon Install-Module seemed to work, but winget still errored with the same code. Command (2) didn't work, with Image Repeating with -AllUsers seemed to begin installing/repairing but failed with Image

GhostDog98 commented 3 days ago

I'm having the exact same issue here, woke up one day and winget suddenly stopped working... Same errors as tenmeiiii with those commands as well, except for the last error being:Image

I also have no logs from the past 11 days. The most recent log (11 days ago) is simply that of it running successfully and updating things.

GhostDog98 commented 3 days ago

Update; for some reason, running it in verbose mode 2 times after rebooting fixed it?

tenmeiiii commented 1 day ago

It seems MS Store is broken in some way as well; unsure if related: Image

tenmeiiii commented 1 day ago

Rebooted to install windows updates; seems to have fixed every issue including ms store and winget. Still very weird