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

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

Closed
denelon opened this issue Jun 4, 2021 · 9 comments · Fixed by #1652
Closed

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

denelon opened this issue Jun 4, 2021 · 9 comments · Fixed by #1652
Assignees
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Milestone

Comments

@denelon
Copy link
Contributor

denelon commented Jun 4, 2021

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.

@denelon denelon added the Issue-Feature This is a feature request for the Windows Package Manager client. label Jun 4, 2021
@ghost ghost added the Needs-Triage Issue need to be triaged label Jun 4, 2021
@denelon denelon removed the Needs-Triage Issue need to be triaged label Jun 4, 2021
@hash-include
Copy link

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

@AdrianTM
Copy link

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.

@denelon denelon added this to the v.Next - Windows Package Manager milestone Jun 17, 2021
@denelon
Copy link
Contributor Author

denelon commented Jun 17, 2021

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!

@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Issue-Feature This is a feature request for the Windows Package Manager client. labels Jun 17, 2021
@denelon denelon added this to WinGet Sep 29, 2021
@denelon denelon modified the milestones: v.Next-Client, v1.2-Client Oct 1, 2021
@yao-msft yao-msft linked a pull request Oct 28, 2021 that will close this issue
Repository owner moved this from Assigned to Done in WinGet Nov 4, 2021
@hash-include
Copy link

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

@denelon
Copy link
Contributor Author

denelon commented Nov 12, 2021

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 😊.

@GitStudying
Copy link

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.

@ItzLevvie
Copy link

ItzLevvie commented Jan 30, 2022

If you're having issues with upgrading applications that don't display a version in Control Panel, it's fixed in #1765 and will most likely be included in the next WinGet preview release.

@PascalVerbruggen
Copy link

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

@AndreasBrostrom
Copy link

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
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

8 participants