msix-packaging icon indicating copy to clipboard operation
msix-packaging copied to clipboard

Fix inconsistent zip structure in .appx files created by makemsix.exe

Open st-gr opened this issue 1 year ago • 0 comments

This commit resolves issue #619 by ensuring that the central directory in .appx files created by makemsix.exe is sorted in the same order as MakeAppx.exe. The fix involves tracking the sequence of file names during the creation of the zip file and sorting the central directory entries accordingly before writing them to the stream.

  • Add a vector to track the sequence of file names in ZipObjectWriter.
  • Sort central directory entries based on the tracked file name sequence before writing them to the zip file.

Resolves: #619

This was tested building via makewin.cmd x64 --debug --pack. The following files test_makemsix.zip

were packed with: .vs\bin\makemsix pack -d C:\test_makemsix -p C:\test_makemsix_sorted.appx

The side-by-side zipdump and 7-zip properties show that the central directory is now in the same sequence as the local file header streams in the zip archive. image

st-gr avatar Mar 09 '24 08:03 st-gr