Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.
Swift apple-silicond3dmetaldxmtdxvkfexgame-porting-toolkitgamingmac-gamingmacosmetalmoltenvksteamswiftuivkd3d-protonwhisky-alternativewindows-gameswinewine-wrapper
Design the disk image window: arrow to Applications, app icon as volume icon
Gauthier Piarrette83e24db1ea47
diff --git a/Scripts/dmg-layout.sh b/Scripts/dmg-layout.shnew file mode 100755index 0000000..2d68672--- /dev/null+++ b/Scripts/dmg-layout.sh@@ -0,0 +1,61 @@+#!/bin/zsh+# Dev-time tool: bake the Finder window layout of the Highball disk image (icon view, 128 px+# icons, no toolbar, background picture, icon positions) into Scripts/dmg/DS_Store.+# Release builds copy that file into the image, so Finder is never automated at release+# time and the layout is byte-for-byte reproducible. Rerun only when the geometry in+# Scripts/make-dmg-background.swift changes, then commit the new DS_Store.+# Usage: Scripts/dmg-layout.sh (needs dist/Highball.app — Scripts/make-app.sh debug is enough)+set -euo pipefail+cd "$(dirname "$0")/.."+test -d dist/Highball.app || { echo "dist/Highball.app missing; run Scripts/make-app.sh debug first" >&2; exit 1; }+test ! -e /Volumes/Highball || { echo "a Highball volume is already mounted; eject it first" >&2; exit 1; }++# Geometry: keep in sync with make-dmg-background.swift (WIN_W x WIN_H is the content area).+# Finder's AppleScript bounds include the title bar, measured at 32 pt on macOS 26; the+# background has spare height below the content so a shorter title bar elsewhere is harmless.+WIN_W=660; WIN_H=400; TITLEBAR=32; ICON=128+APP_X=150; APP_Y=185; APPS_X=510; APPS_Y=185+WIN_X=200; WIN_Y=140 # where the window opens on the user's screen (Finder stores this too)++WORK=$(mktemp -d)+STAGE="$WORK/stage"+Scripts/dmg-stage.sh "$STAGE"+rm -f "$STAGE/.DS_Store" # layout is what we are about to create, never a stale copy++hdiutil create -volname "Highball" -srcfolder "$STAGE" -format UDRW -ov "$WORK/layout.dmg" -quiet+hdiutil attach -readwrite -noverify -noautoopen "$WORK/layout.dmg" -quiet+test -d /Volumes/Highball || { echo "image did not mount at /Volumes/Highball" >&2; exit 1; }++osascript <<EOS+tell application "Finder"+ tell disk "Highball"+ open+ set current view of container window to icon view+ set toolbar visible of container window to false+ set statusbar visible of container window to false+ set the bounds of container window to {$WIN_X, $WIN_Y, $((WIN_X + WIN_W)), $((WIN_Y + WIN_H + TITLEBAR))}+ set viewOptions to the icon view options of container window+ set arrangement of viewOptions to not arranged+ set icon size of viewOptions to $ICON+ set text size of viewOptions to 12+ set label position of viewOptions to bottom+ set shows item info of viewOptions to false+ set shows icon preview of viewOptions to true+ set background picture of viewOptions to file ".background:background.tiff"+ set position of item "Highball.app" of container window to {$APP_X, $APP_Y}+ set position of item "Applications" of container window to {$APPS_X, $APPS_Y}+ close+ open+ update without registering applications+ delay 2+ close+ end tell+end tell+EOS+sync; sleep 2+test -f /Volumes/Highball/.DS_Store || { echo "Finder wrote no .DS_Store" >&2; exit 1; }+mkdir -p Scripts/dmg+cp /Volumes/Highball/.DS_Store Scripts/dmg/DS_Store+hdiutil detach /Volumes/Highball -quiet+rm -rf "$WORK"+echo "wrote Scripts/dmg/DS_Store ($(stat -f %z Scripts/dmg/DS_Store) bytes) — commit it"diff --git a/Scripts/dmg-stage.sh b/Scripts/dmg-stage.shnew file mode 100755index 0000000..c9cb553--- /dev/null+++ b/Scripts/dmg-stage.sh@@ -0,0 +1,26 @@+#!/bin/zsh+# Assemble the folder that becomes the Highball disk image: the app, the Applications+# drop link, the rendered window background, the volume icon, and the committed Finder+# layout. Shared by release.sh (the real image) and dmg-layout.sh (which re-bakes the layout).+# Usage: Scripts/dmg-stage.sh <stage-dir> (needs dist/Highball.app)+set -euo pipefail+cd "$(dirname "$0")/.."+STAGE="${1:?usage: dmg-stage.sh <stage-dir>}"+test -d dist/Highball.app || { echo "dist/Highball.app missing" >&2; exit 1; }++rm -rf "$STAGE"; mkdir -p "$STAGE/.background"+ditto dist/Highball.app "$STAGE/Highball.app"+ln -s /Applications "$STAGE/Applications"++# Window background, rendered from source so no image binary lives in git. The 1x and 2x+# renders are folded into one TIFF: Finder picks the Retina page on Retina displays.+BG=.build/dmg-background+mkdir -p "$BG"+swift Scripts/make-dmg-background.swift "$BG/bg1x.png" "$BG/bg2x.png" >/dev/null+tiffutil -cathidpicheck "$BG/bg1x.png" "$BG/bg2x.png" -out "$STAGE/.background/background.tiff" 2>/dev/null++# The mounted volume shows the app icon instead of the generic disk-image icon.+cp dist/Highball.app/Contents/Resources/AppIcon.icns "$STAGE/.VolumeIcon.icns"++# Finder layout baked by Scripts/dmg-layout.sh; absent only while that tool creates it.+if [ -f Scripts/dmg/DS_Store ]; then cp Scripts/dmg/DS_Store "$STAGE/.DS_Store"; fidiff --git a/Scripts/dmg/DS_Store b/Scripts/dmg/DS_Storenew file mode 100644index 0000000..e82d91aBinary files /dev/null and b/Scripts/dmg/DS_Store differdiff --git a/Scripts/make-dmg-background.swift b/Scripts/make-dmg-background.swiftnew file mode 100644index 0000000..1adeea6--- /dev/null+++ b/Scripts/make-dmg-background.swift@@ -0,0 +1,129 @@+// Renders the background of the Highball disk-image window: warm cream ground, wordmark, and+// a gold arrow from where Highball.app sits to the Applications folder.+// The ground is light on purpose: Finder paints icon labels black over a background picture+// in BOTH light and dark mode (verified on macOS 26), so a dark ground hides "Highball" and+// "Applications". The geometry (window size, icon centres) must match the icon positions+// baked into Scripts/dmg/DS_Store — regenerate that with Scripts/dmg-layout.sh when it changes.+// Usage: swift Scripts/make-dmg-background.swift <out-1x.png> <out-2x.png>+import AppKit++// Window content size in points and the icon centres, all measured from the top-left.+// The image is rendered taller than the content: Finder anchors it top-left and clips the+// rest, so a title bar that is a few points shorter on another macOS never exposes a bare+// strip under the paper. Nothing important is drawn below contentH.+let W: CGFloat = 660, contentH: CGFloat = 400, H: CGFloat = 440+let iconSize: CGFloat = 128+let appCenter = CGPoint(x: 150, y: 185)+let appsCenter = CGPoint(x: 510, y: 185)++func color(_ hex: UInt32, _ a: CGFloat = 1) -> NSColor {+ NSColor(srgbRed: CGFloat((hex >> 16) & 0xFF) / 255, green: CGFloat((hex >> 8) & 0xFF) / 255,+ blue: CGFloat(hex & 0xFF) / 255, alpha: a)+}+// The app icon's and gethighball.com's palette, on paper instead of charcoal.+let paperTop: UInt32 = 0xF7F1E5, paperBottom: UInt32 = 0xEEE5D2+let ink: UInt32 = 0x16110A, mutedInk: UInt32 = 0x75654D, amber: UInt32 = 0xD79A45, amberDeep: UInt32 = 0xB87A2E++func rounded(_ size: CGFloat, _ weight: NSFont.Weight) -> NSFont {+ let base = NSFont.systemFont(ofSize: size, weight: weight)+ guard let d = base.fontDescriptor.withDesign(.rounded), let f = NSFont(descriptor: d, size: size) else { return base }+ return f+}++func text(_ s: String, _ font: NSFont, _ c: NSColor, at p: CGPoint, align: NSTextAlignment = .left) {+ let attrs: [NSAttributedString.Key: Any] = [.font: font, .foregroundColor: c]+ let str = NSAttributedString(string: s, attributes: attrs)+ let size = str.size()+ var x = p.x+ if align == .center { x -= size.width / 2 } else if align == .right { x -= size.width }+ str.draw(at: CGPoint(x: x, y: p.y))+}++func render(scale: CGFloat) -> NSImage {+ NSImage(size: NSSize(width: W * scale, height: H * scale), flipped: true) { _ in+ guard let ctx = NSGraphicsContext.current?.cgContext else { return false }+ ctx.scaleBy(x: scale, y: scale)+ ctx.setAllowsAntialiasing(true)+ ctx.setShouldSmoothFonts(true)+ let space = CGColorSpace(name: CGColorSpace.sRGB)!++ // Paper ground, a touch brighter at the top.+ let paper = CGGradient(colorsSpace: space, colors: [color(paperTop).cgColor, color(paperBottom).cgColor] as CFArray, locations: [0, 1])!+ ctx.drawLinearGradient(paper, start: .zero, end: CGPoint(x: 0, y: H), options: [])++ // Warm amber pool behind the icon row: the drink, not a spotlight.+ let mid = CGPoint(x: (appCenter.x + appsCenter.x) / 2, y: appCenter.y + 10)+ let glow = CGGradient(colorsSpace: space,+ colors: [color(amber, 0.20).cgColor, color(amber, 0.07).cgColor, color(amber, 0).cgColor] as CFArray,+ locations: [0, 0.5, 1])!+ ctx.drawRadialGradient(glow, startCenter: mid, startRadius: 0, endCenter: mid, endRadius: 340, options: [])++ // The shelf the icons stand on: a hairline that fades out at both ends.+ let shelfY = appCenter.y + iconSize / 2 + 34+ let shelf = CGGradient(colorsSpace: space,+ colors: [color(ink, 0).cgColor, color(ink, 0.18).cgColor, color(ink, 0).cgColor] as CFArray,+ locations: [0, 0.5, 1])!+ ctx.saveGState()+ ctx.clip(to: CGRect(x: 60, y: shelfY, width: W - 120, height: 1))+ ctx.drawLinearGradient(shelf, start: CGPoint(x: 60, y: shelfY), end: CGPoint(x: W - 60, y: shelfY), options: [])+ ctx.restoreGState()++ // The arrow: app -> Applications. Thick, round, gold, lit from above.+ let gap: CGFloat = 36+ let x0 = appCenter.x + iconSize / 2 + gap+ let x1 = appsCenter.x - iconSize / 2 - gap+ let y = appCenter.y+ let head: CGFloat = 22+ let arrow = CGMutablePath()+ arrow.move(to: CGPoint(x: x0, y: y))+ arrow.addLine(to: CGPoint(x: x1, y: y))+ arrow.move(to: CGPoint(x: x1 - head, y: y - head))+ arrow.addLine(to: CGPoint(x: x1, y: y))+ arrow.addLine(to: CGPoint(x: x1 - head, y: y + head))+ ctx.setLineCap(.round); ctx.setLineJoin(.round)+ ctx.saveGState()+ ctx.setShadow(offset: CGSize(width: 0, height: 3), blur: 10, color: color(amberDeep, 0.35).cgColor)+ ctx.setStrokeColor(color(amberDeep).cgColor)+ ctx.setLineWidth(10)+ ctx.addPath(arrow); ctx.strokePath()+ ctx.restoreGState()+ ctx.setStrokeColor(color(amber).cgColor)+ ctx.setLineWidth(8)+ ctx.addPath(arrow); ctx.strokePath()+ ctx.setStrokeColor(color(0xF3CE8B, 0.9).cgColor)+ ctx.setLineWidth(2.5)+ ctx.addPath(arrow); ctx.strokePath()++ // Wordmark and tagline, top-left. Same rounded heavy face as the app's sidebar.+ text("Highball", rounded(24, .heavy), color(ink), at: CGPoint(x: 36, y: 28))+ text("Run Windows games on Apple Silicon.", rounded(13, .medium), color(mutedInk), at: CGPoint(x: 37, y: 60))++ // Instruction, centred under the shelf.+ text("Drag Highball into Applications", rounded(15, .semibold), color(ink), at: CGPoint(x: W / 2, y: shelfY + 22), align: .center)+ text("then open it from your Applications folder.", rounded(13, .regular), color(mutedInk), at: CGPoint(x: W / 2, y: shelfY + 46), align: .center)++ text("gethighball.com", rounded(11, .medium), color(mutedInk, 0.7), at: CGPoint(x: W - 36, y: contentH - 30), align: .right)+ return true+ }+}++func writePNG(_ image: NSImage, _ path: String, scale: CGFloat) {+ let rep = NSBitmapImageRep(bitmapDataPlanes: nil, pixelsWide: Int(W * scale), pixelsHigh: Int(H * scale),+ bitsPerSample: 8, samplesPerPixel: 4, hasAlpha: true, isPlanar: false,+ colorSpaceName: .deviceRGB, bytesPerRow: 0, bitsPerPixel: 0)!+ rep.size = NSSize(width: W * scale, height: H * scale)+ NSGraphicsContext.saveGraphicsState()+ NSGraphicsContext.current = NSGraphicsContext(bitmapImageRep: rep)+ image.draw(in: NSRect(x: 0, y: 0, width: W * scale, height: H * scale))+ NSGraphicsContext.restoreGraphicsState()+ guard let png = rep.representation(using: .png, properties: [:]) else { fatalError("render failed") }+ try! png.write(to: URL(fileURLWithPath: path))+ print("wrote \(path) (\(Int(W * scale))x\(Int(H * scale)))")+}++let args = CommandLine.arguments+guard args.count == 3 else {+ print("usage: swift Scripts/make-dmg-background.swift <out-1x.png> <out-2x.png>"); exit(2)+}+writePNG(render(scale: 1), args[1], scale: 1)+writePNG(render(scale: 2), args[2], scale: 2)diff --git a/Scripts/make-dmg.sh b/Scripts/make-dmg.shnew file mode 100755index 0000000..006f062--- /dev/null+++ b/Scripts/make-dmg.sh@@ -0,0 +1,26 @@+#!/bin/zsh+# Build dist/Highball.dmg from dist/Highball.app: the designed drag-to-Applications window+# (Scripts/dmg-stage.sh) on a compressed read-only image, with the app icon as the volume icon.+# Signing and notarization stay in release.sh so this can be run and inspected locally.+# Usage: Scripts/make-dmg.sh+set -euo pipefail+cd "$(dirname "$0")/.."+test ! -e /Volumes/Highball || { echo "a Highball volume is already mounted; eject it first" >&2; exit 1; }++DMG=dist/Highball.dmg+WORK=dist/dmg-work+rm -rf "$WORK" "$DMG"; mkdir -p "$WORK"+Scripts/dmg-stage.sh "$WORK/stage"++# Read-write first: the custom-icon flag lives on the mounted volume's root folder and cannot+# be set through -srcfolder. -nobrowse keeps Finder out of it. Then convert to the compressed+# read-only image users download.+hdiutil create -volname "Highball" -srcfolder "$WORK/stage" -format UDRW -ov "$WORK/rw.dmg" -quiet+hdiutil attach -readwrite -noverify -noautoopen -nobrowse "$WORK/rw.dmg" -quiet+test -d /Volumes/Highball || { echo "image did not mount at /Volumes/Highball" >&2; exit 1; }+SetFile -a C /Volumes/Highball+sync+hdiutil detach /Volumes/Highball -quiet+hdiutil convert "$WORK/rw.dmg" -format UDZO -imagekey zlib-level=9 -o "$DMG" -quiet+rm -rf "$WORK"+echo "built $DMG ($(du -h "$DMG" | cut -f1))"diff --git a/Scripts/release.sh b/Scripts/release.shindex c07013b..aec7be8 100755--- a/Scripts/release.sh+++ b/Scripts/release.sh@@ -76,11 +76,9 @@ PY# (proven 2026-08-25, repeated Reddit reports). A DMG has no extraction step to mangle.# The zip stays as the Sparkle update enclosure. Landing/README link# .../releases/latest/download/Highball.dmg, so the DMG asset name must stay unversioned.+# The window layout (background, icon positions, volume icon) lives in Scripts/make-dmg.sh.DMG="dist/Highball.dmg"-rm -rf dist/dmg-stage "$DMG"; mkdir dist/dmg-stage-ditto dist/Highball.app dist/dmg-stage/Highball.app-ln -s /Applications dist/dmg-stage/Applications-hdiutil create -volname "Highball" -srcfolder dist/dmg-stage -ov -format UDZO "$DMG" -quiet+Scripts/make-dmg.shcodesign --sign "Developer ID Application: Gauthier PIARRETTE (B95M7DARU4)" --timestamp "$DMG"xcrun notarytool submit "$DMG" --keychain-profile highball --waitxcrun stapler staple "$DMG"