diff --git a/apps/macos/Packaging/dmg-background-small.png b/apps/macos/Packaging/dmg-background-small.png index 74fc56a90454..676867d1e457 100644 Binary files a/apps/macos/Packaging/dmg-background-small.png and b/apps/macos/Packaging/dmg-background-small.png differ diff --git a/apps/macos/Packaging/dmg-background.png b/apps/macos/Packaging/dmg-background.png index a3bff0382b94..dfd19cb542ae 100644 Binary files a/apps/macos/Packaging/dmg-background.png and b/apps/macos/Packaging/dmg-background.png differ diff --git a/scripts/create-dmg.sh b/scripts/create-dmg.sh index 23c64ad19f93..0dbe63c8f84d 100755 --- a/scripts/create-dmg.sh +++ b/scripts/create-dmg.sh @@ -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() { diff --git a/test/scripts/create-dmg.test.ts b/test/scripts/create-dmg.test.ts index 35ba412e7f1c..3b9de020d4f7 100644 --- a/test/scripts/create-dmg.test.ts +++ b/test/scripts/create-dmg.test.ts @@ -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(