microsoft / winget-create

The Windows Package Manager Manifest Creator command-line tool (aka wingetcreate)
MIT License
477 stars 82 forks source link

The number of new installer packages must match the number of existing installer packages. #464

Closed EdijsPerkums closed 8 months ago

EdijsPerkums commented 8 months ago

Brief description of your issue

I am trying to update an existing package with a new version with this command: wingetcreate.exe update --submit --urls https://www.masterpackager.com/installer/dev/masterpackagerdev_1.0.6.msi https://www.masterpackager.com/uploads/file_archive/mpdev_self_contained_Arm64_1.0.6.msi --version 1.0.6 MasterPackager.MasterPackagerDev

And I receive the following error: Retrieving latest manifest for MasterPackager.MasterPackagerDev Downloading and parsing: https://www.masterpackager.com/installer/dev/masterpackagerdev_1.0.6.msi... Downloading and parsing: https://www.masterpackager.com/uploads/file_archive/mpdev_self_contained_Arm64_1.0.6.msi... The number of new installer packages must match the number of existing installer packages.

Here is the previous manifest - https://github.com/microsoft/winget-pkgs/blob/master/manifests/m/MasterPackager/MasterPackagerDev/1.0.5/MasterPackager.MasterPackagerDev.installer.yaml As you can see it has 2 installer packages and the error message is incorrect.

Steps to reproduce

wingetcreate.exe update --submit --urls https://www.masterpackager.com/installer/dev/masterpackagerdev_1.0.6.msi https://www.masterpackager.com/uploads/file_archive/mpdev_self_contained_Arm64_1.0.6.msi --version 1.0.6 MasterPackager.MasterPackagerDev

Expected behavior

It should create a pull request with a new manifest for the new version.

Actual behavior

I receive this error message - The number of new installer packages must match the number of existing installer packages.

Environment

wingetcreate --help
Windows Package Manager Manifest Creator v1.5.5.0

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

Windows: Windows.Desktop v10.0.19045.3570
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.2771.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                D:\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                        Enabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
mdanish-kh commented 8 months ago

This is because there isn't a valid file returned from the URL: https://masterpackager.com/uploads/file_archive/mpdev_self_contained_Arm64_1.0.6.msi. Winget-create fails to parse the downloaded response since it's not a valid MSI file.

The error message definitely needs to be improved though to show that it's a parsing error not a user error

EdijsPerkums commented 8 months ago

@mdanish-kh Hello, could you provide some more details what is not valid in that file? Also the link you posted will not work without www in front. The link provided in the command downloads a valid msi - https://www.masterpackager.com/uploads/file_archive/mpdev_self_contained_Arm64_1.0.6.msi

mdanish-kh commented 8 months ago

@EdijsPerkums - That link doesn't seem to be working for me

https://github.com/microsoft/winget-create/assets/88161975/30cc928f-e2d8-42c1-9f07-5c34f40a4f9a

EdijsPerkums commented 8 months ago

@mdanish-kh sorry you are right, there was an issue with some capital letters. I wasn't aware that urls are case sensitive. Anyway it would be great if that error message could be made a bit less confusing. Should I close this issue?

mdanish-kh commented 8 months ago

@EdijsPerkums No worries ☺️ I'll link this issue to the PR I made fixing the error message. This will automatically close out when that gets merged