Skip to content

The agent that grows with you

feat(icons): custom drive artwork as the volume icon of both installer DMGs

ethernet0217a2a32427
diff --git a/.github/workflows/bootstrap-installer-build.yml b/.github/workflows/bootstrap-installer-build.yml
index 60785d735b5..52f315be6e5 100644
--- a/.github/workflows/bootstrap-installer-build.yml
+++ b/.github/workflows/bootstrap-installer-build.yml
@@ -248,7 +248,9 @@ jobs:
test ${#dmgs[@]} -eq 1
mkdir -p "$RUNNER_TEMP/out"
dmg="$RUNNER_TEMP/out/Hermes-Setup.dmg"
- cp "${dmgs[0]}" "$dmg"
+ # Tauri always uses the app icns as the volume icon; give the DMG the
+ # same drive artwork as the desktop installer before signing.
+ scripts/bundles/set_dmg_volume_icon.sh "${dmgs[0]}" apps/desktop/packaging/dmg-volume.icns "$dmg"
codesign --force --timestamp --sign "$APPLE_SIGNING_IDENTITY" "$dmg"
xcrun notarytool submit "$dmg" --wait \
--key "$APPLE_API_KEY_PATH" --key-id "$APPLE_API_KEY_ID" --issuer "$APPLE_API_ISSUER"
@@ -273,6 +275,9 @@ jobs:
codesign --verify --verbose=2 "$dmg"
xcrun stapler validate "$dmg"
spctl -a -vv -t open --context context:primary-signature "$dmg"
+ mount=$(hdiutil attach -nobrowse -readonly "$dmg" | awk -F'\t' '/\/Volumes\//{print $NF; exit}')
+ test -f "$mount/.VolumeIcon.icns"
+ hdiutil detach "$mount"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
diff --git a/apps/desktop/electron-builder.config.cjs b/apps/desktop/electron-builder.config.cjs
index f6e8fdab007..c631075500e 100644
--- a/apps/desktop/electron-builder.config.cjs
+++ b/apps/desktop/electron-builder.config.cjs
@@ -198,9 +198,11 @@ module.exports = {
// Avoid the failing optional APFS shrink pass; keep compressed conversion.
shrink: false,
// The volume icon defaults to the packager's icns, which is actool's 256px
- // fallback whenever `mac.icon` is the Icon Composer package; the DMG is a
- // Finder volume, not a Dock icon, so it gets the full-resolution .icns.
- icon: 'assets/icon.icns',
+ // fallback whenever `mac.icon` is the Icon Composer package. Ship our own
+ // drive-with-the-girl artwork instead (dmgbuild's badge option can only
+ // paste onto the stock removable-drive icon). It lives in packaging/ with
+ // the background so the `files` whitelist keeps it out of the app bundle.
+ icon: 'packaging/dmg-volume.icns',
title: 'Hermes Agent Installer',
// A prebuilt .tiff on purpose, not a PNG plus a @2x sibling: dmg-builder's
// PNG path runs `tiffutil -cathidpicheck`, which on macOS 26 rewrites both
diff --git a/apps/desktop/packaging/dmg-volume.icns b/apps/desktop/packaging/dmg-volume.icns
new file mode 100644
index 00000000000..d0f205c282e
Binary files /dev/null and b/apps/desktop/packaging/dmg-volume.icns differ
diff --git a/assets/dmg-volume.png b/assets/dmg-volume.png
new file mode 100644
index 00000000000..a74ecb1b5ca
Binary files /dev/null and b/assets/dmg-volume.png differ
diff --git a/scripts/bundles/set_dmg_volume_icon.sh b/scripts/bundles/set_dmg_volume_icon.sh
new file mode 100755
index 00000000000..d5667a5a350
--- /dev/null
+++ b/scripts/bundles/set_dmg_volume_icon.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Replace the volume icon of a finished DMG (the same .VolumeIcon.icns +
+# custom-icon flag dmgbuild sets). Tauri's bundler always uses the app's
+# .icns as the volume icon and offers no override, so the bootstrap
+# installer's DMG gets the shared drive artwork here, before signing.
+#
+# scripts/bundles/set_dmg_volume_icon.sh <in.dmg> <icon.icns> <out.dmg>
+set -euo pipefail
+in_dmg=$1; icns=$2; out_dmg=$3
+work=$(mktemp -d "${TMPDIR:-/tmp}/dmg-volicon.XXXXXX")
+trap 'rm -rf "$work"' EXIT
+rw="$work/rw.dmg"
+hdiutil convert "$in_dmg" -format UDRW -o "$rw" >/dev/null
+mount=$(hdiutil attach -nobrowse -readwrite -noverify "$rw" | awk -F'\t' '/\/Volumes\//{print $NF; exit}')
+test -d "$mount"
+cp "$icns" "$mount/.VolumeIcon.icns"
+/usr/bin/SetFile -a C "$mount"
+hdiutil detach "$mount" >/dev/null
+rm -f "$out_dmg"
+hdiutil convert "$rw" -format UDZO -o "$out_dmg" >/dev/null
+echo "volume icon set: $out_dmg"
diff --git a/scripts/generate_icons.py b/scripts/generate_icons.py
index eb9e34efc1b..3fa47edf166 100644
--- a/scripts/generate_icons.py
+++ b/scripts/generate_icons.py
@@ -52,7 +52,7 @@ Dependencies:
Pillow and resvg-py are core runtime dependencies; run this file with a
Hermes runtime interpreter (scripts/generate-icons.mjs uses HERMES_PYTHON).
-Outputs (43 files):
+Outputs (44 files):
assets/icon-master.svg generated light master
assets/icon-master-dark.svg generated dark master
apps/desktop/assets/icon.png 1024x1024 squircle (light)
@@ -61,6 +61,7 @@ Outputs (43 files):
apps/desktop/assets/icon-dark.png 1024x1024 squircle (dark)
apps/desktop/assets/icon-dark.ico 16,24,32,48,64,128,256
apps/desktop/assets/icon-dark.icns 16..1024 (real ICNS)
+ apps/desktop/packaging/dmg-volume.icns 16..1024, from assets/dmg-volume.png (DMG volume)
apps/desktop/assets/icon.icon/icon.json Icon Composer manifest (macOS 26)
apps/desktop/assets/icon.icon/Assets/art-*.png 1024 girl (+ commit badge), light/dark
apps/desktop/assets/icon.icon/Assets/mono.png 1024 Clear/Tinted material (grayscale + opacity)
@@ -156,6 +157,7 @@ GIRL_VIEWBOX = 5487.0615
CHECK_SIZES: dict[str, tuple[str, tuple[int, int]]] = {
"apps/desktop/assets/icon.png": ("PNG", (1024, 1024)),
"apps/desktop/assets/icon-dark.png": ("PNG", (1024, 1024)),
+ "apps/desktop/packaging/dmg-volume.icns": ("ICNS", (1024, 1024)),
**({"apps/desktop/assets/icon.icon/Assets/border-light.png": ("PNG", (1024, 1024)),
"apps/desktop/assets/icon.icon/Assets/border-dark.png": ("PNG", (1024, 1024))} if BORDER_ENABLED else {}),
"apps/desktop/assets/icon.icon/Assets/mono.png": ("PNG", (1024, 1024)),
@@ -198,6 +200,9 @@ TARGETS: list[tuple[str, str, object]] = [
("apps/desktop/assets/icon-dark.png", "png_dark", 1024),
("apps/desktop/assets/icon-dark.ico", "ico_dark", [16, 24, 32, 48, 64, 128, 256]),
("apps/desktop/assets/icon-dark.icns", "icns_dark", None),
+ # The DMG volume icon: our own drive artwork with the girl on its face,
+ # one artwork for light and dark (volume icons have no appearance variants).
+ ("apps/desktop/packaging/dmg-volume.icns", "icns_from_png", "assets/dmg-volume.png"),
("apps/desktop/assets/icon.icon/icon.json", "icon_manifest", None),
*([("apps/desktop/assets/icon.icon/Assets/border-light.png", "icon_border", "#000000"),
("apps/desktop/assets/icon.icon/Assets/border-dark.png", "icon_border", "#ffffff")] if BORDER_ENABLED else []),
@@ -248,6 +253,7 @@ class IconArt:
def __init__(self, source: Path, *, colors: tuple[str, str] | None = None, commit: str = ""):
assets = source / "assets"
+ self.source = source
self.colors = colors
self.commit = commit
self.girls = {color: assets / f"nous-girl-{color}.svg" for color in ("black", "white")}
@@ -767,6 +773,12 @@ def target_bytes(art: IconArt, kind: str, arg: object) -> bytes:
img = render(art.master_mac_dark, 1024)
frames = [img.resize((s, s), Image.LANCZOS) for s in (16, 32, 64, 128, 256, 512, 1024)]
img.save(buf, format="ICNS", append_images=frames[1:])
+ elif kind == "icns_from_png":
+ # Hand-made artwork (the DMG volume: girl on a drive) shipped as ICNS.
+ img = Image.open(art.source / arg).convert("RGBA")
+ assert img.size == (1024, 1024), f"{arg} must be 1024x1024"
+ frames = [img.resize((s, s), Image.LANCZOS) for s in (16, 32, 64, 128, 256, 512, 1024)]
+ img.save(buf, format="ICNS", append_images=frames[1:])
elif kind == "wide":
w, h = arg
canvas = Image.new("RGBA", (w, h), (0, 0, 0, 0))
@@ -836,7 +848,7 @@ def cmd_write(source: Path, out: Path) -> int:
except Exception:
sizes = [im.size]
print(f" {rel}: ICO {sorted(set(sizes))}")
- elif kind in ("icns", "icns_dark"):
+ elif kind in ("icns", "icns_dark", "icns_from_png"):
print(f" {rel}: ICNS {im.size} (container)")
else:
print(f" {rel}: {im.format} {im.size}")
diff --git a/tests/scripts/test_icon_flavors.py b/tests/scripts/test_icon_flavors.py
index b0c5ab46464..e63221cade7 100644
--- a/tests/scripts/test_icon_flavors.py
+++ b/tests/scripts/test_icon_flavors.py
@@ -16,6 +16,7 @@ import pytest
ROOT = Path(__file__).resolve().parents[2]
LAYERED_ICON = "icon.icon" # apps/desktop/assets/icon.icon: the macOS 26 Icon Composer package
+DMG_VOLUME = Path("apps/desktop/packaging/dmg-volume.icns") # hand-made drive artwork, not a tile
@pytest.fixture(scope="module")
@@ -142,8 +143,8 @@ def test_canary_changes_only_desktop_background_preserving_art_and_native_geomet
stable = generate("v1.2.3")
canary = generate("v1.2.3+canary.20260911T010203Z")
for path in (stable / "apps/desktop").rglob("*"):
- if not path.is_file() or LAYERED_ICON in path.parts:
- continue # the layered macOS icon carries its flavor in icon.json, tested below
+ if not path.is_file() or LAYERED_ICON in path.parts or path.relative_to(stable) == DMG_VOLUME:
+ continue # the layered macOS icon carries its flavor in icon.json; the DMG volume art is unflavoured (both tested below)
original_frames = list(frames(path))
canary_frames = list(frames(canary / path.relative_to(stable)))
assert len(original_frames) == len(canary_frames)
@@ -170,8 +171,8 @@ def test_commit_icons_are_red_and_print_only_the_actual_seven_digit_prefix(gener
continue
rel = path.relative_to(first)
assert path.read_bytes() == (same_prefix / rel).read_bytes(), rel
- if LAYERED_ICON in path.parts:
- continue # the layered macOS icon carries its flavor in icon.json, tested below
+ if LAYERED_ICON in path.parts or rel == DMG_VOLUME:
+ continue # the layered macOS icon carries its flavor in icon.json; the DMG volume art is unflavoured (both tested below)
first_frames = list(frames(path))
other_frames = list(frames(changed / rel))
stable_frames = list(frames(stable / rel))
@@ -289,6 +290,16 @@ def test_layered_macos_icon_mono_layer_and_flavor_stays_in_the_fill(generate, mo
for name in ("art-light.png", "art-dark.png", "mono.png"):
assert (stable / "Assets" / name).read_bytes() == (canary / "Assets" / name).read_bytes(), name
+
+ # The DMG volume icon is the hand-made drive artwork, shipped as a full ICNS
+ # and never flavoured: an installer's disk looks the same for every channel.
+ volume = stable.parents[3] / DMG_VOLUME
+ for other in (canary, commit):
+ assert volume.read_bytes() == (other.parents[3] / DMG_VOLUME).read_bytes()
+ icns = Image.open(volume)
+ assert {w * scale for w, h, scale in icns.info["sizes"]} == {32, 64, 128, 256, 512, 1024} # same reps as the app icns
+ assert ImageChops.difference(icns.icns.getimage((512, 512, 2)).convert("RGBA"),
+ Image.open(ROOT / "assets/dmg-volume.png").convert("RGBA")).getbbox() is None
for name in ("art-light.png", "art-dark.png"):
# The commit badge is the only difference, and it lives in the top quarter.
plain = Image.open(stable / "Assets" / name).convert("RGBA")