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

winget command tool is NOT installed by installing "App Installer" in Microsoft Store #1793

Closed
cheesecracker opened this issue Dec 13, 2021 · 9 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Milestone

Comments

@cheesecracker
Copy link

cheesecracker commented Dec 13, 2021

Brief description of your issue

I install "App Installer" shown in Microsoft Store. But typing "winget" in PowerShell still shows that the term 'winget' is not recognized.

Steps to reproduce

  1. Install Windows 10 from scratch (I use Microsoft's official ISO image: SW_DVD9_Win_Pro_10_21H2_64BIT_Eng_Intl_Pro_Ent_EDU_N_MLF_X22-83626.ISO)
  2. Open Microsoft Store
  3. Search App Installer
  4. Install it
  5. Open PowerShell (in elevated mode) and try to run "winget"

Expected behavior

Expected to get the blah blah blah about winget command tool

Actual behavior

winget : The term 'winget' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ winget
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (winget:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Environment

No "winget --info" can be provided because it's NOT installed

winver ==> "Version 21H2 (OS Build 19044.1288)

Comment

When App Installer is installed by Microsoft Store for the first time, winget does not work. We have to wait for an undetermined amount time and suddenly Microsoft Store would say it has found some update for App Installer. Then we have to wait for about 15 minutes to let Microsoft Store to download and install (again?) App Installer. After this, winget works.

Something is very obscure in the relationship between App Installer and Microsoft Store.

@ghost ghost added the Needs-Triage Issue need to be triaged label Dec 13, 2021
@o-l-a-v
Copy link

o-l-a-v commented Dec 13, 2021

What version of "App Installer" do you have? Mine says 1.16.13405.0 when running:

(Get-AppxPackage -Name 'Microsoft.DesktopAppInstaller').'Version'

(WIN + R => "powershell" and press enter, then ^)

winget -v says v1.1.13405.

Windows 10 Pro 21H2, 19044.1387.

Edit: Alias or not, you should see "winget.exe" in following location:

  • %LOCALAPPDATA%\Microsoft\WindowsApps

And "AppInstallerCLI.exe" in following location, requires running as admin.

  • CMD
    • pushd "%ProgramW6432%\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe
    • dir
  • PowerShell
    • Set-Location -Path ('{0}\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe' -f $env:ProgramW6432)
    • Test-Path -Path '.\AppInstallerCLI.exe' # Should return "True"

@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage Issue need to be triaged labels Dec 14, 2021
@juner
Copy link

juner commented Dec 14, 2021

Is winget.exe set to ON in app execution aliases?

How to Manage App Execution Aliases in Windows 10

@denelon denelon added the Needs-Author-Feedback Issue needs attention from issue or PR author label Dec 14, 2021
@cheesecracker
Copy link
Author

cheesecracker commented Dec 17, 2021

In reply to @o-l-a-v

Hope my answer is human-readable :)

O/S just installed (ie even before Microsoft Store was ever opened for the 1st time)

  • (Get-AppxPackage -Name 'Microsoft.DesktopAppInstaller').'Version'
    gives 1.0.30251.0
  • Optionally, the command "winget" gives the same error as in my original post.
  • In %LOCALAPPDATA%\Microsoft\WindowsApps , no winget.exe
  • pushd "%ProgramW6432%\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe"
    "AppInstallerCLI.exe" is not there
  • Set-Location -Path ('{0}\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe' -f $env:ProgramW6432)
    Test-Path -Path '.\AppInstallerCLI.exe'
    Returns False

Open Microsoft Store for the first time. Verified that "App Installer" is indicated as installed in Microsoft Store

  • (Get-AppxPackage -Name 'Microsoft.DesktopAppInstaller').'Version'
    gives 1.0.30251.0 (same result like above)
  • Optional: try "winget" == same result
  • In %LOCALAPPDATA%\Microsoft\WindowsApps , still no winget.exe
  • pushd "%ProgramW6432%\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe"
    "AppInstallerCLI.exe" is still not there
  • Set-Location -Path ('{0}\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe' -f $env:ProgramW6432)
    Test-Path -Path '.\AppInstallerCLI.exe'
    Still returns False

Open "App Installer" again in Microsoft Store and wait for it to update this app (and it really takes ages...)

  • (Get-AppxPackage -Name 'Microsoft.DesktopAppInstaller').'Version'
    gives 1.16.13405.0
  • Optional: try "winget" == gives expected result (those blah blah blah)
  • In %LOCALAPPDATA%\Microsoft\WindowsApps , winget.exe is finally there!
  • pushd "%ProgramW6432%\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe"
    A LOT of files are added in that folder! Amongst them, "AppInstallerCLI.exe"!
  • Set-Location -Path ('{0}\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe' -f $env:ProgramW6432)
    Test-Path -Path '.\AppInstallerCLI.exe'
    Returns True

@ghost ghost added Needs-Attention Issue needs attention from Microsoft and removed Needs-Author-Feedback Issue needs attention from issue or PR author labels Dec 17, 2021
@cheesecracker
Copy link
Author

Is winget.exe set to ON in app execution aliases?

How to Manage App Execution Aliases in Windows 10

BEFORE update in Microsoft Store
Only pythonxx.exe are in the list (and all are set to ON)

AFTER update in Microsoft Store
winget.exe is also in the list (and it's set to ON)

@denelon denelon removed the Needs-Attention Issue needs attention from Microsoft label Jan 8, 2022
@denelon
Copy link
Contributor

denelon commented Jan 8, 2022

The version of App Installer coming in the Windows 10 distribution is the original version that shipped with Windows 10. It does take time for everything to synchronize and for the store to determine an update is available. Once you have the most recent version of App Installer on the system. The Windows Package Manager is available. This also holds true for Windows 11. We are working to be a part of the original distribution for the next update to Windows 11 so the Windows Package Manager can be present before getting an updated App Installer.

@denelon denelon closed this as completed Jan 8, 2022
@denelon denelon added this to the v1.2-Client milestone Jan 8, 2022
@jazzdelightsme
Copy link
Member

It does take time for everything to synchronize and for the store to determine an update is available.

FYI: It is possible to write some script code to programmatically (and synchronously) trigger those updates: #1738 (reply in thread)

@cheesecracker
Copy link
Author

FYI: It is possible to write some script code to programmatically (and synchronously) trigger those updates: #1738 (reply in thread)

I agree. Automation is good. But we need to wait for an undetermined period of time. Being able to trigger those things is even better.

@beingmerry
Copy link

I continue to have this issue on Windows 10 22H2. Winget is showing in the correct location %LOCALAPPDATA%\Microsoft\WindowsApps and the app alias is ON but I still cannot access winget from the CLI.
image

@yeskiy
Copy link

yeskiy commented Oct 16, 2024

For those, who can't really find a solution for that.

  1. Check, that winget.exe is located in %LOCALAPPDATA%\Microsoft\WindowsApps
  2. search path in your windows search (you should open Edit enviroment variables in your computer and hit Enviroment Variables... button)
  3. Find Path or PATH item in User variables for [name] and double-click on that
  4. Click New
  5. type %LOCALAPPDATA%\Microsoft\WindowsApps and hit Enter on your keyboard
  6. Restart a pc (or use refreshenv if you have choco)
  7. Success (Probably)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests

7 participants