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 install with --include-unknown #3578

Closed
sirinath opened this issue Sep 1, 2023 · 2 comments · Fixed by #3752
Closed

winget install with --include-unknown #3578

sirinath opened this issue Sep 1, 2023 · 2 comments · Fixed by #3752
Labels
Command-Install Issue related to WinGet Install In-PR Issue related to a PR Issue-Bug It either shouldn't be doing this or needs an investigation.
Milestone

Comments

@sirinath
Copy link

sirinath commented Sep 1, 2023

Brief description of your issue

--include-unknown should be a valid command to be used with install.

If already installed it should upgrade.

Steps to reproduce

winget install --ID <*> --include-unknown

Expected behavior

If there is a package which is installed with unknow version upgrade it.

Actual behavior

Does not work

Environment

winget --info
Windows Package Manager v1.5.2201
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22621.2215
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.20.2201.0

Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages

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

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Enabled
LocalArchiveMalwareScanOverride           Disabled
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Sep 1, 2023
@stephengillie stephengillie added Issue-Feature This is a feature request for the Windows Package Manager client. and removed Needs-Triage Issue need to be triaged labels Sep 1, 2023
@stephengillie
Copy link

My independent opinion is that the Install and upgrade commands should be idempotent and error on fail, such as if there's no valid action, instead of performing another command on fail. As the latter would be less predictable.

But @denelon would have better advice here.

@Trenly
Copy link
Contributor

Trenly commented Sep 2, 2023

@stephengillie - This should probably be Issue-Bug.

The install command switches to the upgrade flow if it detects the package is already installed, and when the version is unknown gives the message shown below. But, as @sirinath pointed out, the install command doesn’t accept the --include-unknown argument.

PS D:\Git\winget-pkgs> winget list windirstat
Name             Id                    Version Available
--------------------------------------------------------
WinDirStat 1.1.2 WinDirStat.WinDirStat Unknown 1.1.2    
PS D:\Git\winget-pkgs> winget install windirstat
Found an existing package already installed. Trying to upgrade the installed package...
This package's version number cannot be determined. To upgrade it anyway, add the argument --include-unknown to your previous command.

Using --force will cause the command to stay in the install flow and not switch to the upgrade flow, and may work as a workaround for this issue, but doesn’t address the errant behavior. And using --no-upgrade simply causes the install flow to terminate if the package is already installed

@stephengillie stephengillie 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 Sep 5, 2023
@denelon denelon added the Command-Install Issue related to WinGet Install label Sep 8, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR Issue related to a PR label Oct 11, 2023
@denelon denelon added this to the v1.7 Client milestone Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Command-Install Issue related to WinGet Install In-PR Issue related to a PR Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants