winget-create
winget-create copied to clipboard
Improve matching for ZIP with multiple nested installers
- [x] Have you signed the Contributor License Agreement?
- [x] Are you working against an Issue?
- Resolves #392
Change
This PR adds support for handling multiple nested installers inside of a ZIP archive for the autonomous update mode. With the current behavior of parsing every nested installer, it can lead to generation of duplicate "installer" nodes for each nested installer. This change clears out the duplicates and subsequently only retains the nested installers that are present in the matching installer node from previous manifest.
Tests
Added unit test to verify the behavior and updated an existing test for better coverage. The new files i.e., WingetCreateTestPortable.exe
, WingetCreateTestPortable2.exe
are created by making a copy of the existing WingetCreateTestExeInstaller.exe
I also updated the issue body to add more examples from the community repo for manual validation.
Edge case
There's still an unhandled edge case if the manifest contains msixbundle as a NestedInstallerFile. But this is extremely rare, and the current change should cover the vast majority of cases. In fact, I performed a search in the community repo and could only find two packages with NestedInstallerType: msix (and one of them being devhome with its first ever release, so we can safely discard that too). Even if the user encounters this case, the package is still upgrade-able through the interactive mode
Microsoft Reviewers: Open in CodeFlow
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
Hmm.. I could've swore all tests passed locally last time I ran them. I'll take a look
@ryfu-msft Would you be able to kick off a re-run please?
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
Thanks @mdanish-kh! Apologies for the long delay on this 😓
No worries at all!