feat(macos): refresh DMG installer artwork (#107142)

This commit is contained in:
Peter Steinberger
2026-07-13 22:09:36 -07:00
committed by GitHub
parent ee6d6e7e78
commit e278a34331
4 changed files with 31 additions and 8 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 KiB

After

Width:  |  Height:  |  Size: 301 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 990 KiB

After

Width:  |  Height:  |  Size: 1.2 MiB

+8 -8
View File
@@ -10,10 +10,10 @@ set -euo pipefail
# DMG_VOLUME_NAME default: CFBundleName
# DMG_BACKGROUND_PATH default: apps/macos/Packaging/dmg-background.png
# DMG_BACKGROUND_SMALL default: apps/macos/Packaging/dmg-background-small.png (recommended)
# DMG_WINDOW_BOUNDS default: "400 100 900 420" (500x320)
# DMG_ICON_SIZE default: 128
# DMG_APP_POS default: "125 160"
# DMG_APPS_POS default: "375 160"
# DMG_WINDOW_BOUNDS default: "400 100 1080 530" (680x430)
# DMG_ICON_SIZE default: 144
# DMG_APP_POS default: "170 305"
# DMG_APPS_POS default: "510 305"
# SKIP_DMG_STYLE=1 skip Finder styling
# DMG_EXTRA_SECTORS extra sectors to keep when shrinking RW image (default: 2048)
@@ -43,10 +43,10 @@ DMG_VOLUME_NAME="${DMG_VOLUME_NAME:-$APP_NAME}"
DMG_BACKGROUND_SMALL="${DMG_BACKGROUND_SMALL:-$ROOT_DIR/apps/macos/Packaging/dmg-background-small.png}"
DMG_BACKGROUND_PATH="${DMG_BACKGROUND_PATH:-$ROOT_DIR/apps/macos/Packaging/dmg-background.png}"
DMG_WINDOW_BOUNDS="${DMG_WINDOW_BOUNDS:-400 100 900 420}"
DMG_ICON_SIZE="${DMG_ICON_SIZE:-128}"
DMG_APP_POS="${DMG_APP_POS:-125 160}"
DMG_APPS_POS="${DMG_APPS_POS:-375 160}"
DMG_WINDOW_BOUNDS="${DMG_WINDOW_BOUNDS:-400 100 1080 530}"
DMG_ICON_SIZE="${DMG_ICON_SIZE:-144}"
DMG_APP_POS="${DMG_APP_POS:-170 305}"
DMG_APPS_POS="${DMG_APPS_POS:-510 305}"
DMG_EXTRA_SECTORS="${DMG_EXTRA_SECTORS:-2048}"
require_integer_list() {
+23
View File
@@ -150,6 +150,12 @@ function runScript(args: string[], env: NodeJS.ProcessEnv = {}) {
});
}
function readPngDimensions(imagePath: string): { width: number; height: number } {
const data = readFileSync(imagePath);
expect(data.subarray(1, 4).toString("ascii")).toBe("PNG");
return { width: data.readUInt32BE(16), height: data.readUInt32BE(20) };
}
afterEach(() => {
for (const dir of tempDirs.splice(0)) {
rmSync(dir, { recursive: true, force: true });
@@ -195,6 +201,23 @@ describe("create-dmg plist validation", () => {
expect(script).not.toContain('tell application "Finder" to close every window');
});
it("keeps the larger Finder layout aligned with the packaged backgrounds", () => {
const script = readFileSync(scriptPath, "utf8");
expect(script).toContain('DMG_WINDOW_BOUNDS="${DMG_WINDOW_BOUNDS:-400 100 1080 530}"');
expect(script).toContain('DMG_ICON_SIZE="${DMG_ICON_SIZE:-144}"');
expect(script).toContain('DMG_APP_POS="${DMG_APP_POS:-170 305}"');
expect(script).toContain('DMG_APPS_POS="${DMG_APPS_POS:-510 305}"');
expect(readPngDimensions("apps/macos/Packaging/dmg-background-small.png")).toEqual({
width: 680,
height: 430,
});
expect(readPngDimensions("apps/macos/Packaging/dmg-background.png")).toEqual({
width: 1360,
height: 860,
});
});
it("fails malformed DMG resize slack before creating images", () => {
const script = readFileSync(scriptPath, "utf8");
const validationBlock = script.slice(