Open PatrickSchmidtSE opened 4 days ago
@JohnMcPMS thats the issue for my comment yesterday :)
This would also help for analyzing 🗡️
/// a lot of fields and no one requesting it. <<< I DOES NOW :D
/// DESIGN NOTE: /// GetManifest from IPackageVersion in AppInstallerRepositorySearch is not implemented in V1. That class has /// a lot of fields andc /// Gets the manifest of this package version. /// virtual Manifest::Manifest GetManifest() = 0;
So i think i got finally an idea what is happening: @JohnMcPMS This should be an easy fix for you and your team for the next release :)
Snakefoot has a MinimumOSVersion included
ManifestVersion: 1.6.0 MinimumOSVersion: 10.0.0.0 PackageIdentifier: snakefoot.snaketail
If you go to this check ---> (sadly OSFilter is NOT publicly changable )
You will see that the relevant function is using verifyversioninfow , which delivers a wrong comparism under WIndows10 if the manifest is not changed
If i change that in my app manifest it works for my code, but not for the COM or detection from winCLI via COM.
https://learn.microsoft.com/de-de/windows/win32/api/winbase/nf-winbase-verifyversioninfow
This must be fixed OR at least adressed via an OSFIlter ignore option :)
Packages that are working like VIM has NO MinOS on MetaData
Brief description of your issue
When using the COM-API ( based on this project https://github.com/marticliment/WinGet-API-from-CSharp/tree/main/WindowsPackageManager%20Interop/WindowsPackageManager)
installation etc is working fine. Binaries coming from the project.
But "upgrading" via UpgradePackageAsync has been a very poor experience so far. Most of the upgrades fail with "NoApplicableInstaller" error code, while winget.exe upgrade does upgrade successfully.
I tested it with many packages, some work (Docker.DockerDesktop) , but many does lead to the above error ( like Java8 etc )
Steps to reproduce
Install a package like "snakefoot.snaketail" in an older version "1.9.7.0"
Then use the COM API to run the UpgradePackageAsync mechanic.
Expected behavior
Successfully upgrade to application with InstallResultStatus.OK
Actual behavior
InstallResultStatus.NoApplicableInstaller
By the documentation this means, that means that the Upgrade function could not find an available installer given the "options". i tried every options combination, architecture stuff, used all the switches to ignore stuff. Everyhing leads to the same result.
I looked up via the installedVersion property which "Installer" is used and what characteristiks but they are all normal and even setting stuff to the settings the installedVersion has.. It all ends the same.
If i just put "winget upgrade --id snakefoot.snaketail --silent --force" it instantly downloads the msi and installs it successfully.
Proposed problem and solution So i think i got finally an idea what is happening:
Snakefoot has a MinimumOSVersion included
ManifestVersion: 1.6.0 MinimumOSVersion: 10.0.0.0 PackageIdentifier: snakefoot.snaketail
If you go to this check ---> (sadly OSFilter is NOT publicly changable )
You will see that the relevant function is using verifyversioninfow , which delivers a wrong comparism under WIndows10 if the manifest is not changed![image](https://github.com/microsoft/winget-cli/assets/9859622/eb5d03ba-9abc-45ae-879a-261f93e25297)
If i change that in my app manifest it works for my code, but not for the COM or detection from winCLI via COM.![image](https://github.com/microsoft/winget-cli/assets/9859622/9b9fe310-85cf-4497-8744-b480359f7dea)
https://learn.microsoft.com/de-de/windows/win32/api/winbase/nf-winbase-verifyversioninfow
This must be fixed OR at least adressed via an OSFIlter ignore option :)
Environment