Skip to content

Ship a styled drag-to-install dmg, and build it on every PR - #11

Merged
jay739 merged 2 commits into
mainfrom
feat/styled-dmg
Oct 22, 2026
Merged

jay739 merged 2 commits into
mainfrom
feat/styled-dmg

Conversation

@jay739

@jay739 jay739 commented Oct 22, 2026

Copy link
Copy Markdown
Owner

What

  • macos/package-dmg.sh packages build/OpenHaze.app with dmgbuild. Opening the image shows the app on the left and Applications on the right, with the .app extension hidden and the app icon as the disk icon.
  • macos/Support/makedmgbackground.swift draws the window background at 1x and 2x in the icon's palette, so no image is committed. Haze on the left clears into the cream of the focused window, a warm glow sits behind Applications, and the arrow's haze particles come into focus on the way there.
  • release.yml uses the script instead of a bare hdiutil create, and CI's macos job runs it as a dry run on every PR, the same way the Windows job already builds the installer.

Why

The release dmg had no layout, so it opened as a plain Finder window. dmgbuild writes the layout straight into the image's .DS_Store, so it never has to script Finder.

How it was tested

  • Built and packaged on a Mac Mini (macOS 27.2, Homebrew Python 3.14). The image contains the layout, a two-resolution background (640x360 and 1280x720), the Applications link, the hidden-extension flag and an app with a valid ad-hoc signature. Opened in Finder and checked by eye.
  • Packaging ran twice in a row to cover the venv being rebuilt with --clear.
  • dmgbuild 1.6.7, ds_store 1.3.3 and mac_alias 2.2.3 are pinned. They need Python 3.10 or newer, and the script says so if it is missing.
  • This PR's macos job runs the dry run on the hosted runner.

On macOS 27, hdiutil prints deprecation warnings in favour of diskutil image. dmgbuild still calls hdiutil, as the old release step did, and the image builds fine.

The release dmg was a plain hdiutil image. package-dmg.sh now builds it with
dmgbuild, which writes the Finder layout straight into the image: a window with
the app on the left, Applications on the right, a hidden .app extension and the
app icon as the disk icon.

Support/makedmgbackground.swift draws the window background at 1x and 2x in
the icon's palette, so nothing binary is committed: haze on the left clearing
to the cream of the focused window, a warm glow behind Applications, and an
arrow whose haze particles come into focus on the way there.

release.yml uses the script, and the CI macos job runs it as a dry run on every
PR, like the Windows installer. dmgbuild and its dependencies are pinned and
run from a venv that is rebuilt each time.
CI's macos job failed with "DMG<byte>: unbound variable". Apple's bash 3.2 runs
in a Latin-1 locale on the hosted runner, where the first byte of the "…" after
$DMG reads as a letter and becomes part of the variable name. ${DMG} ends the
name explicitly.
@jay739
jay739 merged commit 58d498d into main Oct 22, 2026
3 checks passed
@jay739
jay739 deleted the feat/styled-dmg branch October 22, 2026 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant