winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Winget unable to install firefox when version number is specified

Open metamoof opened this issue 1 year ago • 4 comments

Brief description of your issue

Winget search currently shows the Mozilla.Firefox package at version 131

❯ winget.exe search mozilla.firefox
Name                              Id                               Version Source
----------------------------------------------------------------------------------
Mozilla Firefox                   Mozilla.Firefox                  131     winget

When attempting to install with that version number, I get an error:

❯ winget.exe install --id "Mozilla.Firefox" --exact --source winget --accept-source-agreements --version "131" --silent --disable-interactivity --accept-package-agreements
No version found matching: 131

However, if the version number is left off, I see:

❯ winget.exe install --id "Mozilla.Firefox" --exact --source winget --accept-source-agreements  --accept-package-agreements
Found Mozilla Firefox [Mozilla.Firefox] Version 131.0
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-installer.cdn.mozilla.net/pub/firefox/releases/131.0/win64/en-GB/Firefox%20Setup%20131.0.exe

And if I attempt to then install specifying "131.0" as the version number, it does work:

❯ winget.exe install --id "Mozilla.Firefox" --exact --source winget --accept-source-agreements --version "131.0" --accept-package-agreements
Found Mozilla Firefox [Mozilla.Firefox] Version 131.0
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-installer.cdn.mozilla.net/pub/firefox/releases/131.0/win64/en-GB/Firefox%20Setup%20131.0.exe
  ██████████████████████████████  63.5 MB / 63.5 MB
Successfully verified installer hash
Starting package install...
Successfully installed

Steps to reproduce

winget.exe search Mozilla.Firefox winget.exe install --id "Mozilla.Firefox" --version "131" winget.exe install --id "Mozilla.Firefox" --version "131.0"

Expected behavior

I expect Winget to be able to install Mozilla Firefox when specifying the version number that is shown in winget search

Actual behavior

Winget is not able to install Mozilla Firefox if the version number shown with winget search is specified, however, a more precise version number works

Environment

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

Windows: Windows.Desktop v10.0.22631.4249 System Architecture: X64 Package: Microsoft.DesktopAppInstaller v1.23.1911.0

Winget Directories

Logs %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag… User Settings %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett… 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 Installer Downloads %USERPROFILE%\Downloads

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 Disabled LocalArchiveMalwareScanOverride Disabled ProxyCommandLineOptions Disabled DefaultProxy Disabled

metamoof avatar Oct 09 '24 11:10 metamoof

It looks like the version is "131.0". There is no exact version "131" from my search results.

You can add "--versions" to see available versions.

denelon avatar Oct 09 '24 15:10 denelon

I do see that the trailing 0 isn't rendered so that's the bug in my mind.

Would you agree with that?

denelon avatar Oct 09 '24 15:10 denelon

Yes, that is the bug. I note that whatever pipe UniGetUI is using also sees 131 rather than 131.0

Giles Antonio Radford 🌐 https://metamoof.net/ 🐘 @.@.>


metamoof avatar Oct 09 '24 15:10 metamoof

@denelon - I recall a separate issue specific to the V2 index dropping trailing zero's if the version only had two parts, let me find that, as it's the root cause of this and the other bug

Edit: https://github.com/microsoft/winget-pkgs/issues/163299

Trenly avatar Oct 10 '24 01:10 Trenly