Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tenmeiiii opened this issue Nov 19, 2024 · 8 comments
Milestone

Comments

@tenmeiiii
Copy link

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
Copy link

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.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Nov 19, 2024
@stephengillie
Copy link

Hi @tenmeiiii,

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

  • Normally, I'd advise using winget --info to verify the logging location, but I see in your comment that this command isn't available.

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Triage Issue need to be triaged label Nov 19, 2024
@denelon
Copy link
Contributor

denelon commented Nov 19, 2024

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
Copy link
Author

@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
Copy link

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
Copy link

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

@tenmeiiii
Copy link
Author

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

@tenmeiiii
Copy link
Author

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

@denelon denelon added this to the 1.10 Client milestone Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants