diff --git a/apps/desktop/build/background.png b/apps/desktop/build/background.png new file mode 100644 index 0000000000..46e4393408 Binary files /dev/null and b/apps/desktop/build/background.png differ diff --git a/apps/desktop/build/background@2x.png b/apps/desktop/build/background@2x.png new file mode 100644 index 0000000000..ebfb6909d9 Binary files /dev/null and b/apps/desktop/build/background@2x.png differ diff --git a/apps/desktop/electron-builder.config.mjs b/apps/desktop/electron-builder.config.mjs index 321216a77a..9560169bd2 100644 --- a/apps/desktop/electron-builder.config.mjs +++ b/apps/desktop/electron-builder.config.mjs @@ -186,6 +186,16 @@ export default { }, }, dmg: { + title: 'Maka Installer', + // Relative to electron-builder's default buildResources directory (build/). + background: 'background.png', + window: { width: 540, height: 380 }, + iconSize: 112, + iconTextSize: 16, + contents: [ + { x: 130, y: 190, type: 'file' }, + { x: 410, y: 190, type: 'link', path: '/Applications' }, + ], sign: true, // Stapling the notarization ticket after electron-builder exits changes the // DMG bytes. macOS updates use the ZIP, so do not publish a stale DMG hash diff --git a/scripts/product-release.test.mjs b/scripts/product-release.test.mjs index e2f16e814e..d203ab4aa4 100644 --- a/scripts/product-release.test.mjs +++ b/scripts/product-release.test.mjs @@ -194,6 +194,19 @@ test('Desktop packaging does not distribute the retired bundled Git runtime', () ); }); +test('macOS DMG ships correctly sized background assets', async () => { + const backgroundDirectory = join(repoRoot, 'apps', 'desktop', 'build'); + const pngSignature = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]); + for (const [name, dimensions] of [ + ['background.png', { width: 540, height: 380 }], + ['background@2x.png', { width: 1080, height: 760 }], + ]) { + const data = await readFile(join(backgroundDirectory, name)); + assert.deepEqual(data.subarray(0, pngSignature.length), pngSignature, `${name} must be a PNG`); + assert.deepEqual({ width: data.readUInt32BE(16), height: data.readUInt32BE(20) }, dimensions); + } +}); + test('a successful Windows upgrade invalidates stale backup authority before best-effort cleanup', async () => { const source = await readFile( join(repoRoot, 'apps', 'desktop', 'build', 'installer.nsh'),