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.07k stars 1.43k forks source link

winget tries to install new powershell but the version is already installed #3179

Closed pleabargain closed 2 months ago

pleabargain commented 1 year ago

Brief description of your issue

image

powershell 7.3.4 is already installed but winget thinks it is PS7.3.2

Steps to reproduce

winget upgrade --all

Expected behavior

Identify correct version of software

Actual behavior

misreading PS version #

Environment

C:\Users\denni>winget --info
Windows Package Manager v1.3.2091
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.2846
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.18.2091.0

Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale
denelon commented 1 year ago

Can you share the output from winget list powershell?

I'm curious what versions are reported.

gwojan commented 1 year ago

@denelon I have a similar issue except with the latest PowerShell Preview.

winget list powershell
Name                       Id                                Version      Available Source
------------------------------------------------------------------------------------------
PowerShell 7-x64           Microsoft.PowerShell              7.3.4.0                winget
PowerShell 7-preview-x64   Microsoft.PowerShell.Preview      > 7.3.8.0    7.4.0.2   winget

I have PowerShell 7.4-preview2 installed but winget doesn't seem to understand that. My guess is winget is confused by remnants of a previous update via Windows Update. I mistakenly enabled the Update via Windows Updates bits only to find out Windows Update updates PowerShell via a 32bit setup.exe instead of a .msi file. Thoughts?

mdanish-kh commented 1 year ago

@gwojan The PowerShell Preview issue is different and being tracked in

tomfranken commented 1 year ago

Same issue:

image

But from VS Code:

image

Solved it. Changed my shortcut to "C:\Program Files\PowerShell\7\pwsh.exe"

microsoft-github-policy-service[bot] commented 1 year ago

@pleabargain this issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

pleabargain commented 1 year ago

Winget apparently can't even get to the other installs due to c++ bug interfering!

image

pleabargain commented 1 year ago

Still show that PS needs to upgrade. image

here's the output for winget list powershell

image

I can't seem to uninstall the old powershell either: image

mdanish-kh commented 1 year ago

@pleabargain Looks like you have two versions of PowerShell installed side-by-side and WinGet still has some work to do on how to handle those properly (https://github.com/microsoft/winget-cli/issues/2129). For now, you'll have to manually uninstall PowerShell 7.3.2.0-x64 from appwiz.cpl (or Apps&Features)

Trenly commented 1 year ago

[Policy] Side-By-Side

denelon commented 6 months ago

We've been working on the side-by-side scenarios. You could try the latest release and enable the experimental feature on:

Please provide feedback at:

denelon commented 3 months ago

WinGet 1.8 now has better support for side-by-side packages. Is this problem still happening?

microsoft-github-policy-service[bot] commented 2 months ago

Hello @pleabargain,

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

Template: msftbot/noRecentActivity