Repository navigation
feat(desktop): add a custom macOS DMG background - #61428
opencode-agent[bot] wants to merge 1 commit into
Conversation
The build job packs the disk image layout (background, icon positions and volume icon) around an empty app folder, and sign-desktop-macos.sh puts the stapled app in its place instead of making a plain hdiutil image.
There was a problem hiding this comment.
This looks sound, but I couldn't verify it here: building the layout and putting the app into it both need macOS (electron-builder's dmg target, hdiutil, ditto). The config test passes and tsc -b is clean. I also read electron-builder 26.15.7 to check the packing step: with --prepackaged pointing at the empty placeholder .app, it uses that folder as the app, doesn't sign the dmg, and keeps the opencode-desktop-mac-<arch>.dmg name that pack.ts copies. The layout image travels only in build-desktop-darwin-*, which publish-github-release.sh doesn't download, so it won't end up attached to releases. Before merging, please confirm that the release-dry-run sign step produced a DMG that opens to the new layout (a screenshot of the mounted window would help).
Public API: unchanged. These are only build and release internals; the DMG names and locations stay the same.
No blocking concerns.
The macOS DMG now opens to a branded window instead of Finder's default: a light background with the wordmark and a drag arrow, the app on the left,
Applicationson the right, and the channel icon as the volume icon.How
Since #59046,
sign-desktop-macos.shhas built the DMG with a barehdiutil create, so no electron-builderdmgsettings applied to released images, including the proddmg.icon. A Finder layout needs a.DS_Storewritten by dmgbuild, which the sign job shouldn't run. The work is now split between the two jobs:pack.ts): After--dir, electron-builder packs thedmgtarget around an empty<name>.appfolder asopencode-desktop-mac-<arch>.layout.dmg. The image is 2 GB and not shrunk, so the app fits later. The layout is a few hundred KB.sign-desktop-macos.sh): After stapling, it converts the layout to read-write, mounts it with-nobrowse, and checks that onlyApplications(linked to/Applications) and the empty app folder are visible. It thendittos the stapled app into place, shrinks the image to its minimum size and converts it to UDZO at the same zlib levels as before. Onlyhdiutilanddittorun there.build-desktop-darwin-*artifact, and the DMG name and location are unchanged.Layout
${productName}, the same as before (OpenCode,OpenCode Beta,OpenCode Dev).icons/dmg/background.pngplus@2x. electron-builder combines them into a HiDPI TIFF.dmgoverride now spreads the shared layout instead of replacing it. The config test covers this.The background art is a placeholder until design signs off.
Verification
bun test electron-builder.config.test.tspasses. It fails if the prod override drops the layout.bun typecheckandbun run lint:changedare clean.shellcheckreports nothing new insign-desktop-macos.sh.release-dry-runworkflow on this PR builds both layouts and runs the sign script with ad-hoc signing.Visual
Requested by: @Brendonovich (Brendan via Slack)