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

When displaying only the latest version of a package, some of them aren't really the latest version as shown in winget. #63

Open
DrewNaylor opened this issue Nov 22, 2020 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed known issue

Comments

@DrewNaylor
Copy link
Owner

Currently I'm using this SQLite query to return the list of packages sorted by the latest version, and it works for a few packages but not all. For example, it works for guinget but not Adopt OpenJDK. Seems like the latest version added is what shows up in guinget as the "latest version", but I can't easily verify that. Once it's ready to load the package list into the data grid view, it compares the version and latest version to see if it should add the package to the list. There's one column that's usually hidden that's used to store the "latest version" and you can show it through the Designer for debugging, if you wish.

"SELECT DISTINCT
    ids.id, manifest.id, versions.version, manifest.version, names.name, manifest.name,
    LAST_VALUE ( versions.version ) OVER (
		PARTITION by ids.id
        ORDER BY ids.id 
        RANGE BETWEEN UNBOUNDED PRECEDING AND 
        UNBOUNDED FOLLOWING
    ) AS NewestVersion 
FROM
    ids, manifest, versions, names 
WHERE
    manifest.id = ids._rowid_ and manifest.version = versions._rowid_ and manifest.name = names._rowid_;"

This was copied from PackageListTools.vb in the GetPackageDetailsTableFromSqliteDB function.

Displaying the latest version can be done by using the latest build from the main branch (either from AppVeyor or by building manually) and by turning on the Load package list from SQLite database and Display latest package versions experimental settings (may have different text; it's been a while since looking) in Tools>Options>Experimental after showing hidden controls by clicking in the bottom-left corner of the About window. Once turned on, just refresh the cache and it'll load what it thinks is the latest version of each package.

I think what's going on is I'm using the wrong query. Tried to read winget's code for this, but it's not all in one place and I don't know C++, so I couldn't figure it out from there. Also tried looking at what Winstall does, but I couldn't find an SQLite query example in there. Did find some code where it moves versions into higher spots or something, but that didn't really have an easy way to apply to this.

@DrewNaylor DrewNaylor added bug Something isn't working help wanted Extra attention is needed known issue labels Nov 22, 2020
@DrewNaylor
Copy link
Owner Author

DrewNaylor commented Nov 27, 2020

An update on this: looks like Microsoft fixed the AdoptOpenJDK package versions but another package that had something to do with subtitles now shows the wrong version number in guinget as the "latest" one.

Edit: Looks like Adopt OpenJDK is back to saying the latest is 8.x and the other package is correct. If I understood how to use the version comparison thing like in winget's utility DLL, I'd use it.

@DrewNaylor DrewNaylor pinned this issue Dec 1, 2020
@DrewNaylor
Copy link
Owner Author

Latest status on this issue: Adopt OpenJDK appears to now be split into separate packages for each version, so that shouldn't be an issue anymore. Unfortunately, 7zip now suffers from the "old version showing as the latest" issue, so I still can't have that setting be on by default yet. I really need to get the version selector window working so that people can remove duplicated entries but still install the latest version of an application even if the version displayed as the latest isn't correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed known issue
Projects
None yet
Development

No branches or pull requests

1 participant