microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.15k stars 1.44k forks source link

Microsoft Preview applications should not be listed when running winget upgrade or a --preview switch should be added #1701

Open 0ric1 opened 2 years ago

0ric1 commented 2 years ago

Description of the new feature / enhancement

When running winget upgrade I get the following applications listed as not uptodate: Microsoft Visual C++ 2015-2022 Redistributable (x… Microsoft.VC++2015-2022Redist-x86 14.30.30704.0 14.31.30818.0 winget Microsoft Visual C++ 2015-2022 Redistributable (x… Microsoft.VC++2015-2022Redist-x64 14.30.30704.0 14.31.30818.0 winget Microsoft .NET SDK Microsoft.dotnet 5.4.321.52708 6.1.21.52711 winget But these seem to be preview versions, e.g. Redistributable 14.31.30818.0 is shipped with Visual Studio 2022 17.1.0 Preview 1.0. I (and may be all other people too) don't want to install preview versions on a production system. A switch could be added to allow preview versions to be listed e.g. winget upgrade --preview Thanks for the help, Andreas.

Proposed technical implementation details

winget upgrade --preview

jedieaston commented 2 years ago

We usually don't put preview versions under the same ID, I don't know why that redist version is there. (@ItzLevvie, looks like you submitted that PR? https://github.com/microsoft/winget-pkgs/pull/34549)

That version of the .NET SDK is in stable though. https://github.com/microsoft/winget-cli/issues/476 should allow you to stop upgrades if you aren't ready to move to .NET 6.

0ric1 commented 2 years ago

The current dotnet version is 6.0.100 https://dotnet.microsoft.com/download/dotnet (I already have installed) but not 6.1.x - 6.1.x seems to be a preview version too.

ItzLevvie commented 2 years ago

VC++ Redist links were taken from https://github.com/abbodi1406/vcredist/blob/master/source_links/README.md, so I wasn't aware it was a preview version. EULA in the installer seems to be the same on both when installing, but I wouldn't mind splitting them out.

At the moment, there's no such thing as .NET 6.1, the team likely moved to developing .NET 7. Latest Production version of .NET 6.0 is displayed as 6.1.21.52711 in Control Panel instead of 6.0.100.

You can take a look at: image

0ric1 commented 2 years ago

The official Microsoft link "Microsoft Visual C++ Redistributable Latest Supported Downloads" for the redistributables is : https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist

ItzLevvie commented 2 years ago

The official Microsoft link "Microsoft Visual C++ Redistributable Latest Supported Downloads" for the redistributables is : https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist

Yeah, I used to use that website before, but I found out that the links there for some the Visual C++ Redistributable which are older than 2019 are outdated and were missing critical security patches: https://github.com/microsoft/winget-pkgs/pull/31024, https://github.com/microsoft/winget-pkgs/pull/31025, https://github.com/microsoft/winget-pkgs/pull/31026, https://github.com/microsoft/winget-pkgs/pull/31027, https://github.com/microsoft/winget-pkgs/pull/31028, https://github.com/microsoft/winget-pkgs/pull/31029, so I decided to use https://github.com/abbodi1406/vcredist/blob/master/source_links/README.md which seems to be updated more frequently than the aka.ms links as the aka.ms links are updated manually by a human so sometimes the aka.ms links are behind compared to the Visual Studio links.

Judging by the links used in https://github.com/abbodi1406/vcredist/blob/master/source_links/README.md, I assume it was grabbed from Visual Studio compared to the aka.ms links, despite the InstallerSha256 being the same.

denelon commented 2 years ago

I'm guilty of not getting the aka.ms links updated myself. I'm going to start creating an Issue for RC builds to capture the tasks necessary including updating aka.ms links when a release is pushed. We're close to shipping the first 1.2 dev build as well. It's being internally validated now.

shtau1 commented 2 years ago

It seems that the original intent of this thread was to indicate that currently some winget upgrades cause a non-preview program to get updated to the latest version, which happens to be a preview version. I think the .NET issue was used as an example. The problem most likely being that some devs use the same app ID for their non-production channels.

Suggested Fix by OP: add a --preview option.

To extend on that a bit:

  1. Require devs to indicate if a version is a preview version and what channel (beta, alpha, preview). 1a. OR Require devs to use separate app IDs for their non-production releases. (I think first option is easier to prevent bypassing)
  2. Change functionality of 'winget upgrade' command to upgrade to same channel only unless '--preview' option is used.
  3. Add Channel sub-option for '--preview' allowing someone to define least channel to install or only channel to install

ie. winget upgrade --all --preview true, alphaonly # will only perform upgrade if alpha version available for DL. winget upgrade --all --preview true, alpha # will perform upgrade if version is alpha, beta, preview or production (including production). This option may have to limit to pre-production versions, since their can be some issues with upgrading from non-production to production in some cases. winget upgrade --all # upgrade same channel only. (production, non-production, doesn't matter)

anyhow, you all can probably best mesh that out.

denelon commented 2 years ago

This is related to: