-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
VersionRange causes issues when packages have multiple DisplayVersion #4125
Comments
It seems like a goal is to solve the version matching issue without invoking local storage on a PC, but honestly having something like a local winget.db, with a managed list of what's installed, could vastly improve the user experience in certain situations. |
I disagree, since applications can change underneath that database - In fact, installed.db already exists today for packages the user installed with WinGet. |
The goal of the
With that history out of the way, we can discuss the issue at hand: How could we support the case where different installers use wildly different version numbers, leading to overlapping ranges. Forcing exact matching only would be an option, although I don't like that it means that we are making an ordered version into an unordered version if we don't know about it. It would also mean adding support for multiple ranges since the easiest method would be to simply create N "ranges" for the N unique versions in the manifest. I'm not sure that we can automatically detect different modes amongst the versions to create multiple intended ranges. The potential for error seems high. It would probably be better to have it indicated in the manifest in some fashion. Multiple ranges also inherently become unordered if they need this, since we no longer can place an unknown version. Because the versions differ between installer types for this instance, one solution would be splitting the package into EXE and MSI variants. That might not work very well, and generally I'm not a fan of it as a solution. But if coupled with the feature for "virtual packages", it is possible that the user experience could be maintained. If |
This is partially accurate to the way I remember it. The concept of "Marketing Version" as I remember it had more to do with exact versions published on an ISV's website. For example - major versions like "VS 2022" and "VS 2017" are generally separate packages; however - the .NET team publishes on the website that their version is When it comes to packages having "drift", the range still would need to be in the manifest and specified within the
I guess my question is really around what you mean by |
Yes, this is the case.
Correct.
We attempt to map the display version from the installed entry. If it falls into a range (which may be a single value), then it is that exact package version. Otherwise it is considered greater or less than a version. It must be mapped so that we can order it. For the commit hash type of version, we end up just doing string sorts which is probably not helpful. Forcing exact matching will result in this for any package type. |
I guess it's the entire concept of the ranges which confuses me, then, because for any given Package Version the exact DisplayVersion of each installer should be known. In fact, in order to create a range which is more than a single version, there must be multiple DisplayVersion which are known. Even taking the example of "drift" where different architectures have different versions written to registry - the versions for the architectures must be known in order to create the range. Out of curiosity, I took a look at the number of packages that had multiple This means that 99% of the time, the "range" is actually a single version and exact mapping wouldn't impact these packages. The other 1% of the time, the exact versions are known anyways. PowerShell and output of files with multiple DisplayVersion
Edit: I do realize that this is just the winget-pkgs repo, and that others could have private sources set up, but I feel it's a representative enough sample to draw some assumptions |
The range part isn't actually that important; it is just data that is fed into the mapping function. The mapping is the part that breaks down if there are overlaps in the version space (avoiding the term range here) that package versions occupy. What we need to do in these cases is translate the display version into the package version space. We only make decisions about upgrades in the package version space. And we cannot assume that we have complete knowledge of the set of released installers. So we have a function (explanatory names here) Now imagine that we allow only exact values, and there is a case where the exact values for two versions is: version 1 { A, D } and version 2 { B, E }. I am using letters for the
|
Would it not be the same as it is today, where version "C" doesn’t fit anywhere nicely, and an upgrade is always available. In fact, I think this behavior can be seen today if a new manifest version doesn’t contain |
Brief description of your issue
In a manifest, different installers can have different DisplayVersion. Because of the way the matching logic works, a range is created encompassing the highest and lowest version within the manifest. Between two manifests, the version ranges are not allowed to overlap.
This causes issues when the display versions are vastly different between installers. Take Zoom.Zoom for example - The exe installer writes
5.17.2 (29988)
while the msi writes5.17.29988
. This means that the version range is calculated as5.17.2 - 5.17.29988
. When version 5.17.3 is released, it is seen as a version range overlap because it is greater than 5.17.2 and less than 5.17.29988. This makes it impossible to achieve correct version mapping for Zoom.Steps to reproduce
microsoft/winget-pkgs#137363
Expected behavior
I expect that when a DisplayVersion is in the manifest, the ARP entry must exactly match that version. If different installers have different DisplayVersion, then an exact match would be required with a DisplayVersion corresponding to an installer to determine the manifest version
Actual behavior
microsoft/winget-pkgs#137363 (comment)
Environment
The text was updated successfully, but these errors were encountered: