I'm trying to understand the relationship between the blocks defined in the AppxBlockMap.xml
file of an MSIX package and the compression process, specifically the Deflate algorithm used in ZIP-based formats. The official MSIX documentation suggests that blocks in AppxBlockMap.xml
correspond to 64 KB chunks of uncompressed data, which are used for differential updates and integrity checks. However, when examining a real AppxBlockMap.xml
file (shown below), I notice that the <Block>
elements have variable Size
attributes that don’t align with the 64 KB standard and seem to reflect compressed sizes instead.
Here’s an excerpt of an actual AppxBlockMap.xml
file from an MSIX package:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<BlockMap xmlns="; HashMethod=";>
<File Name="Registry.dat" Size="8192" LfhSize="42">
<Block Hash="SujdWPx0WfMpCDMB6Ys6qrkz7utejAXDDWUE8gY/+OI=" Size="370"/>
</File>
<File Name="ConsoleApp2\ConsoleApp2.exe" Size="4608" LfhSize="57">
<Block Hash="odjuNrwIpr3INWyUyzc0U5er4vFA0s+YtTT0qUW0khM=" Size="1955"/>
</File>
<File Name="PsfLauncher32.exe" Size="419704" LfhSize="47">
<Block Hash="7nY/HTgnGs/L1e33p//FCMYqiIJvg6NqVoR771Nqm6M=" Size="33031"/>
<Block Hash="z0UFVqT3NtYzK3U3G1T0oJLSW/GME2DxUYyxPCtLB5w=" Size="40610"/>
<Block Hash="u97F08AaEkjfUIEnanZC+19NHwFcFTL37II5WQzXvxQ=" Size="39077"/>
<!-- More blocks omitted for brevity -->
</File>
<!-- More files omitted for brevity -->
</BlockMap>
In this example:
- The
Size
attribute of<File>
(e.g., 8192 forRegistry.dat
) represents the uncompressed size of the file. - The
Size
attribute of<Block>
(e.g., 370 forRegistry.dat
) varies widely and is much smaller than 64 KB, suggesting it might be the compressed size of each block.
This leads me to believe that the <Block>
sizes in AppxBlockMap.xml
could be directly tied to the variable-sized blocks generated by the Deflate algorithm during ZIP compression, rather than fixed 64 KB chunks of uncompressed data. However, this seems to contradict the idea that the hashes are computed over 64 KB uncompressed blocks.
My question is:
Are the <Block>
elements in AppxBlockMap.xml
directly related to the compressed blocks produced by the Deflate algorithm, or do they represent something else (e.g., fixed-size uncompressed chunks)? If they are compressed sizes, how does this align with the MSIX documentation’s mention of 64 KB blocks for hashing and differential updates?
I’d appreciate insights from anyone familiar with MSIX internals or ZIP/Deflate compression. Thanks!