Open MartinSGill opened 2 years ago
Still seeing this issue. The log message has become better at least.
[...] Required locales: [en-GB, en-US, en] Or does not satisfy compatible match for Preferred Locales: [en-IE, en-US, en-GB, de-DE, ja]
Same issue for me, for the following update
Epic Games Launcher EpicGames.EpicGamesLauncher 1.3.82.0 1.3.93.0 winget
I was able to force an update with this:
winget upgrade EpicGames.EpicGamesLauncher --locale en-US
The cause seems to lie in the manifesto. In which the entry InstallerLocal has been added.
The problem is indeed a missing InstallerLocale
in the manifest and how it is handled (or lack thereof) in the ManifestComparator
. This omittance will be problematic, if settings.json
contains installBehavior > preferences > locale
or --locale
is used.
Unless InstallerLocale
is present, Manifest::ManifestInstaller::Locale
will be an empty string. This is even visible in the log message, "Installer locale does not match required locale: Required locales [...]
", which should display the required locale:
https://github.com/microsoft/winget-cli/blob/2979fd81dedd79f06bb0061159f6764b4ac70a9a/src/AppInstallerCLICore/Workflows/ManifestComparator.cpp#L684-L693
The problem is likely just a small mishap, just a few lines above, which happened in commit 4b613b3057df01b8225ff50a73af971fa27d02b5. For a Preferred Locale a match is always made, if the Installer Locale is empty. This code path is not taken, unless the locale is what is currently installed. This is exactly why one would like to use --locale
, override the locale derived from the currently installed version.
However, in case of a Required Locale, the empty Installer Locale is not checked. This code path is not taken, if there is no Required Locale present, i.e. --locale
or a corresponding settings.json
setting.
Unless there is a match (and for an empty string there is none), GetDistanceOfLanguage
returns 0.0
(more precisely, this is what GetDistanceOfClosestLanguageInList
sets as the distance, if no match is found or either [or both] of the input strings are empty).
So, to summarize, at the moment installing a problematic package is not possible with --locale
(manifest is missing InstallerLocale
) or without --locale
(manifest PackageLocale
and installed locale do not match; the reported installed version is not necessarily correct, but this is obviously the problem with the installer).
Brief description of your issue
Attempting to install a package, I get an error message: "No applicable installer found; see logs for more details."
I first noticed this with
upgrade --all
failing to upgrade many packages without any warnings/errors. Then tried to uninstall/reinstall packages manually and discovered this issue.Steps to reproduce
Tried this with a number of applications (installer types), including:
winget install OpenTTD.OpenTTD
(nullsoft)winget install Microsoft.PowerToys
(burn)REALiX.HWiNFO
(inno)All gave the same error, non of them installed correctly.
Downloading the installer (from the manifest file) and running it directly works without issue.
Expected behavior
Correctly install the application, or provide a helpful error message.
Actual behavior
Nothing happens; useless error message.
Environment