Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit
Swift apple-silicond3dmetaldxmtdxvkgame-porting-toolkitgptkmac-gamingmacosmetalfxrosetta-2steamsteam-playwinewinecx
feat(release): ship Bridgeplay.dmg as the download
raymondchins9076de81d4ba
diff --git a/README.md b/README.mdindex 46b9611..328b90f 100644--- a/README.md+++ b/README.md@@ -66,9 +66,9 @@ To add yours: after you play, Bridgeplay asks once per game *How did it run?* On## Install-1. **Download the installer** from [bridgeplay.dev](https://bridgeplay.dev): `Bridgeplay-Setup.zip`, under 1 MB. It fetches Bridgeplay, Apple's graphics, the engine and Steam (from Valve, if missing) as it installs, and checks every download against Bridgeplay's signature.-2. **Open Bridgeplay Installer.** It's notarized by Apple, so macOS only asks once whether to open an app downloaded from the internet: click **Open**. It needs an admin account.-3. **Follow the Setup Assistant**: Rosetta, graphics, Steam sign-in, App Management and a couple of other standard macOS prompts. Setup modifies your Steam app; see [What Bridgeplay changes in Steam](#what-bridgeplay-changes-in-steam).+1. **Download Bridgeplay** from [bridgeplay.dev](https://bridgeplay.dev): `Bridgeplay.dmg`, notarized by Apple.+2. **Drag Bridgeplay into Applications** and open it. macOS asks once whether to open an app downloaded from the internet: click **Open**. It needs an admin account.+3. **Follow the Setup Assistant**: Rosetta, Apple's graphics (Download fetches them, and Steam from Valve if it's missing), Steam sign-in, App Management and a couple of other standard macOS prompts. Every download is checked against Bridgeplay's signature. Setup modifies your Steam app; see [What Bridgeplay changes in Steam](#what-bridgeplay-changes-in-steam).4. **Press Play** on any Windows game in Steam. The first time you use a controller, allow Steam's Input Monitoring request.Each game's Bridgeplay settings (graphics backend, Metal HUD, DLSS, frame generation, controllers) are in Steam: right-click the game, **Properties… › Bridgeplay**.diff --git a/docs/RELEASING.md b/docs/RELEASING.mdindex d4bed97..96a0d6d 100644--- a/docs/RELEASING.md+++ b/docs/RELEASING.md@@ -1,12 +1,14 @@# Releasing Bridgeplay-Every release is a GitHub release of `raymondchins/Bridgeplay` carrying `Bridgeplay.zip`,-`appcast.xml` and the small native installer, `Bridgeplay-Setup.zip` (notarized, so macOS-only asks once whether to open it). The native installer also downloads the `installer`+Every release is a GitHub release of `raymondchins/Bridgeplay` carrying `Bridgeplay.zip`+(the Sparkle update), `appcast.xml`, `Bridgeplay.dmg` (the download bridgeplay.dev links to:+the app in a disk image with an Applications link, built by `scripts/package-dmg.sh` after+the appcast so Sparkle never indexes it) and the small native installer,+`Bridgeplay-Setup.zip`. All three are notarized, so macOS only asks once whether to open+them. The native installer also downloads the `installer`release's `Bridgeplay-Installer.zip` for GPTK, the engine and the configs, checked againstthe `Bridgeplay-Installer.zip.sig` that `release-local.sh` signs and uploads beside it. The one-click `Bridgeplay-Installer.zip` lives on its own prerelease, tag-`installer` (bridgeplay.dev/download redirects to-`releases/download/installer/Bridgeplay-Installer.zip`). It carries no app: `Install.command`+`installer`. It carries no app: `Install.command`downloads the Latest release's `Bridgeplay.zip` when it runs, so `release-local.sh` uploadsthe installer again only when its fingerprint (every file it ships) changes, which is whenthe engines, GPTK, the configs or the installer itself change. A release whose sourcesdiff --git a/installer/dmg/background.html b/installer/dmg/background.htmlnew file mode 100644index 0000000..1a5af19--- /dev/null+++ b/installer/dmg/background.html@@ -0,0 +1,28 @@+<!doctype html>+<!-- The Bridgeplay.dmg window background, 660x400. Render with installer/dmg/render-background.sh. --><html><head><meta charset="utf-8"><style>+@font-face{font-family:Geist;src:url(../../app/Sources/BridgeplayUI/Resources/Fonts/geist.woff2) format("woff2");font-weight:100 900}+html,body{margin:0;width:660px;height:400px;overflow:hidden;background:#000}+body{position:relative;font-family:Geist,sans-serif;color:#f5f5f7;-webkit-font-smoothing:antialiased}+.glow{position:absolute;inset:0;background:+ radial-gradient(260px 150px at 330px 200px,rgb(139 123 255/.16),transparent 70%),+ radial-gradient(200px 120px at 250px 230px,rgb(79 179 255/.10),transparent 70%),+ radial-gradient(200px 120px at 420px 170px,rgb(255 122 198/.08),transparent 70%)}+.grid{position:absolute;inset:0;background-image:linear-gradient(rgb(255 255 255/.035) 1px,transparent 1px),linear-gradient(90deg,rgb(255 255 255/.035) 1px,transparent 1px);background-size:44px 44px;-webkit-mask-image:radial-gradient(420px 260px at 330px 200px,#000 20%,transparent 75%)}+.eyebrow{position:absolute;top:34px;width:100%;text-align:center;font:500 10.5px/1 ui-monospace,"SF Mono",Menlo,monospace;letter-spacing:.14em;text-transform:uppercase;color:#86868b}+h1{position:absolute;top:52px;width:100%;margin:0;text-align:center;font-weight:600;font-size:24px;letter-spacing:-.02em}+h1 span{background:linear-gradient(90deg,#8b7bff,#4fb3ff 55%,#ff7ac6);-webkit-background-clip:text;color:transparent}+.slot{position:absolute;top:137px;width:150px;height:150px;border-radius:28px;border:1px solid rgb(255 255 255/.10);background:rgb(255 255 255/.025)}+.a{left:90px}.b{left:420px}+svg{position:absolute;left:0;top:0}+.foot{position:absolute;bottom:26px;width:100%;text-align:center;font:400 11px/1.5 ui-monospace,"SF Mono",Menlo,monospace;color:#86868b}+.foot b{color:#a1a1a6;font-weight:500}+</style></head><body>+<div class="glow"></div><div class="grid"></div>+<div class="eyebrow">Install Bridgeplay</div>+<h1>Drag it into <span>Applications</span></h1>+<div class="slot a"></div><div class="slot b"></div>+<svg width="660" height="400" viewBox="0 0 660 400"><defs><linearGradient id="g" x1="262" y1="0" x2="398" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#8b7bff" stop-opacity=".25"/><stop offset=".55" stop-color="#4fb3ff"/><stop offset="1" stop-color="#ff7ac6"/></linearGradient></defs>+<path d="M262 205 H392" stroke="url(#g)" stroke-width="2" stroke-linecap="round" stroke-dasharray="1 9"/>+<path d="M384 196 L396 205 L384 214" fill="none" stroke="#ff7ac6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>+<div class="foot">Then open <b>Bridgeplay</b> from Applications. The Setup Assistant does the rest.<br>bridgeplay.dev</div>+</body></html>diff --git a/installer/dmg/background.tiff b/installer/dmg/background.tiffnew file mode 100644index 0000000..fd4d868Binary files /dev/null and b/installer/dmg/background.tiff differdiff --git a/installer/dmg/render-background.sh b/installer/dmg/render-background.shnew file mode 100755index 0000000..6dced4b--- /dev/null+++ b/installer/dmg/render-background.sh@@ -0,0 +1,16 @@+#!/bin/sh+# Renders background.html into background.tiff (660x400 and @2x) for scripts/package-dmg.sh.+# Needs Google Chrome; run it after editing background.html and commit the TIFF.+set -eu+here=$(cd "$(dirname "$0")" && pwd)+chrome=${CHROME:-/Applications/Google Chrome.app/Contents/MacOS/Google Chrome}+[ -x "$chrome" ] || { echo "render-background: no Chrome at $chrome (set CHROME)" >&2; exit 1; }+work=$(mktemp -d)+trap 'rm -rf "$work"' EXIT+for scale in 1 2; do+ "$chrome" --headless=new --disable-gpu --hide-scrollbars --force-device-scale-factor="$scale" \+ --window-size=660,400 --screenshot="$work/bg$scale.png" "file://$here/background.html" >/dev/null 2>&1+done+[ "$(sips -g pixelWidth "$work/bg2.png" | awk '/pixelWidth/{print $2}')" = 1320 ] || { echo "render-background: unexpected @2x size" >&2; exit 1; }+tiffutil -cathidpicheck "$work/bg1.png" "$work/bg2.png" -out "$here/background.tiff" >/dev/null+echo "==> wrote $here/background.tiff"diff --git a/scripts/notarize.sh b/scripts/notarize.shindex db44480..2f04f90 100755--- a/scripts/notarize.sh+++ b/scripts/notarize.sh@@ -1,8 +1,9 @@#!/bin/sh-# Notarize a signed app bundle with Apple and staple the ticket to it, so Gatekeeper opens a-# downloaded copy without Open Anyway, offline too. See docs/RELEASING.md (Signing).+# Notarize a signed app bundle or disk image with Apple and staple the ticket to it, so+# Gatekeeper opens a downloaded copy without Open Anyway, offline too. See docs/RELEASING.md+# (Signing).#-# scripts/notarize.sh <path/to/Some.app>+# scripts/notarize.sh <path/to/Some.app | path/to/Some.dmg>## Env: BRIDGEPLAY_NOTARY_PROFILE notarytool keychain profile (default "bridgeplay-notary"),# created once with `xcrun notarytool store-credentials`.@@ -11,41 +12,60 @@ set -eudie() { echo "==> $*" >&2; exit 1; }-[ "$#" -eq 1 ] && [ -d "$1" ] || die "usage: $0 <path/to/Some.app>"-app=$1+[ "$#" -eq 1 ] && [ -e "$1" ] || die "usage: $0 <path/to/Some.app | path/to/Some.dmg>"+target=$1profile=${BRIDGEPLAY_NOTARY_PROFILE:-bridgeplay-notary}+case "$target" in+ *.dmg) kind=dmg ;;+ *.app) kind=app ;;+ *) die "$target is neither an .app nor a .dmg" ;;+esac-# Apple refuses anything without a Developer ID, the hardened runtime and a secure-# timestamp; checking here fails in seconds instead of after the upload.-codesign --verify --strict --deep "$app" || die "$app is not validly signed"-info=$(codesign -dvv "$app" 2>&1)+# Apple refuses anything without a Developer ID and a secure timestamp (and, for code, the+# hardened runtime); checking here fails in seconds instead of after the upload.+deep=""+[ "$kind" = dmg ] || deep=--deep+# shellcheck disable=SC2086 # deep is empty or one flag+codesign --verify --strict $deep "$target" || die "$target is not validly signed"+info=$(codesign -dvv "$target" 2>&1)printf '%s\n' "$info" | grep -q '^Authority=Developer ID Application: ' \- || die "$app is not signed with a Developer ID Application certificate"-printf '%s\n' "$info" | grep -q '^Timestamp=' || die "$app has no secure timestamp (codesign --timestamp)"-codesign -d --verbose=1 "$app" 2>&1 | grep -q 'flags=.*runtime' \- || die "$app does not have the hardened runtime (codesign --options runtime)"+ || die "$target is not signed with a Developer ID Application certificate"+printf '%s\n' "$info" | grep -q '^Timestamp=' || die "$target has no secure timestamp (codesign --timestamp)"+if [ "$kind" = app ]; then+ codesign -d --verbose=1 "$target" 2>&1 | grep -q 'flags=.*runtime' \+ || die "$target does not have the hardened runtime (codesign --options runtime)"+fiwork=$(mktemp -d)trap 'rm -rf "$work"' EXIT-zip="$work/$(basename "$app" .app).zip"-ditto -c -k --keepParent "$app" "$zip"+# notarytool takes a disk image as it is; an app goes up as a zip.+upload=$target+if [ "$kind" = app ]; then+ upload="$work/$(basename "$target" .app).zip"+ ditto -c -k --keepParent "$target" "$upload"+fi-echo "==> notarizing $(basename "$app") (profile $profile), usually a few minutes"+echo "==> notarizing $(basename "$target") (profile $profile), usually a few minutes"result="$work/result.json"-xcrun notarytool submit "$zip" --keychain-profile "$profile" --wait --output-format json >"$result" \+xcrun notarytool submit "$upload" --keychain-profile "$profile" --wait --output-format json >"$result" \|| { cat "$result" >&2; die "notarytool submit failed"; }id=$(plutil -extract id raw -o - "$result" 2>/dev/null || true)status=$(plutil -extract status raw -o - "$result" 2>/dev/null || true)if [ "$status" != "Accepted" ]; then# The log names each file Apple rejected and why.[ -z "$id" ] || xcrun notarytool log "$id" --keychain-profile "$profile" >&2 || true- die "notarization of $app: ${status:-no status} (submission ${id:-unknown})"+ die "notarization of $target: ${status:-no status} (submission ${id:-unknown})"fiecho "==> notarized (submission $id)"-xcrun stapler staple "$app" >/dev/null || die "could not staple the ticket to $app"-xcrun stapler validate "$app" >/dev/null || die "the stapled ticket on $app does not validate"+xcrun stapler staple "$target" >/dev/null || die "could not staple the ticket to $target"+xcrun stapler validate "$target" >/dev/null || die "the stapled ticket on $target does not validate"# What Gatekeeper decides for a downloaded copy.-spctl --assess --type execute -vv "$app" 2>&1 | grep -q 'source=Notarized Developer ID' \- || die "Gatekeeper does not accept $app as Notarized Developer ID"+if [ "$kind" = app ]; then+ assess=$(spctl --assess --type execute -vv "$target" 2>&1 || true)+else+ assess=$(spctl --assess --type open --context context:primary-signature -vv "$target" 2>&1 || true)+fi+printf '%s\n' "$assess" | grep -q 'source=Notarized Developer ID' \+ || die "Gatekeeper does not accept $target as Notarized Developer ID"echo "==> stapled; Gatekeeper: Notarized Developer ID"diff --git a/scripts/package-dmg.sh b/scripts/package-dmg.shnew file mode 100755index 0000000..2c7f7dc--- /dev/null+++ b/scripts/package-dmg.sh@@ -0,0 +1,73 @@+#!/bin/sh+# Package a built Bridgeplay.app as Bridgeplay.dmg: the app and an Applications link in a+# window with installer/dmg/background.tiff, so people drag the app across and open it.+# The app's Setup Assistant does the rest. See docs/RELEASING.md.+#+# scripts/package-dmg.sh <path/to/Bridgeplay.app> <out.dmg>+#+# A Developer ID identity (BRIDGEPLAY_SIGN_IDENTITY) signs the image, and the image is+# notarized and stapled (scripts/notarize.sh) unless BRIDGEPLAY_DMG_NOTARIZE=0. Any other+# identity leaves it unsigned, for local builds and dry runs.+#+# The window layout is a .DS_Store written by dmgbuild (pinned below), so building needs no+# Finder scripting. It is installed once into out/dmgbuild-venv.++set -eu++die() { echo "==> $*" >&2; exit 1; }++[ "$#" -eq 2 ] && [ -d "$1" ] || die "usage: $0 <path/to/Bridgeplay.app> <out.dmg>"+repo=$(cd "$(dirname "$0")/.." && pwd)+app=$(cd "$(dirname "$1")" && pwd)/$(basename "$1")+out=$2+identity=${BRIDGEPLAY_SIGN_IDENTITY:--}+background=$repo/installer/dmg/background.tiff+[ -f "$background" ] || die "no $background; run installer/dmg/render-background.sh"+[ "$(basename "$app")" = Bridgeplay.app ] || die "$app is not Bridgeplay.app"++dmgbuild_version=1.6.7+venv=$repo/out/dmgbuild-venv+if [ "$("$venv/bin/python3" -I -c 'import importlib.metadata as m; print(m.version("dmgbuild"))' 2>/dev/null)" != "$dmgbuild_version" ]; then+ echo "==> installing dmgbuild $dmgbuild_version into $venv"+ rm -rf "$venv"+ python3 -m venv "$venv"+ "$venv/bin/pip" -q install "dmgbuild==$dmgbuild_version" || die "could not install dmgbuild"+fi++work=$(mktemp -d)+trap 'rm -rf "$work"' EXIT+settings=$work/settings.py+# Icon centres match the two slots in background.html.+cat >"$settings" <<PYTHON+files = [$(printf '%s' "$app" | python3 -I -c 'import json,sys; print(json.dumps(sys.stdin.read()))')]+symlinks = {"Applications": "/Applications"}+background = $(printf '%s' "$background" | python3 -I -c 'import json,sys; print(json.dumps(sys.stdin.read()))')+format = "UDZO"+filesystem = "APFS"+window_rect = ((200, 160), (660, 400))+default_view = "icon-view"+show_status_bar = False+show_tab_view = False+show_toolbar = False+show_pathbar = False+show_sidebar = False+icon_size = 112+text_size = 13+icon_locations = {"Bridgeplay.app": (165, 200), "Applications": (495, 200)}+hide_extension = ["Bridgeplay.app"]+PYTHON++mkdir -p "$(dirname "$out")"+rm -f "$out"+"$venv/bin/dmgbuild" -s "$settings" Bridgeplay "$out" >"$work/dmgbuild.log" 2>&1 \+ || { cat "$work/dmgbuild.log" >&2; die "dmgbuild failed"; }++case "$identity" in+ "Developer ID Application: "*)+ codesign --sign "$identity" --timestamp "$out"+ if [ "${BRIDGEPLAY_DMG_NOTARIZE:-1}" = 1 ]; then+ "$repo/scripts/notarize.sh" "$out"+ fi+ ;;+esac+echo "==> $out ($(du -h "$out" | cut -f1 | tr -d ' '))"diff --git a/scripts/release-local.sh b/scripts/release-local.shindex 6b853ab..346c2c0 100755--- a/scripts/release-local.sh+++ b/scripts/release-local.sh@@ -276,13 +276,20 @@ elsescripts/package-native-installer.shficp out/Bridgeplay-Setup.zip "$out/bridgeplay/Bridgeplay-Setup.zip"+# The download bridgeplay.dev links to: the app in a disk image people drag to Applications.+# Notarized and stapled on its own; a dry run builds it unsigned.+if [ "$dry_run" -eq 1 ]; then+ BRIDGEPLAY_SIGN_IDENTITY=- scripts/package-dmg.sh "$app" "$out/bridgeplay/Bridgeplay.dmg"+else+ scripts/package-dmg.sh "$app" "$out/bridgeplay/Bridgeplay.dmg"+fititle="Bridgeplay $version"body=$(printf '%s\n\nBuild %s, based on NotProton %s.\n' "$notes" "$build" "$upstream")echo "==> $title (build $build), notes since ${previous:-the beginning}:"printf '%s\n' "$notes" | sed 's/^/ /'run gh release create "$tag" "$out/bridgeplay/Bridgeplay.zip" "$out/bridgeplay/appcast.xml" \- "$out/bridgeplay/Bridgeplay-Setup.zip" \+ "$out/bridgeplay/Bridgeplay-Setup.zip" "$out/bridgeplay/Bridgeplay.dmg" \-R "$slug" --target "$(git rev-parse HEAD)" --title "$title" --notes "$body" --latestif [ "$legacy" -eq 1 ]; then# Only a carrier for the feed: the tag goes on that repository's default branch, since