Our installer window is 540 by 380 points, and nobody in our repository chose that, or the background, or where the icon sits
notifio.app/download hands a Mac visitor a 291 MB file called notifio-arm64.dmg. I spent a post yesterday on the 639 files inside the app bundle and never looked at the container around it. The container is more interesting than I expected, because a DMG is not an archive. It is a filesystem image w

ith a Finder window saved inside it, and that window is the first screen a new user of Notifio ever sees. Our package.json has a build block with win, mac and nsis keys in it. There is no dmg key. So every pixel of that first screen was chosen by electron-builder, and this post is me finding out what it chose.
$ hdiutil attach -readonly -nobrowse notifio-arm64.dmg /dev/disk4s1 Apple_HFS /Volumes/Notifio 1.1.0-arm64 $ ls -la "/Volumes/Notifio 1.1.0-arm64" -rw-r--r--@ 1 daniel staff 16388 Sep 22 14:23 .DS_Store -rw-r--r--@ 1 daniel staff 33733 Sep 22 14:23 .VolumeIcon.icns -rw-r--r--@ 1 daniel staff 37298 Sep 22 14:23 .background.tiff lrwxr-xr-x@ 1 daniel staff 13 Sep 22 14:23 Applications -> /Applications drwxr-xr-x@ 3 daniel staff 102 Sep 22 14:23 Notifio.app Two things a user can see, three they cannot, and the three they cannot are the entire user interface of the install. The volume name is Notifio 1.1.0-arm64, assembled from productName, the version and the architecture. It is also, as far as a reader is concerned, the window title. Nothing in our repository says those three fields should be joined by a space and a hyphen in that order.
And the volume is full: $ df -k "/Volumes/Notifio 1.1.0-arm64" Filesystem 1024-blocks Used Available Capacity iused /dev/disk4s1 663952 661136 2816 100% 1304 2,816 KB free out of 663,952, because the image is sized to its payload rather than to a round number. 1,304 inodes in use, and the bundle accounts for 1,298 of them: 639 files, 640 directories and 19 symlinks. The other six are three hidden files, one symlink and the volume root. $ shasum -a 256 "/Volumes/Notifio 1.1.0-arm64/.background.tiff" d1891642fc74685997e4a7e67054dee019178f2f4bfd7e5aa1d98e4b374e741a $ shasum -a 256 node_modules/.pnpm/dmg-builder@26.15.3*/node_modules/dmg-builder/templates/background.tiff d1891642fc74685997e4a7e67054dee019178f2f4bfd7e5aa1d98e4b374e741a Same hash.
The artwork behind our two icons is the stock template that ships inside dmg-builder, copied in unmodified because we never named one of our own. The volume icon is ours, sort of. .VolumeIcon.icns is 33,733 bytes and matches release/.icon-icns/icon.icns exactly, which electron-builder generated during the build from the single 8,818-byte assets/icon.png that already had five other jobs. So the icon on the mounted disk is a sixth derivative of one small PNG.
.DS_Store is normally a thing you delete from git repositories. Inside a DMG it is load-bearing: it is where Finder stores the window geometry and the icon coordinates, and it is why dragging an app to an Applications folder works as an instruction without a single word of text. The format is a buddy-allocated B-tree with binary plists embedded in it, and the two records that matter are findable by name: import re, plistlib d = open('.DS_Store', 'rb').read() m = re.search(rb'bwspblob', d) # window state length = int.from_bytes(d[m.end():m.end()+4], 'big') print(plistlib.loads(d[m.end()+4 : m.end()+4+length])) {'ContainerShowSidebar': False, 'PreviewPaneVisibility': False, 'ShowPathbar': False, 'ShowSidebar': False, 'ShowStatusBar': False, 'ShowTabView': False, 'ShowToolbar': False, 'SidebarWidth': 180, 'WindowBounds': '{{400, 530}, {540, 380}}'} A 540 by 380 point window at (400, 530), with the toolbar, sidebar, path bar, status bar and tab bar all switched off. The sidebar is hidden and its width is still recorded as 180.
The icvp record holds the icon view settings: {'arrangeBy': 'none', 'iconSize': 80.0, 'gridSpacing': 100.0, 'textSize': 12.0, 'labelOnBottom': True, 'showItemInfo': False, 'showIconPreview': False, 'backgroundType': 2, 'backgroundColorRed': 1.0, 'backgroundColorGreen': 1.0, 'backgroundColorBlue': 1.0, 'backgroundImageAlias': b'\x00\x00\x00\x00\x01z\x00\x02\x00\x00\x13Notifio 1.1.0-arm64...'} 80 point icons, 12 point labels, and backgroundType: 2 meaning "use an image". The alias blob is a classic Carbon-era path record, and it names both the volume and the file twice, once in MacRoman and once in UTF-16, inside a structure that also carries a white fallback colour for the case where the image cannot be found. The icon positions are not in a plist at all. They are Iloc records, sixteen bytes each, and the coordinates are plain big-endian integers: Iloc payload 626c6f62 00000010 0000019a 000000dc -> blob, len 16, x=410, y=220 Iloc payload 626c6f62 00000010 00000082 000000dc -> blob, len 16, x=130, y=220 So the app sits at (130, 220) and the Applications folder at (410, 220), 280 points apart on the same baseline, inside a 540 by 380 window.
That is the drag gesture, expressed as four numbers in a file that is usually noise. None of those four numbers appear anywhere in our source tree. If I ever want to put our own artwork behind them, the dmg block in electron-builder config is where the window size, the background and both icon positions go, and the thing to know is that they are all already set, just not by me. $ hdiutil imageinfo notifio-arm64.dmg Format Description: UDIF read-only compressed (zlib) Checksum Type: CRC32 Total Bytes: 679924736 Total Non-Empty Bytes: 677558272 Total Empty Bytes: 2366464 Compressed Bytes: 291463980 Compressed Ratio: 0.43016769486064216 Partition Information: GPT Header, Primary GPT Table, disk image (Apple_HFS), (Apple_Free), Backup GPT Table zlib rather than the newer lzfse, CRC32 rather than a cryptographic hash, and HFS+ rather than APFS.
Those are electron-builder's defaults and I am happy to keep them, because an APFS image needs a newer macOS to mount than an HFS+ one does, and a DMG that refuses to open on somebody's old laptop is a support email rather than an install. There is also no licence agreement screen, because we never supplied one. The whole thing is a read-only volume with a saved window in it. Each build also writes a blockmap: $ ls -la release/*.blockmap -rw-r--r--@ 1 daniel staff 308555 Sep 22 14:24 notifio-arm64.dmg.blockmap -rw-r--r--@ 1 daniel staff 319935 Sep 22 14:24 notifio-x64.dmg.blockmap It is gzipped JSON, and it describes the DMG as a sequence of content-defined chunks: import gzip, json d = json.loads(gzip.decompress(open('notifio-arm64.dmg.blockmap', 'rb').read())) f = d['files'][0] len(f['sizes']), sum(f['sizes']), min(f['sizes']), max(f['sizes']) Build Blocks Bytes described Min block Mean block Max block arm64 14,003 291,511,009 8,192 20,817 32,768 x64 14,528 301,712,899 8,192 20,767 32,768 14,003 chunks with a checksum each, so that electron-updater can download a new release by fetching only the blocks that changed.
The index costs 0.11 per cent of the download it describes, which is a genuinely good trade for anyone using it. We are not using it. Notifio has no auto-update: a new version means visiting the download page again, and the previous post in this series found that the matching Squirrel.Mac frameworks ship inside the app too. So every build produces a differential-download index for a differential download that will never be requested.
And it does not even get as far as being available: our release script names the files it uploads one by one, { file: 'notifio-arm64.dmg', contentType: 'application/x-apple-diskimage' }, { file: 'notifio-x64.dmg', contentType: 'application/x-apple-diskimage' }, and the blockmaps are not on that list. They are written to release/, they stay on my laptop, and nothing has ever read one. I am leaving the generation alone, because it costs nothing and an explicit upload list is the behaviour I want. But it is worth saying plainly: a blockmap that never leaves the build machine is not an update mechanism, and if re-downloading 291 MB ever stops being an acceptable update story, the index for the version people are already running is the thing I will wish I had published alongside it.
If you ship an Electron app on macOS, two commands tell you what your users see before they see your app: hdiutil attach -readonly -nobrowse your.dmg && ls -la /Volumes/Your* python3 -c "import re,plistlib;d=open('/Volumes/Your*/.DS_Store','rb').read();m=re.search(rb'bwspblob',d);print(plistlib.loads(d[m.end()+4:m.end()+4+int.from_bytes(d[m.end():m.end()+4],'big')]))" If the second one prints a window you never chose, you are in the same position I was in an hour ago. Notifio is at notifio.app, the installers are on the download page, and the licence that unlocks them is a one-off payment.
Key Takeaways
- β’Our package.json has a build block with win, mac and nsis keys in it.
- β’This story was reported by Dev.to, covering developments in the dev space.
- β’AI advancements continue to reshape industries β read the full article on Dev.to for complete coverage.
π Continue reading the full article:
Read Full Article on Dev.to βShare this article



