-
Notifications
You must be signed in to change notification settings - Fork 100
Description
Brief description of your issue
When an MSIXBundle or a ZIP contains multiple installers, wingetcreate is unable to update it and fails with The number of installers must match existing installers. This is because in the following code snippet:
| int numOfNewInstallers = installerMetadataList.Sum(x => x.NewInstallers.Count); |
numOfNewInstallers will include all the nested installers inside the msixbundle / ZIP and the condition if (numOfNewInstallers != existingInstallers.Count) will return true throwing the exception with the above quoted message.
Logic needs to be added to match only a single suitable installer from msix / ZIP.
Steps to reproduce
Try to update packages with msixbundles, zip that contain multiple installers within. Examples listed below:
Using an arbitrary version and old urls to simulate an update scenario
1. Microsoft.WingetCreate
(Resolved, see comment below)
2. Microsoft.WindowsTerminal
(Resolved, see comment below)
- Microsoft.Sysinternals.ZoomIt
wingetcreate update Microsoft.Sysinternals.ZoomIt --version 15.0 --urls "https://download.sysinternals.com/files/ZoomIt.zip|x64" "https://download.sysinternals.com/files/ZoomIt.zip|x86" "https://download.sysinternals.com/files/ZoomIt.zip|arm64"- orhun.git-cliff
wingetcreate update orhun.git-cliff --version 2.3.6 --urls "https://github.com/orhun/git-cliff/releases/download/v2.1.1/git-cliff-2.1.1-i686-pc-windows-msvc.zip" "https://github.com/orhun/git-cliff/releases/download/v2.1.1/git-cliff-2.1.1-aarch64-pc-windows-msvc.zip" "https://github.com/orhun/git-cliff/releases/download/v2.1.1/git-cliff-2.1.1-x86_64-pc-windows-msvc.zip"
- sirredbeard.wslinternals
wingetcreate update sirredbeard.wslinternals --version 0.0.15 --urls "https://github.com/sirredbeard/wslinternals/releases/download/0.0.14/0.0.14.zip|x86"
- Google.PlatformTools
wingetcreate update Google.PlatformTools -v 35.0.1 --urls "https://dl.google.com/android/repository/platform-tools-latest-windows.zip"
- Oven-sh.Bun
wingetcreate update Oven-sh.Bun --version 1.1.1 --urls https://github.com/oven-sh/bun/releases/download/bun-v1.1.1/bun-windows-x64.zip
This also occurs in interactive update scenarios.
Expected behavior
Package updates successfully as number of URLs matches the number of installer nodes in the manifest
Actual behavior
wingetcreate fails with:
The number of new installer packages must match the number of existing installer packages.
Environment
Windows Package Manager Manifest Creator v1.2.6.0