Electron-builder: What is the purpose of blockmap file?

Created on 1 May 2018  路  6Comments  路  Source: electron-userland/electron-builder


  • Version: 20.10.0

  • Target: NSIS


I recently switched to NSIS based installer for my electron application. It works great! When I build the installer, one of the artifacts created is a blockmap file (MyApplicationName.exe.blockmap). I am curious to know the purpose served by this file. I would appreciate if someone can explain this. I searched for nsis blockmap but couldn't find anything that would explain this.

nsis question

Most helpful comment

A quick web search:

The package block map file is an XML document that contains a list of the app鈥檚 files along with indexes and cryptographic hashes for each block of data that is stored in the package.

Taken from App Package Blockmap for Universal Windows Platform (UWP) Apps

If you use automatic updates, I believe the blockmap file is used for partial / differential updates to your application, to shrink the update payload size.

All 6 comments

A quick web search:

The package block map file is an XML document that contains a list of the app鈥檚 files along with indexes and cryptographic hashes for each block of data that is stored in the package.

Taken from App Package Blockmap for Universal Windows Platform (UWP) Apps

If you use automatic updates, I believe the blockmap file is used for partial / differential updates to your application, to shrink the update payload size.

Thanks @gknapp. I don't think it's an XML document. In my case it is a binary file.

This file is used for delta updates (#2217).

In my case it is a binary file.

it is gzipped json.

@develar Are blockmap updates currently being used for macOS and Windows? Do I have to do anything special to enable it?

How are these blockmaps integrated with signing though. Since signing creates a new .exe. Will the blockmap become invalid ?

@develar, the JSON contans an array of base64 encoded strings and an array of ints. I assume the ints are the size of the block being referenced and that the base64 is some type of block hash. But the base64 is 24 base64 chars long which would decode to 18 bytes. An md5 hash is 16 bytes, and a sha1 hash is 20 bytes.

So if it is a hash, what hash algorithm does it use?

Edit: corrected mention of @develar

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jhg picture jhg  路  3Comments

alexstrat picture alexstrat  路  3Comments

omarkilani picture omarkilani  路  3Comments

iklemm picture iklemm  路  3Comments

AidanNichol picture AidanNichol  路  3Comments