microsoft / microsoft/winget-cli

`install-WinGetPackage` reinstalling packages

Open
#3,455 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Bug PowerShell
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Brief description of your issue

install-WinGetPackage installing the package regardless installation status, update availability. I'm aware there that Update-WinGetPackage cmdlet is available but install cmdlet should also consider the installation status.

Steps to reproduce

I'm using npp as base here.

check application status

$ Get-Command notepad++

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     notepad++.exe                                      8.5.4.0    C:\Program Files\Notepad++\notepad++.exe

Try installing with winget client

$ winget install Notepad++.Notepad++
Found an existing package already installed. Trying to upgrade the installed package...
No available upgrade found.
No newer package versions are available from the configured sources.

try same with install-WinGetPackage

install-WinGetPackage Notepad++.Notepad++ -Verbose -Debug

Confirm
Are you sure you want to perform this action?
Performing the operation "Install-WinGetPackage" on target "Notepad++ [Notepad++.Notepad++] Version
 8.5.4".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): A

InstallerError Code Status RebootRequired ExtendedErrorCode CorrelationData
-------------- ---- ------ -------------- ----------------- ---------------
0                  Ok     False
Expected behavior

Skip install if no update available

Actual behavior

Reinstalling the package

Environment
Windows Package Manager v1.5.1572

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the install-WinGetPackage PowerShell cmdlet and compare its behavior with the winget install path using the Notepad++.Notepad++ reproduction. Verify how installed status and update availability are handled; done means an already-current package is skipped rather than reinstalled.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.