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

Improve matching for ZIP with multiple nested installers

Open mdanish-kh opened this issue 10 months ago • 2 comments

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

mdanish-kh avatar Mar 31 '24 01:03 mdanish-kh

/azp run

ryfu-msft avatar Jul 03 '24 20:07 ryfu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jul 03 '24 20:07 azure-pipelines[bot]

/azp run

ryfu-msft avatar Jul 30 '24 14:07 ryfu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jul 30 '24 14:07 azure-pipelines[bot]

Hmm.. I could've swore all tests passed locally last time I ran them. I'll take a look

mdanish-kh avatar Jul 30 '24 16:07 mdanish-kh

@ryfu-msft Would you be able to kick off a re-run please?

mdanish-kh avatar Jul 30 '24 18:07 mdanish-kh

/azp run

ryfu-msft avatar Jul 30 '24 19:07 ryfu-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jul 30 '24 19:07 azure-pipelines[bot]

Thanks @mdanish-kh! Apologies for the long delay on this 😓

ryfu-msft avatar Jul 30 '24 19:07 ryfu-msft

No worries at all!

mdanish-kh avatar Jul 30 '24 19:07 mdanish-kh