ChrisTitusTech / winutil

Chris Titus Tech's Windows Utility - Install Programs, Tweaks, Fixes, and Updates
MIT License
22.32k stars 1.36k forks source link

Winget not recognized after installation - Path issue #2758

Open dimuththarindu opened 3 weeks ago

dimuththarindu commented 3 weeks ago

Description:

I keep getting this error message saying:

Winget is not installed

I tried to install it multiple times, but it always failed with the following error:

Error: This command cannot be run due to the error: The system cannot find the file specified.

image

Steps Taken:

I found this issue while troubleshooting: GitHub Issue Reference

Followed these steps:

Invoke-WebRequest -Uri "https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -OutFile "$env:TEMP\winget_installer.msixbundle"

Add-AppxPackage -Path "$env:TEMP\winget_installer.msixbundle" -ForceApplicationShutdown

The installation completed successfully without errors but didn’t fix the issue.

I also manually downloaded and installed the Windows Package Manager from the GitHub releases page, but the problem persists.

image

The winget commad is still not recognized in the command prompt.

image

Issue Discovered:

The problem was due to the %UserProfile%\AppData\Local\Microsoft\WindowsApps folder not being added to the system’s PATH environment variable.

Suggestion:

Please add a check during installation to ensure this path is included, as it seems to be a common issue, even on up-to-date systems. This could help prevent similar issues in the future.

MyDrift-user commented 3 weeks ago

Noticed that too, this is the case with something else aswell because the command is not recognized without a shell restart.