microsoft / winget-pkgs

The Microsoft community Windows Package Manager manifest repository
MIT License
8.67k stars 4.52k forks source link

[Package Issue]: JetBrains.IntelliJIDEA.Ultimate #112662

Open khaliddermoumi opened 1 year ago

khaliddermoumi commented 1 year ago

Please confirm these before moving forward

Category of the issue

Installation issue.

Brief description of your issue

winget tries to upgrade the package JetBrains.IntelliJIDEA.Ultimate 2023.1.4 with the same version any time you run upgrade.

Steps to reproduce

The initial installation of version 2023.1.4 runs successfully. This is what the "installed" list looks like after setup:

PS C:\Windows\System32> winget list --source winget
Name                                                    Id                                                  Version            Available
----------------------------------------------------------------------------------------------------------------------------------------
IntelliJ IDEA 2023.1.4                                  JetBrains.IntelliJIDEA.Ultimate                     > 2023.1           2023.1.4

But when you run "winget upgrade" afterwards, the same version is found again as an upgrade. It is then tried to run the upgrade, which fails.

Actual behavior

winget tries to upgrade with the same package that is already installed. (This may be because the listed version is wrong) The upgrade then fails, as the installer finds the existing installation, and exits the installation.

Expected behavior

winget should not try to upgrade the package with the same version already installed.

Environment

PS C:\Windows\System32> winget --info
Windows Package Manager v1.5.1572
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.3208
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.20.1572.0

Screenshots and Logs

n/a

ghost commented 1 year ago

It would be great if this could be fixed permanently. This is a recurring issue and happened in the past.

My guess is that there is a version confusion when winget searches _C:\Program Files\WindowsApps\Microsoft.Winget.Source_2023.725.1703.974_neutral_8wekyb3d8bbwe\Public\index.db

SELECT manifest.rowid, ids.id, names.name, versions.version
FROM manifest
LEFT JOIN ids ON ids.rowid=manifest.id
LEFT JOIN names ON names.rowid=manifest.name
LEFT JOIN monikers ON monikers.rowid=manifest.moniker
LEFT JOIN versions ON versions.rowid=manifest.version
LEFT JOIN pathparts ON pathparts.rowid=manifest.pathpart
-- lool for specifics:
WHERE names.name LIKE 'IntellIJ IDEA Ultimate Edition' and versions.version like '%2023.1%'
-- [ASC, DESC]
ORDER BY ids.id ASC
;

Outputs the following and instead of using 2023.1.4, it uses 2023.1

image

khaliddermoumi commented 1 year ago

BTW: since the IntelliJ package has a poor "silent" setup (still requiring interaction), and is often buggy, I switched to use the "pin" feature, so my installation does not get destroyed by the package. Better a manual update than setting up an IDE repeatedly.

ghost commented 1 year ago

@khaliddermoumi same here, I am currently using the pin command until I receive notice from JetBrains Release Notes that they take care of this issue in a coordinated manner.

I wouldn't hope for a solution soon, as JetBrains official statement on the same issue on YouTrack is that they don't care about Winget, because "That is a community-driven project."

Source: https://youtrack.jetbrains.com/issue/IDEA-326100/winget-install-JetBrains.IntelliJIDEA.Ultimate-installs-version-2023.1.4-or-2023.1.5-but-reports-that-2023.1-is-installed-when#focus=Comments-27-7929541.0-0

treysis commented 1 year ago

I think the problem is that IntelliJIDEA is now using PackageVersion as version number and also puts theses in the DisplayVersion under ARP, but some older manifests still have the build number listed as Version number. The build numbers numbering scheme is of course incompatible with the semantic versioning scheme and thus WinGet assumes something wrong.

Unfortunately, I assume the solution is to either purge all old(er) manifests (i.e. <=2023.1) or strip them of the "DisplayVersion" tag.

treysis commented 1 year ago

So, as I had the same problem with the Community Edition, I issued a pull request to fix the "latest" problematic manifest. Indeed, now the previous manifest to this one - that also still uses DisplayVersion is the problematic one.

I am not sure though if it would help to add the DisplayVersion to the current/latest manifest.