Files
Xus BadiaandClaude Opus 5.5 15c35620c4 macOS DMG: branded window background and icon layout
The DMG opened as a plain Finder window. It now shows the app icon's figure on
the CADCraft colour, with CADCraft.app and the Applications link side by side.
Same approach as PhotoCraft's and VectorCraft's (storytold/photocraft#1201,
storytold/vectorcraft#493).

- packaging/macos/dmg/: background.svg (source; text outlined, no paper grain,
  the figure an <image> of assets/app-icon), background.tiff (1x + 2x HiDPI,
  16-colour palette, Deflate, sRGB; ~21 KB)
  and dmg-layout.DS_Store (Finder view settings: window, icon size 128,
  positions, background).
- generate.py writes the TIFF and the layout on any OS, byte-for-byte
  reproducible, with nothing from the machine that ran it (no paths, users,
  disk names or volume UUIDs).
- package.sh copies them into the staging folder; the image is still built with
  hdiutil makehybrid. Nothing extra runs in the signing job.
- The volume name drops the version: the layout finds the background through
  an alias that includes the volume name. The DMG file name keeps the version.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 07:43:54 +02:00
..

macOS DMG window

What Finder shows when the DMG opens: a 660 × 400 pt background with the app icon and the Applications link side by side. package.sh copies these files into the image; nothing here is generated at build time, so the DMG still builds with hdiutil makehybrid (no mounted device, no Finder scripting on CI, nothing extra installed in the signing job).

File What
background.svg Source of the background: the app icon (assets/app-icon/cadcraft-1024.png, linked, not copied) cropped as a cover on the CADCraft colour field (#14a3c7), Ink and Paper. Its text (Inter, JetBrains Mono) is outlined, so rendering it needs no fonts. No paper grain: noise doesn't compress, and this keeps background.tiff small.
background.tiff The background at 1x (660 × 400 px, 72 dpi) and 2x (1320 × 800 px, 144 dpi) in one HiDPI TIFF (16-colour palette, Deflate, sRGB). Goes to .background/background.tiff.
dmg-layout.DS_Store Finder's view settings for the volume: window size, icon size 128, CADCraft.app at (326, 205), Applications at (574, 205), and the background. Goes to .DS_Store in the image; named so it isn't mistaken for (or ignored like) a Finder-generated .DS_Store.
generate.py Writes background.tiff and dmg-layout.DS_Store from the SVG and the layout above.

The volume name has no version

The mounted volume is called CADCraft, not CADCraft <version>. The layout points at the background through an alias that includes the volume name, and Finder resolves it by that name: with a versioned name the window keeps its size and icon positions but shows no background (tested). The DMG file name (cadcraft-<version>-macos-<arch>.dmg) still carries the version.

Rules

  • Finder draws the icon labels in black in light and dark mode when a window has a background, so the area under both icons stays light (Paper).
  • Nothing goes inside the icon boxes: artwork keeps 10 pt clear of each 128 pt icon box and of the label strip under it.

Regenerate

Edit background.svg (or the layout constants in generate.py), then run, on any OS:

pip install 'pillow>=12' ds_store==1.3.3 mac_alias==2.2.3
python3 packaging/macos/dmg/generate.py   # needs resvg on PATH

Both outputs are byte-for-byte reproducible and carry nothing from the machine that ran it: the SVG renders without any fonts, and dmg-layout.DS_Store is written from scratch, its background alias holding only the volume name and /.background/background.tiff. If you add text to the SVG, outline it (usvg from resvg converts text to paths). The window is 660 × 432 with Finder's 32 pt title bar; the content area is 660 × 400.

This follows VectorCraft's packaging/macos/dmg/ (storytold/vectorcraft#493).