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.09k stars 1.44k forks source link

winget install fails with 'No applicable installer found; see logs for more details' #2176

Open blakeduffey opened 2 years ago

blakeduffey commented 2 years ago

Brief description of your issue

When I issue a 'winget install' command such as winget install --id Git.Git -e --source winget --scope user I get

No applicable installer found; see logs for more details.

I am NOT using a local admin when I try this (my goal is to develop a process that doesn't require local admin).

Are there additional requirements to winget?

Steps to reproduce

winget install any application

Expected behavior

software installed

Actual behavior

No applicable installer found; see logs for more details.

Environment

winget --info
Windows Package Manager v1.2.10271
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.18363.2158
Package: Microsoft.DesktopAppInstaller v1.17.10271.0

Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
ItzLevvie commented 2 years ago

Scope: user doesn't currently exist for the Git.Git package; only the machine-wide installer exists in WinGet right now.

It uses similar installer switches like WinPython so it should be easy to add in winget-pkgs: https://github.com/microsoft/winget-pkgs/blob/cf7eaf4220df0030072fe5f82c78876ab957d5d2/manifests/w/winpython/winpython/3.9.5.0/winpython.winpython.installer.yaml#L14-L16

For reference: https://github.com/git-for-windows/git/releases/download/v2.36.1.windows.1/PortableGit-2.36.1-64-bit.7z.exe and https://github.com/git-for-windows/git/releases/download/v2.36.1.windows.1/PortableGit-2.36.1-32-bit.7z.exe are the Download URLs for the portable (Scope: user) version of Git for Windows.

blakeduffey commented 2 years ago

I appreciate your feedback about the -user scope. There appears to be a bug with the manifest that is also in play

https://github.com/microsoft/winget-pkgs/issues/36878

ItzLevvie commented 2 years ago

There appears to be a bug with the manifest that is also in play

That's also missing Scope which is fixed in https://github.com/microsoft/winget-pkgs/pull/61741 for Windows 10 and was tested on a VM that it works. --scope and its settings in the settings.json file will only work if the manifest declares it. Not all packages have Scope yet.

For the OS version issue (if you're not on Windows 11) for Windows Terminal we're waiting for a WinGet update to solve that. A workaround right now is to do winget install Microsoft.WindowsTerminal --version 1.12.10982.0 --scope user if you're on Windows 10. That issue is tracked by https://github.com/microsoft/winget-cli/issues/2134.

denelon commented 2 years ago

https://github.com/microsoft/winget-pkgs/pull/61771#issuecomment-1136344761

kdpuvvadi commented 2 years ago

A workaround right now is to do winget install Microsoft.WindowsTerminal --version 1.12.10982.0 --scope user

This workaround is not working on some machines. working on my work pc but not on my personal laptop.

$ winget install Microsoft.WindowsTerminal -v  1.12.10983.0 --scope user
No applicable installer found; see logs for more details.

Log

2022-06-01 15:31:09.285 [SQL ] Opening SQLite connection: 'file:/C:/Program Files/WindowsApps/Microsoft.Winget.Source_2022.601.600.163_neutral__8wekyb3d8bbwe/Public/index.db?immutable=1' [1, 40]
2022-06-01 15:31:09.285 [REPO] Opened SQLite Index with version [1.3], last write [2022-06-01 10:30:31.000]
2022-06-01 15:31:09.448 [REPO] Sending http POST request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/manifestSearch
2022-06-01 15:31:10.465 [REPO] Response status: 200
2022-06-01 15:31:10.478 [CLI ] Found one app. App id: Microsoft.WindowsTerminal App name: Windows Terminal
2022-06-01 15:31:10.479 [REPO] Downloading manifest
2022-06-01 15:31:10.479 [CORE] WinINet downloading from url: https://winget.azureedge.net/cache/manifests/m/Microsoft/WindowsTerminal/1.12.10983.0/8a05-Microsoft.WindowsTerminal.yaml
2022-06-01 15:31:12.209 [CORE] Download hash: 81b61f5e8242b2a37701420b595980ae80881ad957274fb10899fc7518ff8b3e
2022-06-01 15:31:12.209 [CORE] Download completed.
2022-06-01 15:31:12.212 [CLI ] Manifest fields: Name [Windows Terminal], Version [1.12.10983.0]
2022-06-01 15:31:12.212 [CLI ] Starting installer selection.
2022-06-01 15:31:12.212 [CLI ] Installer [X64,msix,User,] not applicable: Current OS is lower than MinOSVersion 10.0.22000.0
2022-06-01 15:31:12.212 [CLI ] Installer [Arm64,msix,User,] not applicable: Current OS is lower than MinOSVersion 10.0.22000.0
2022-06-01 15:31:12.212 [CLI ] Installer [Arm64,msix,User,] not applicable: Machine is not compatible with Arm64
2022-06-01 15:31:12.212 [CLI ] Installer [X86,msix,User,] not applicable: Current OS is lower than MinOSVersion 10.0.22000.0
2022-06-01 15:31:12.220 [CLI ] Terminating context: 0x8a150010 at D:\a\_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\InstallFlow.cpp:74
ItzLevvie commented 2 years ago

This workaround is not working on some machines. working on my work pc but not on my personal laptop.

You have to use version 1.12.10982.0 instead of version 1.12.10983.0 which will solve it for your use case on Windows 10.

Current OS is lower than MinOSVersion 10.0.22000.0 is tracked by https://github.com/microsoft/winget-cli/issues/2134 since this issue (https://github.com/microsoft/winget-cli/issues/2176) is mostly related to the scope of the installer.

According to Windows Terminal's release notes: This version of Windows Terminal is distributed in two bundles, one of which works on Windows 10-11 and the other of which only works on Windows 11. The Windows 11 version is much smaller because we no longer need to work around a platform issue related to our dependencies.

Both versions have the same feature set so you're not missing out on anything when you use 1.12.10982.0.

shannonfritz commented 2 years ago

I'm also getting the error 'No applicable installer found; see logs for more details.' when trying to install the new Quick Assist from the store, but I am using the --scope=machine instead of user. I've tried with WinGet v1.2.10941 and v1.3.1391-preview

winget install "quick assist" --accept-source-agreements --accept-package-agreements --scope=machine

If I remove the --source switch it installs, but I want the app available to all users on the device. Isn't it possible to install the app for the machine instead of just the user?

ItzLevvie commented 2 years ago

Isn't it possible to install the app for the machine instead of just the user?

cc @shannonfritz: It's not currently possible right now with WinGet but will probably be a thing in a future update.

"We are actually thinking to add support for provisioning msix for all users. When user requested scope:user, standard add-appxpackage will be invoked. When requested scope: machine. add-appxprovisionedpackage will be invoked. So I think it's ok to leave the scope not defined now?" in https://github.com/microsoft/winget-pkgs/pull/61742#issuecomment-1136428194

shannonfritz commented 2 years ago

It's not currently possible right now with WinGet but will probably be a thing in a future update.

@ItzLevvie That's a bummer. I was trying to use winget specifically because it's possible to get the store app without an account (since 1.3.1251-preview anyway), but now it won't install in the context I need. I've already jumped a bunch of hoops to install VCLibs and UI.Xaml and NuGet and DesktopAppInstaller just to get winget working.

Is it maybe possible to use winget to download the appx/msix/license from the store, and then I can use add-appxprovisionedpackage myself?

kdpuvvadi commented 2 years ago

You have to use version 1.12.10982.0 instead of version 1.12.10983.0 which will solve it for your use case on Windows 10.

Still facing the same issue even with 1.12.10982.0

winget install Microsoft.WindowsTerminal --version 1.12.10982.0 --scope user
Found Windows Terminal [Microsoft.WindowsTerminal] Version 1.12.10982.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Starting package install...
  ██████████████████████████████  100%
Installer failed with exit code: 0x80070002 : The system cannot find the file specified.

here's the log

Msg:[Operation failed: Windows cannot remove Microsoft.WindowsTerminal_3001.12.10982.0_neutral_~_8wekyb3d8bbwe because the current user does not have that package installed. Use Get-AppxPackage to see the list of packages installed.] 

2022-06-04 16:22:49.590 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Deployment.cpp(124)\WindowsPackageManager.dll!00007FFEB8DCBF5E: (caller: 00007FFEB8C65CD3) LogHr(1) tid(1100) 80073CF1 Package was not found.

Msg:[D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Deployment.cpp(54)\WindowsPackageManager.dll!00007FFEB8C6484A: (caller: 00007FFEB8C65C36) Exception(2) tid(1100) 80073CF1 Package was not found.

Msg:[Operation failed: Windows cannot remove Microsoft.WindowsTerminal_3001.12.10982.0_neutral_~_8wekyb3d8bbwe because the current user does not have that package installed. Use Get-AppxPackage to see the list of packages installed.] 
] 

2022-06-04 16:22:49.594 [CLI ] MSIX installer failed: 2147942402
2022-06-04 16:22:49.594 [CLI ] Terminating context: 0x80070002 at D:\a\_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\InstallFlow.cpp:17f
ItzLevvie commented 2 years ago

Still facing the same issue even with 1.12.10982.0

Well I spoke too soon with those pull requests.

It's a bit of a hit or miss sometimes as it's trying to uninstall 1.12.10982.0 (Windows 10) despite you not having that version installed but 1.13.11431.0 (Windows 10) seems to go through and no idea why.

It's also an error that me, @jedieaston and a few others are having issues with.

Running winget install Microsoft.WindowsTerminal --version 1.12.10982.0 --scope user on Windows Terminal in Windows PowerShell: image

Here's where the magic happens. Running winget install Microsoft.WindowsTerminal --version 1.13.11431.0 --scope user on Windows Terminal in Windows PowerShell: image

shannonfritz commented 1 year ago

want the app available to all users on the device. Isn't it possible to install the app for the machine instead of just the user?

It's not currently possible right now with WinGet but will probably be a thing in a future update.

@ItzLevvie That's a bummer. I was trying to use winget specifically because it's possible to get the store app without an account (since 1.3.1251-preview anyway), but now it won't install in the context I need. I've already jumped a bunch of hoops to install VCLibs and UI.Xaml and NuGet and DesktopAppInstaller just to get winget working.

Is it maybe possible to use winget to download the appx/msix/license from the store, and then I can use add-appxprovisionedpackage myself?

I was able to work around this by installing the current version of DesktopInstaller from GitHub in order to update Winget and install QuickAssist, and then try using Add-AppxPackage to register the app in the user context if needed.

You can find the script here https://www.powershellgallery.com/packages/Invoke-QuickAssist/