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

version check logic error #3529

Closed
pedoc opened this issue Aug 17, 2023 · 1 comment · Fixed by microsoft/winget-pkgs#117082
Closed

version check logic error #3529

pedoc opened this issue Aug 17, 2023 · 1 comment · Fixed by microsoft/winget-pkgs#117082
Labels
Area-Matching Issue related to correlation between installed package and manifest Issue-Bug It either shouldn't be doing this or needs an investigation.
Milestone

Comments

@pedoc
Copy link

pedoc commented Aug 17, 2023

Brief description of your issue

When I perform a winget upgrade on my computer, I find that the installed version of multiple software listed is greater than the available version, but it still appears in the list, which is incorrect

Steps to reproduce

1. winget upgrade

image

For example, in Stardock Fences 4 here, the installed version is 4.2.1.2, and the available version is 4.07.02. Obviously, my current installed version is greater than the available version, so it should not appear in this list

Expected behavior

Properly check the installed and available versions, when the installed version is greater than the available version, it should not be listed

Actual behavior

a wrong version is listed

Environment

[winget --info]

Windows 程序包管理器 v1.5.2201
版权所有 (C) Microsoft Corporation。保留所有权利。

Windows: Windows.Desktop v10.0.25931.1000
系统体系结构: X64
软件包: Microsoft.DesktopAppInstaller v1.20.2201.0

Winget Directories
-----------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages

链接
----------------------------------------------------------------------------
隐私声明             https://aka.ms/winget-privacy
许可协议             https://aka.ms/winget-license
第三方声明           https://aka.ms/winget-3rdPartyNotice
主页                 https://aka.ms/winget
Windows 应用商店条款 https://www.microsoft.com/en-us/storedocs/terms-of-sale

管理员设置                                状态
------------------------------------------------
LocalManifestFiles                        已禁用
BypassCertificatePinningForMicrosoftStore 已禁用
InstallerHashOverride                     已禁用
LocalArchiveMalwareScanOverride           已禁用
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Aug 17, 2023
@Trenly
Copy link
Contributor

Trenly commented Aug 17, 2023

For example, in Stardock Fences 4 here, the installed version is 4.2.1.2, and the available version is 4.07.02. Obviously, my current installed version is greater than the available version, so it should not appear in this list

The comparison logic does seem to be working properly. Breaking down the version comparison, by parts the installed version breaks down to {4, 2, 1, 2} and the available version breaks down to {4, 7, 2, 0}. Then, going through one at a time 4 is equal to 4, so move to the next part. 2 is less than 7, so the versions are not equal. Since 7 is greater than 2, then 4.07.02 should be a higher version than 4.2.1.2.

This may be a case where the publisher does not use semantic versioning, in which case this won't be able to be truly solved until either marketing versions are added, or the publisher moves to use Semantic versioning. What we can do as a temporary fix is to remove 4.07.02 from the available packages

@stephengillie stephengillie added Issue-Bug It either shouldn't be doing this or needs an investigation. Area-Matching Issue related to correlation between installed package and manifest and removed Needs-Triage Issue need to be triaged labels Aug 17, 2023
@denelon denelon added this to the v1.6 Client milestone Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Matching Issue related to correlation between installed package and manifest Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants