-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Some packages don't provide Version
info, and winget upgrade
constantly reports those
#1255
Comments
I don't know if this would be possible without winget keeping its own database on the client with a list of apps its installed, which will get out of sync with ARP table changes. Maybe an |
@jedieaston, to make sure we are on the same page, WinGet already tries to upgrade the packages which report status as If you install |
Oh, I should’ve made it a bit more clear. WinGet shouldn’t try to upgrade software with version (I’ve seen this behavior before, sorry for the confusion) |
Oh, I see your point now, correct it would be nice, and it may solve part of the problem. |
What method does winget use to determine app version? I would have expected it to query the properties of the program, but that does not seem to be the case, as winget shows the version as |
It uses the ARP (Add and Remove Programs) information, which then is tied to the Registry keys. This is nothing new so this is the Developers fault. |
See, if they are going through the trouble of setting the executable's properties I wonder why they aren't going through the trouble of setting the ARP table. Maybe that's something for the Windows packaging team to ask ISVs, because I can't imagine it's that much more work to publish it in a different place. It's possible winget could read the executable's version, but it would have to know where it is, and right now winget doesn't track where installers spew files (that would be a gigantic hassle and probably is outside of the scope for the tool, except for portable apps, of course). |
We're discussing a few different approaches for dealing with Apps that don't report the installed version. We thought about using something like auto-pinning these packages, but that sets a confusing precedent if the developer pinned a package, and it upgraded itself. We may not be able to pin these packages. The last round of notes is on #1163 |
I think simplest way is just exclude software what doesn't store version info to registry. After all program developer is the one who should fix their programs and write that information. I was thinking that it would be possible to query version on the fly by 1st using registry query to find where executable is and then doing PS Get-Item VersionInfo against executable. But 2 out of 3 installed programs what report version unknown was success. Geekbench 5 was failure. It doesn't store it's version in executable meta, so even that is not an option because it won't catch all. |
As a temporary workaround, until there is a better solution, I created a PowerShell script to skip Unknowns. If you use it without the It can also read a skip file for a list of packages not to upgrade, for instances I use it to skip instances of Unity or Visual Studio. Skip functionality defaults to reading a file called PS Script Skip Text File I Use Maybe it might help meanwhile |
I've figured out a workaround especially if you have only a couple offending programs: Manually change the registry entry to add the version number yourself. 1. In Regedit, find the key/folder for the relevant program. I've found program installation entries are listed in one of these places (not sure if there's any other locations):
2. Find the one for the program and click it to view the values (whatever the data is called on the right side). For example look for "DisplayName" which basically every program should have, to know you're in the right place. 3. Then just right click to create a new String Value called "DisplayVersion", then double click to change the value to whatever is the correct version number you want. It should now show in both Add/Remove Programs and in Winget. Note: If the offending program is on Github you might wish to just go on there, find whatever configuration file the developer is using that creates these entries (like an .nsi file for NSIS), and make a pull request to show them how to add version number. It probably already have a list of other registry entries it's making so you just create a new one for DisplayVersion. (Technically I think it's best practice to also include keys called 'versionMajor' and 'versionMinor' if you want) |
Winget relies on this value to get the version of a program. If it's missing winget will just download the newest version even if the program is up to date. See microsoft/winget-cli#1255
This feature was implemented by @jedieaston and is available in the 1.2 Release Candidate. |
@denelon Unfortunately, I don't think it applies to this one |
This comment was marked as outdated.
This comment was marked as outdated.
*1.3 preview release. It wasn't present in the 1.2 release candidate. https://github.com/microsoft/winget-cli/releases/tag/v1.3.431 |
I feel like, while this is a developer issue, it should also be addressed on this end where if you run an upgrade through this, that it should keep track of the last installed version so that running (Sorry for revive, but I feel it's related and not worth making a new issue over.) |
I do actually agree, but i don't think Microsoft wants to do it that way, winget-cli could simply make a new string called WinGetVersion if DisplayVersion is not present, but i think there are security issues and breakable issues by doing that. |
…rt#4730) Winget relies on this value to get the version of a program. If it's missing winget will just download the newest version even if the program is up to date. See microsoft/winget-cli#1255
Some packages don't provide
Version
info, andwinget upgrade
constantly reports those.Steps to reproduce
The following snippet will install a couple of packages that I identified with the issue.
Expected behavior
winget upgrade
should present the existingVersion
.Actual behavior
It shows the version as
Unknown
; even itself installed the packages.Environment
The text was updated successfully, but these errors were encountered: