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(installer): download Steam from Valve and package the zip reproducibly
raymondchins89a80035fb18
diff --git a/.gitignore b/.gitignoreindex e1bbfb9..16ebfc1 100644--- a/.gitignore+++ b/.gitignore@@ -30,3 +30,18 @@ installer/gptk/installer/cache/installer/steam.dmginstaller/GPTK-License.rtf+installer/*.zip++# Secrets and signing material: never commit these.+.env*+*.p12+*.pem+*.key+*.cer+*.keychain+*.keychain-db+*.mobileprovision+# Sparkle EdDSA private key exported with generate_keys -x.+*sparkle*private*+*sparkle_key*+*.ed25519diff --git a/README.md b/README.mdindex 44fae0b..f516278 100644--- a/README.md+++ b/README.md@@ -60,10 +60,12 @@ Also running on the same setup: Street Fighter 6, Mortal Kombat 1, The Last of U## Install-1. **Download the installer** from [bridgeplay.dev](https://bridgeplay.dev). About 660 MB, with the engine and graphics already inside.-2. **Open `Install.command`.** It puts everything in place. No terminal.+1. **Download the installer** from [bridgeplay.dev](https://bridgeplay.dev). About 570 MB, with the engine and graphics already inside.+2. **Open `Install.command`.** macOS blocks it the first time: open **System Settings > Privacy & Security**, scroll down, click **Open Anyway** and confirm with your password or Touch ID. It needs an admin account, puts everything in place and downloads Steam from Valve if it is missing.3. **Follow the Setup Assistant**: Rosetta, graphics, Steam sign-in and one permission.-4. **Press Play** on any Windows game in Steam.+4. **Press Play** on any Windows game in Steam. The first time you use a controller, allow Steam's Input Monitoring request.++The installer includes Apple's Game Porting Toolkit redistributables under Apple's license, which allows non-commercial distribution only. Bridgeplay is free and non-commercial.<p align="center"><img src="docs/readme/install-v4.png" alt="The Setup Assistant working through Your Mac, Rosetta, Graphics, Steam and Set Up" width="100%">@@ -80,22 +82,25 @@ Also running on the same setup: Street Fighter 6, Mortal Kombat 1, The Last of U| Mac | Apple Silicon, M1 or later. Intel Macs are not supported. || macOS | 26 or later || Steam | A Steam account. Windows games install from Steam as usual. |-| Download | About 660 MB. Installing Rosetta 2 and signing in to Steam need internet. |+| Download | About 570 MB. Installing Rosetta 2 and Steam, and signing in to Steam, need internet. |## How it worksBridgeplay runs inside the native macOS Steam client and registers itself as a Steam Play compatibility tool. Under the hood:- **Engine:** CodeWeavers' open-source WineCX 11.17 with MSync, running under Rosetta 2.-- **Graphics:** Apple's Game Porting Toolkit 4.0 beta 3 (D3DMetal), linked locally from Apple's download and never redistributed in this repository. DXMT and DXVK are available for games that prefer them.+- **Graphics:** Apple's Game Porting Toolkit 4.0 beta 3 (D3DMetal). It is not stored in this repository; the installer ships its redistributables under Apple's non-commercial license (see Install). DXMT and DXVK are available for games that prefer them.- **Extras:** NVAPI/NGX routing for DLSS on MetalFX, in-process frame generation on `CAMetalLayer`, per-game Game Mode, Retina back buffers and a controller layer for HID pads.-Building from source: see [docs/DEVELOPING.md](docs/DEVELOPING.md) and [docs/BUILD-LOCAL.md](docs/BUILD-LOCAL.md). The one-click installer lives in [`installer/`](installer/).+Building from source: see [docs/DEVELOPING.md](docs/DEVELOPING.md) and [docs/BUILD-LOCAL.md](docs/BUILD-LOCAL.md). The one-click installer lives in [`installer/`](installer/) and is packaged by `scripts/package-installer.sh`.## Credits+Bridgeplay is a fork of [NotProton](https://github.com/NotProtonNot/NotProton) (GPL-3.0), built on CodeWeavers' [WineCX](https://www.codeweavers.com/crossover) and Apple's [Game Porting Toolkit](https://developer.apple.com/games/game-porting-toolkit/). The DualSense Bluetooth bridge and Steam rumble forwarding come from [sn0wst0rm's NotProton fork](https://github.com/sn0wst0rm/NotProton). It also uses [Dobby](https://github.com/jmpews/Dobby) (Apache-2.0), [Sparkle](https://sparkle-project.org) (MIT), [DXMT](https://github.com/3Shain/dxmt) and [DXVK-macOS](https://github.com/Gcenx/DXVK-macOS).++## License-Bridgeplay is a fork of [NotProton](https://github.com/NotProtonNot/NotProton) (GPL-3.0), built on CodeWeavers' [WineCX](https://www.codeweavers.com/crossover) and Apple's [Game Porting Toolkit](https://developer.apple.com/games/game-porting-toolkit/).+Bridgeplay is licensed under the [GPL-3.0](LICENSE). Third-party licenses, and the source for the patched Wine files the app ships (LGPL-2.1-or-later), are listed in [NOTICE](NOTICE).<p><a href="https://github.com/raymondchins"><img src="https://github.com/raymondchins.png?size=64" width="32" height="32" alt="" align="left" style="border-radius:50%"></a>diff --git a/installer/BACA DULU.txt b/installer/BACA DULU.txtindex 772a522..2799606 100644--- a/installer/BACA DULU.txt+++ b/installer/BACA DULU.txt@@ -1,17 +1,30 @@Cara pasang Bridgeplay-Butuh: Mac Apple Silicon (M1 atau lebih baru), macOS 26 atau lebih baru, internet.+Butuh:+- Mac Apple Silicon (M1 atau lebih baru) dengan macOS 26 atau lebih baru.+- Akun admin Mac (installer menulis ke folder Applications).+- Internet (untuk Rosetta dan Steam).-1. Klik kanan "Install.command", pilih Open, lalu Open lagi.- (Cuma pertama kali. Kalau macOS tetap memblokir: System Settings > Privacy & Security,- scroll ke bawah, klik "Open Anyway".)-2. Bridgeplay terbuka dengan Setup Assistant. Ikuti saja:+1. Klik dua kali "Install.command". macOS akan memblokirnya karena belum+ ditandatangani Apple. Klik Done.+2. Buka System Settings > Privacy & Security. Scroll ke bawah sampai bagian+ Security, lalu klik "Open Anyway" di samping "Install.command".+3. Klik "Open Anyway" sekali lagi, lalu konfirmasi dengan password Mac atau+ Touch ID. Installer berjalan di jendela Terminal. Kalau Steam belum ada,+ installer mengunduhnya langsung dari Valve.+4. Bridgeplay terbuka dengan Setup Assistant. Ikuti saja:- Your Mac: klik Install di Rosetta kalau diminta (minta password Mac).- Graphics: sudah otomatis, klik Continue.- Steam: login ke akun Steam kamu.- - Set Up: klik Set Up. Kalau diminta izin App Management, nyalakan Bridgeplay- di jendela Settings yang terbuka. Setup lanjut sendiri.-3. Klik Open Steam, pilih game Windows, Install, Play.+ - Set Up: klik Set Up. Kalau diminta izin App Management, nyalakan+ Bridgeplay di jendela Settings yang terbuka. Setup lanjut sendiri.+5. Klik Open Steam, pilih game Windows, Install, Play.-Game Porting Toolkit (folder gptk) adalah milik Apple dan hanya boleh dipakai-non-komersial. Lisensinya ada di GPTK-License.rtf.+Controller: pertama kali controller dipakai, Steam minta izin Input+Monitoring. Klik Allow (atau nyalakan Steam di System Settings > Privacy &+Security > Input Monitoring).++Lisensi: Bridgeplay gratis dan non-komersial, berlisensi GPL-3.0 (lihat+LICENSE dan NOTICE). Installer ini menyertakan redistributable Game Porting+Toolkit milik Apple (folder gptk) di bawah lisensi Apple, yang hanya+mengizinkan distribusi non-komersial. Lisensinya ada di GPTK-License.rtf.diff --git a/installer/Install.command b/installer/Install.commandindex b701ff2..eccfd44 100755--- a/installer/Install.command+++ b/installer/Install.command@@ -1,8 +1,9 @@#!/bin/bash# Bridgeplay one-click installer.# Copies Bridgeplay, Apple's Game Porting Toolkit (D3DMetal), the WineCX engine (no download)-# and the default configs, then opens Bridgeplay, whose Setup Assistant does the rest:-# Rosetta, Steam, sign-in, the App Management permission and the Steam setup.+# and the default configs, installs Steam from Valve's CDN when it is missing, then opens+# Bridgeplay, whose Setup Assistant does the rest: Rosetta, sign-in, the App Management+# permission and the Steam setup. Assembled into a zip by scripts/package-installer.sh.set -uo pipefailhere="$(cd "$(dirname "$0")" && pwd)"@@ -11,11 +12,26 @@ support="$HOME/Library/Application Support/notproton"say() { printf '\n\033[1;32m==>\033[0m %s\n' "$*"; }die() { printf '\n\033[1;31mGagal:\033[0m %s\n' "$*" >&2; read -r -p "Tekan Enter untuk menutup..." _; exit 1; }+# Valve's official macOS Steam installer, and the Team ID Valve signs Steam.app with.+steam_url="https://cdn.cloudflare.steamstatic.com/client/installer/steam.dmg"+valve_team="MXGJJ98X76"+steam_tmp=""+steam_mnt=""+# shellcheck disable=SC2329 # runs from the EXIT trap+cleanup() {+ if [ -n "$steam_mnt" ]; then hdiutil detach -quiet "$steam_mnt" >/dev/null 2>&1; fi+ if [ -n "$steam_tmp" ]; then rm -rf "$steam_tmp"; fi+ return 0+}+trap cleanup EXIT+xattr -dr com.apple.quarantine "$here" 2>/dev/null || true[ "$(sysctl -n hw.optional.arm64 2>/dev/null)" = "1" ] || die "Mac ini bukan Apple Silicon (M1/M2/M3/...). Bridgeplay tidak jalan di Mac Intel."major="$(sw_vers -productVersion | cut -d. -f1)"[ "$major" -ge 26 ] || die "Butuh macOS 26 atau lebih baru (sekarang $(sw_vers -productVersion)). Update macOS dulu."+[ -w /Applications ] || die "Akun ini tidak bisa menulis ke folder Applications. Login dengan akun admin, lalu jalankan Install.command lagi."+[ -d "$here/Bridgeplay.app" ] || die "Bridgeplay.app tidak ada di folder installer. Ekstrak ulang zip-nya, lalu coba lagi."say "Memasang Bridgeplay..."osascript -e 'tell application id "com.bridgeplay.Bridgeplay" to quit' >/dev/null 2>&1 || true@@ -24,12 +40,26 @@ ditto "$here/Bridgeplay.app" /Applications/Bridgeplay.app || die "Bridgeplay gagxattr -dr com.apple.quarantine /Applications/Bridgeplay.app 2>/dev/null || trueif [ ! -d /Applications/Steam.app ]; then+ say "Steam belum terpasang. Mengunduh installer Steam resmi dari Valve..."+ steam_tmp="$(mktemp -d)" || die "Folder sementara tidak bisa dibuat."+ dmg="$steam_tmp/steam.dmg"+ curl -fL --retry 3 --connect-timeout 20 --progress-bar -o "$dmg" "$steam_url" \+ || die "Steam gagal diunduh. Pastikan Mac tersambung ke internet, lalu jalankan Install.command lagi."+ # A UDIF disk image ends with a 512-byte trailer that starts with "koly".+ [ "$(tail -c 512 "$dmg" | head -c 4)" = "koly" ] \+ || die "File yang diunduh bukan installer Steam (bukan DMG). Coba lagi nanti."say "Memasang Steam..."- mnt="$(mktemp -d)"- hdiutil attach -nobrowse -readonly -quiet -mountpoint "$mnt" "$here/steam.dmg" || die "Installer Steam tidak bisa dibuka."- ditto "$mnt/Steam.app" /Applications/Steam.app; ok=$?- hdiutil detach -quiet "$mnt" 2>/dev/null; rmdir "$mnt" 2>/dev/null- [ $ok -eq 0 ] || die "Steam gagal disalin ke Applications."+ steam_mnt="$steam_tmp/mnt"+ mkdir "$steam_mnt"+ hdiutil attach -nobrowse -readonly -noautoopen -quiet -mountpoint "$steam_mnt" "$dmg" </dev/null \+ || { steam_mnt=""; die "Installer Steam tidak bisa dibuka."; }+ if ! codesign --verify --strict "$steam_mnt/Steam.app" 2>/dev/null \+ || ! codesign -dv "$steam_mnt/Steam.app" 2>&1 | grep -qx "TeamIdentifier=$valve_team"; then+ die "Steam yang diunduh tidak ditandatangani Valve. Instalasi dibatalkan."+ fi+ ditto "$steam_mnt/Steam.app" /Applications/Steam.app || die "Steam gagal disalin ke Applications."+ hdiutil detach -quiet "$steam_mnt" >/dev/null 2>&1+ steam_mnt=""xattr -dr com.apple.quarantine /Applications/Steam.app 2>/dev/null || truefidiff --git a/installer/README.md b/installer/README.mdindex b8347bd..cfa3c35 100644--- a/installer/README.md+++ b/installer/README.md@@ -1,17 +1,31 @@# Installer`Install.command` installs the app, Apple's Game Porting Toolkit, the WineCX engine and the-default configs from the folder it sits in, then opens the app's Setup Assistant.+default configs from the folder it sits in, downloads Steam from Valve's CDN when+`/Applications/Steam.app` is missing, then opens the app's Setup Assistant.-Assembled next to it at packaging time, never committed:+Build the zip with:-| Path | Source |+ make app+ scripts/package-installer.sh # writes out/Bridgeplay-Installer.zip++The script stages `out/installer/Bridgeplay/` and fails if a piece is missing or an engine+archive does not match its pin in `FreeEngine*.swift`:++| Path in the zip | Source ||---|---|-| `Bridgeplay.app` | `build/Bridgeplay.app` from `scripts/build-local.sh` |-| `gptk/` | `redist/lib` of Apple's Game Porting Toolkit DMG (Apple license, non-commercial) |-| `GPTK-License.rtf` | From the same DMG |-| `cache/` | `~/Library/Caches/notproton` after an engine install (files matching the pins) |-| `steam.dmg` | Valve's macOS Steam installer |+| `Bridgeplay.app` | `out/Bridgeplay.app` from `make app` |+| `Install.command`, `BACA DULU.txt`, `README.txt`, `config/` | this folder |+| `LICENSE`, `LICENSE.*`, `NOTICE` | repository root |+| `gptk/` | `~/Library/Application Support/notproton/gptk` (`redist/lib` of Apple's Game Porting Toolkit DMG) |+| `GPTK-License.rtf` | `gptk/License.rtf` from the same DMG |+| `cache/engines/` | the pinned WineCX runtime, DXMT and DXVK archives from `~/Library/Caches/notproton/engines` |++Never shipped: Valve's Steam client and the Steam packages in `valve-packages/` (the app+downloads those from Valve's CDN), and GPTK is never committed. GPTK's `/redist` files are+Apple software that Apple allows to be redistributed for non-commercial use only; Bridgeplay+is free and non-commercial.-`config/` holds the bundled `gamefixes` and `gamecontrollerdb.txt`. `BACA DULU.txt` is the-user guide shipped in the zip.+`BACA DULU.txt` (Indonesian) and `README.txt` (English) are the user guides in the zip. macOS+15 and later no longer opens unsigned scripts from right-click > Open, so step 1 sends users to+System Settings > Privacy & Security > Open Anyway.diff --git a/installer/README.txt b/installer/README.txtnew file mode 100644index 0000000..509295e--- /dev/null+++ b/installer/README.txt@@ -0,0 +1,30 @@+Installing Bridgeplay++You need:+- An Apple Silicon Mac (M1 or later) with macOS 26 or later.+- An administrator account (the installer writes to Applications).+- Internet (for Rosetta and Steam).++1. Double-click "Install.command". macOS blocks it because Apple has not+ notarized it. Click Done.+2. Open System Settings > Privacy & Security. Scroll down to Security and+ click "Open Anyway" next to "Install.command".+3. Click "Open Anyway" again and confirm with your Mac password or Touch ID.+ The installer runs in a Terminal window. If Steam is missing, it downloads+ Steam directly from Valve.+4. Bridgeplay opens with its Setup Assistant. Follow it:+ - Your Mac: click Install for Rosetta if asked (needs your Mac password).+ - Graphics: already done, click Continue.+ - Steam: sign in to your Steam account.+ - Set Up: click Set Up. If asked for App Management, turn on Bridgeplay in+ the Settings window that opens. Setup then continues by itself.+5. Click Open Steam, pick a Windows game, Install, Play.++Controllers: the first time you use a controller, Steam asks for Input+Monitoring. Click Allow (or turn on Steam in System Settings > Privacy &+Security > Input Monitoring).++Licensing: Bridgeplay is licensed under GPL-3.0 (see LICENSE and NOTICE). The installer includes Apple's Game Porting Toolkit+redistributables under Apple's license, which allows non-commercial+distribution only. Bridgeplay is free and non-commercial. Apple's license is+in GPTK-License.rtf.diff --git a/scripts/package-installer.sh b/scripts/package-installer.shnew file mode 100755index 0000000..76499bc--- /dev/null+++ b/scripts/package-installer.sh@@ -0,0 +1,120 @@+#!/bin/sh+# Assemble the one-click installer zip, out/Bridgeplay-Installer.zip.+#+# scripts/package-installer.sh+#+# Takes out/Bridgeplay.app (make app), the engine archives from this Mac's engine cache,+# Apple's Game Porting Toolkit from this Mac's support folder, and installer/ plus the+# licence files from the repository. Engine archives are checked against the pins in+# FreeEngine*.swift. Nothing else from the cache is shipped: Valve's packages and Steam+# itself are downloaded on the user's Mac from Valve. GPTK is never committed.+#+# Overridable: APP (default out/Bridgeplay.app), ENGINE_CACHE (default+# ~/Library/Caches/notproton), GPTK_DIR (default ~/Library/Application Support/notproton/gptk)++set -eu++repo=$(cd "$(dirname "$0")/.." && pwd)+cd "$repo"++APP=${APP:-$repo/out/Bridgeplay.app}+ENGINE_CACHE=${ENGINE_CACHE:-$HOME/Library/Caches/notproton}+GPTK_DIR=${GPTK_DIR:-$HOME/Library/Application Support/notproton/gptk}+stage_root=$repo/out/installer+stage=$stage_root/Bridgeplay+zip=$repo/out/Bridgeplay-Installer.zip+models=app/Sources/NotProtonApp/Model++die() {+ echo "==> $*" >&2+ exit 1+}++# pin_after FILE PATTERN KEY: the first `KEY: "value"` at or after the first line+# matching PATTERN in FILE.+pin_after() {+ awk -v pat="$2" -v key="$3" '+ !found && index($0, pat) { found = 1 }+ found && match($0, key ": \"[^\"]*\"") {+ v = substr($0, RSTART, RLENGTH); sub(/^[^"]*"/, "", v); sub(/"$/, "", v)+ print v; exit+ }' "$1"+}++# need_file PATH SHA256: PATH exists and matches its pin.+need_file() {+ [ -n "$2" ] || die "no pin found for $1 in $models"+ [ -f "$1" ] || die "missing $1 (install the engine in the app once so the cache holds it)"+ actual=$(shasum -a 256 "$1" | cut -d' ' -f1)+ [ "$actual" = "$2" ] || die "$1 does not match its pin ($actual, want $2)"+}++# --- the app ----------------------------------------------------------------------++[ -d "$APP" ] || die "missing $APP, run: make app"+codesign --verify --strict "$APP" || die "$APP fails codesign --verify"+for f in Assets.car Bridgeplay.icns LICENSE NOTICE; do+ [ -s "$APP/Contents/Resources/$f" ] || die "$APP has no Contents/Resources/$f, rebuild with: make app"+done++# --- engine archives, from the pins -----------------------------------------------++winecx_swift=$models/FreeEngineWinecx.swift+engine_swift=$models/FreeEngine.swift+current=$(sed -n 's/^ *static let current = \(v[0-9]*\)$/\1/p' "$winecx_swift")+[ -n "$current" ] || die "cannot find FreeEngineWinecx.current in $winecx_swift"+runtime=$(pin_after "$winecx_swift" "static let $current = WinecxRelease(" runtime)+winecx_archive=$(pin_after "$winecx_swift" "static let $current = WinecxRelease(" archive)+winecx_sha=$(pin_after "$winecx_swift" "static let $current = WinecxRelease(" sha256)+dxmt_archive=$(pin_after "$engine_swift" "static let dxmt = RendererRelease(" archive)+dxmt_sha=$(pin_after "$engine_swift" "static let dxmt = RendererRelease(" sha256)+dxvk_archive=$(pin_after "$engine_swift" "dxvk: BackendRelease(" archive)+dxvk_sha=$(pin_after "$engine_swift" "dxvk: BackendRelease(" sha256)+[ -n "$runtime" ] && [ -n "$winecx_archive" ] && [ -n "$dxmt_archive" ] && [ -n "$dxvk_archive" ] \+ || die "cannot read the engine pins from $models"++winecx_rel=engines/winecx-$runtime/$winecx_archive+echo "==> checking engine archives in $ENGINE_CACHE against the pins"+need_file "$ENGINE_CACHE/$winecx_rel" "$winecx_sha"+need_file "$ENGINE_CACHE/engines/$dxmt_archive" "$dxmt_sha"+need_file "$ENGINE_CACHE/engines/$dxvk_archive" "$dxvk_sha"++# --- Game Porting Toolkit ---------------------------------------------------------++[ -d "$GPTK_DIR" ] || die "missing $GPTK_DIR (Game Porting Toolkit redist/lib, set up in the app first)"+[ -s "$GPTK_DIR/License.rtf" ] || die "missing $GPTK_DIR/License.rtf, Apple's licence must ship with GPTK"+[ -d "$GPTK_DIR/external/D3DMetal.framework" ] || die "missing $GPTK_DIR/external/D3DMetal.framework"+[ -d "$GPTK_DIR/wine" ] || die "missing $GPTK_DIR/wine"++# --- stage ------------------------------------------------------------------------++echo "==> staging $stage"+rm -rf "$stage_root" "$zip"+mkdir -p "$stage/cache/engines/winecx-$runtime"++ditto "$APP" "$stage/Bridgeplay.app"+cp installer/Install.command "installer/BACA DULU.txt" installer/README.txt "$stage/"+chmod 755 "$stage/Install.command"+cp LICENSE LICENSE.* NOTICE "$stage/"+cp "$GPTK_DIR/License.rtf" "$stage/GPTK-License.rtf"+rsync -a --exclude .DS_Store installer/config/ "$stage/config/"+rsync -a --exclude .DS_Store "$GPTK_DIR/" "$stage/gptk/"+cp "$ENGINE_CACHE/$winecx_rel" "$stage/cache/$winecx_rel"+cp "$ENGINE_CACHE/engines/$dxmt_archive" "$ENGINE_CACHE/engines/$dxvk_archive" "$stage/cache/engines/"++# Valve's software is downloaded from Valve on the user's Mac, never shipped.+unwanted=$(find "$stage" \( -name valve-packages -o -name 'steam.dmg' -o -name 'Steam.app' \+ -o -name '*.p12' -o -name '*.pem' -o -name '*.key' -o -name '.env*' \) -print)+[ -z "$unwanted" ] || die "refusing to ship: $unwanted"++# --- zip --------------------------------------------------------------------------++echo "==> writing $zip"+ditto -c -k --keepParent "$stage" "$zip"++echo "==> contents"+(cd "$stage_root" && find Bridgeplay -maxdepth 3 ! -path 'Bridgeplay/Bridgeplay.app/*' \+ ! -path 'Bridgeplay/gptk/*/*' | sort | sed 's/^/ /')+echo "==> sizes"+(cd "$stage" && du -sh -- * | sed 's/^/ /')+echo "==> $zip $(du -h "$zip" | cut -f1) ($(stat -f %z "$zip") bytes)"