Skip to content

winget upgrade --all shouldn't install the same package more than once #1105

Closed

Description

Description of the new feature/enhancement

Some packages support "side by side" installation. Executing winget upgrade --all shouldn't attempt to install the same "latest" version of a package more than one time.

Examples:
Cura - The .exe installs separate versions into Add / Remove Programs intentionally
Unity - microsoft/winget-pkgs#16038

Proposed technical implementation details (optional)

When the command is executed, check the list of packages to be upgraded. If the same "PackageIdentifier" is found as a possible upgrade more than one time, only execute the upgrade once.

Activity

  1. added
    Issue-Feature
    on Jun 4, 2021
  2. ghost added
    Needs-Triage
    on Jun 4, 2021
  3. removed
    Needs-Triage
    on Jun 4, 2021
  4. hash-include commented on Jun 17, 2021

    @hash-include

    Should this be of type: Issue-bug?
    Re-installing same package again and again is confusing and waste of resources.

  5. AdrianTM commented on Jun 17, 2021

    @AdrianTM

    I had a couple of R updates and had some old versions left on my system, winget didn't detect that 4.1.0 is already installed and "upgraded" these 3 versions 3 times for each run.

    Name Id Version Available Source

    R for Windows RProject.R 4.0.3 4.1.0 winget
    R for Windows RProject.R 4.0.4 4.1.0 winget
    R for Windows RProject.R 4.0.5 4.1.0 winget

    If I don't remove the old versions every time when I run it winget, it tries to "upgrade" these 3 packages 3 times on each run. To me this is a bug, actually two bugs here:

    1. doesn't detect the highest version (it should bail out if the highest version = current)
    2. tries to upgrade each of the old version, so multiple installation of the same version

    I did remove old versions, but some people might have legitimate reasons to keep multiple versions, winget should not try to upgrade anything if there are multiple versions and the highest version = current version.

  6. added this to the milestone on Jun 17, 2021
  7. denelon commented on Jun 17, 2021

    @denelon
    CollaboratorAuthor

    I'll switch the labels from "Issue-Feature" to "Issue-Bug".

    I'll share some of my original thinking about why I created this as a feature. When we designed the upgrade experience we didn't encounter this scenario. The client isn't throwing any exceptions. I perceived it as more of an improvement to the current experience than a bug. The current experience is clearly annoying and a waste of resources, but it is "by design".

    One persons feature could always be another persons bug. Thank you both for contributing!

  8. added
    Issue-Bug
    and removed
    Issue-Feature
    on Jun 17, 2021
  9. modified the milestones: , v1.2-Client on Oct 1, 2021
  10. hash-include commented on Nov 12, 2021

    @hash-include

    I'll switch the labels from "Issue-Feature" to "Issue-Bug".

    I'll share some of my original thinking about why I created this as a feature. When we designed the upgrade experience we didn't encounter this scenario. The client isn't throwing any exceptions. I perceived it as more of an improvement to the current experience than a bug. The current experience is clearly annoying and a waste of resources, but it is "by design".

    One persons feature could always be another persons bug. Thank you both for contributing!

    What made you think this as a feature in the first place? Just curious to understand the reasoning behind. It's an interesting position to have

  11. denelon commented on Nov 12, 2021

    @denelon
    CollaboratorAuthor

    I tend to think of "bugs" in terms of unintended behavior a a result of some sort of flawed logic implemented, or an unexpected interaction between dependencies. This would be in terms of "it did what I expected when I wrote it and tested it, but I didn't expect this other behavior it exhibited."

    For me, the Ultimaker.Cura package was the first I ran across with intentional "side-by-side" installation for newer versions. I thought it was strange when I had two versions on my machine and saw upgrade try to upgrade both of them. I hadn't realized when I ran upgrade the first time, that the older version persisted. Since then, I've seen other packages like C++ runtimes, and other programming languages.

    As I stated in my earlier comment, I perceived this Issue as an improvement in the behavior. The code was doing what it had originally been expected to do. Hence, not a bug. I think it's just a philosophical perspective. That's why I made the comment about one person's feature and another person's bug. Sometimes there is more than one right answer 😊.

  12. GitStudying commented on Jan 30, 2022

    @GitStudying

    I am seeing the latest comment on this thread is from more than 2 months ago, is there any update about this issue? I am seeing the exact behavior, about 6 applications (apparently some kind of version bugged) which get reinstalled again and again when running winget upgrade -h --all. I am running v1.2.3411-preview. I love the tool and works seamless for other applications.

  13. PascalVerbruggen commented on Oct 11, 2022

    @PascalVerbruggen

    Current production version is doing the reverse:
    Name Id Version Available Source

    Visual Studio Community 2022 Microsoft.VisualStudio.2022.Community 17.1.4 17.3.5 winget
    R for Windows 3.6.1 RProject.R 3.6.1 4.2.1 winget
    ...

    winget upgrade --id RProject.R
    Found R for Windows [RProject.R] Version 4.2.1
    This application is licensed to you by its owner.
    Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
    Downloading https://cloud.r-project.org/bin/windows/base/old/4.2.1/R-4.2.1-win.exe
    ██████████████████████████████ 78.7 MB / 78.7 MB
    Successfully verified installer hash
    Starting package install...
    Successfully installed

    => Result: both old and new version are installed, but according to winget nothing is installed.

    winget uninstall --id RProject.R --silent
    No installed package found matching input criteria.

    winget list --id RProject.R
    No installed package found matching input criteria.

    After manually removing old version ("C:\Program Files\R\R-3.6.1\unins000.exe" /SILENT):

    winget list --id RProject.R
    Name Id Version Source

    R for Windows 4.2.1 RProject.R 4.2.1 winget

  14. AndreasBrostrom commented on Jun 30, 2023

    @AndreasBrostrom

    Unity have a tendency of installing over an over again.

    Updating WinGet packages...
    Name                                             Id                                Version     Available   Source
    -----------------------------------------------------------------------------------------------------------------
    Unity 2021.3.11f1                                Unity.Unity.2021                  2021.3.11f1 2021.3.22f1 winget
    Unity 2021.3.15f1                                Unity.Unity.2021                  2021.3.15f1 2021.3.22f1 winget
    Unity 2021.3.16f1                                Unity.Unity.2021                  2021.3.16f1 2021.3.22f1 winget
    Unity 2021.3.17f1                                Unity.Unity.2021                  2021.3.17f1 2021.3.22f1 winget
    Unity 2021.3.18f1                                Unity.Unity.2021                  2021.3.18f1 2021.3.22f1 winget
    Unity 2021.3.19f1                                Unity.Unity.2021                  2021.3.19f1 2021.3.22f1 winget
    Unity 2021.3.20f1                                Unity.Unity.2021                  2021.3.20f1 2021.3.22f1 winget
    Unity 2021.3.21f1                                Unity.Unity.2021                  2021.3.21f1 2021.3.22f1 winget
    Unity 2021.3.6f1                                 Unity.Unity.2021                  2021.3.6f1  2021.3.22f1 winget
    Microsoft Windows Desktop Runtime - 3.1.32 (x64) Microsoft.DotNet.DesktopRuntime.6 < 6.0.5     6.0.19      winget
    Microsoft Windows Desktop Runtime - 5.0.17 (x64) Microsoft.DotNet.DesktopRuntime.6 < 6.0.5     6.0.19      winget
    SharpKeys                                        RandyRants.SharpKeys              3.9.3000    3.9.4000    winget
    Microsoft .NET SDK 6.0.313 (x64)                 Microsoft.DotNet.SDK.6            6.0.313     6.0.411     winget
    PowerShell 7.2.11.0-x64                          Microsoft.PowerShell              7.2.11.0    7.3.5.0     winget
    14 upgrades available.
    
    (1/3) Found Unity 2021 [Unity.Unity.2021] Version 2021.3.22f1
    This application is licensed to you by its owner.
    Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
    Downloading https://download.unity3d.com/download_unity/b6c551784ba3/Windows64EditorInstaller/UnitySetup64-2021.3.22f1.exe
      ██▋                              207 MB / 2.26 GB
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Issue-Bug

Type

No type

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions