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): ship the native installer as a ZIP with a READ ME FIRST guide, and install GPTK, the engine and Steam from the signed installer package
raymondchins7f48521c84bb
diff --git a/.github/workflows/app.yml b/.github/workflows/app.ymlindex 502ed52..b488667 100644--- a/.github/workflows/app.yml+++ b/.github/workflows/app.yml@@ -153,7 +153,7 @@ jobs:run: |mkdir -p out/artifactditto -c -k --keepParent out/Bridgeplay.app out/artifact/Bridgeplay.zip- cp out/Bridgeplay-Installer.dmg out/artifact/+ cp out/Bridgeplay-Setup.zip out/artifact/- name: Upload the app bundleuses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2diff --git a/NOTICE b/NOTICEindex c4f44f7..81f8f5b 100644--- a/NOTICE+++ b/NOTICE@@ -140,7 +140,8 @@ https://github.com/sparkle-project/Sparkle/blob/2.10.0/LICENSEThe app's interface uses the Geist and Unbounded typefaces, bundled inapp/Sources/BridgeplayUI/Resources/Fonts/ under the SIL Open Font License 1.1-(OFL-Geist.txt, OFL-Unbounded.txt there). Game covers shown in the app are read+(OFL-Geist.txt, OFL-Unbounded.txt there). The native installer's READ ME FIRST.html+embeds the same Geist font. Game covers shown in the app are readfrom the user's own Steam library cache or Steam's CDN at run time; none shipwith Bridgeplay.diff --git a/app/Sources/BridgeplayInstaller/InstallerMessage.swift b/app/Sources/BridgeplayInstaller/InstallerMessage.swiftindex df4aa91..f3b209d 100644--- a/app/Sources/BridgeplayInstaller/InstallerMessage.swift+++ b/app/Sources/BridgeplayInstaller/InstallerMessage.swift@@ -20,6 +20,7 @@ enum InstallerMessage {case .installLocked: return tr("Another installation is in progress, or the installer lock cannot be accessed. Try again after it finishes.")case .appValidation: return tr("The downloaded application did not pass validation. Your installed application has been kept.")case .replacementFailure: return tr("The application could not be replaced. Check the app and its previous-version backup in Applications before trying again.")+ case .componentsFailure(let detail): return tr("Bridgeplay is installed, but Steam, Apple's graphics or the engine could not be set up. Try again.") + "\n\n" + detail}}}diff --git a/app/Sources/BridgeplayInstaller/InstallerModel.swift b/app/Sources/BridgeplayInstaller/InstallerModel.swiftindex 1ed16ac..a9bd034 100644--- a/app/Sources/BridgeplayInstaller/InstallerModel.swift+++ b/app/Sources/BridgeplayInstaller/InstallerModel.swift@@ -18,6 +18,12 @@ final class InstallerModel {var openBridgeplay = truevar removeInstaller = truevar finishing = false+ // Steam, GPTK and the engine, when this Mac lacks them (InstallerComponents).+ var components: InstallerComponents?+ var settingUp = false+ var componentStatus: String?+ // Bytes already downloaded in earlier steps, so progress counts toward one total.+ private var downloadedBefore: Int64 = 0let preview: String?private var release: InstallerRelease?private var operation: Task<Void, Never>?@@ -82,12 +88,16 @@ final class InstallerModel {try Task.checkCancellation()release = fetchedversion = fetched.shortVersion- total = fetched.archiveLength+ components = InstallerComponents.needed() ? try await InstallerComponents.latest() : nil+ try Task.checkCancellation()let state = try service.state(for: fetched)+ total = (state.isCurrent ? 0 : fetched.archiveLength) + (components?.length ?? 0)switch state {case .notInstalled: installedVersion = nil; stage = .reviewcase .updateAvailable(_, let current, _): installedVersion = current; stage = .review- case .upToDate(_, let current): installedVersion = current; version = current; isCurrent = true; stage = .done+ case .upToDate(_, let current):+ installedVersion = current; version = current; isCurrent = true+ stage = components == nil ? .done : .review}} catch is CancellationError {stage = .review@@ -101,26 +111,46 @@ final class InstallerModel {stage = .downloadingfailure = nilreceived = 0+ downloadedBefore = 0progress = nillet work = FileManager.default.temporaryDirectory.appendingPathComponent("bridgeplay-install-\(UUID().uuidString)")defer { try? FileManager.default.removeItem(at: work) }do {try FileManager.default.createDirectory(at: work, withIntermediateDirectories: true)- let archive = try await release.download(to: work) { [weak self] value in+ let report: @Sendable (InstallerDownloadProgress) -> Void = { [weak self] value inTask { @MainActor inguard let self, self.stage == .downloading else { return }- self.received = value.received- self.total = value.total- self.progress = value.total.flatMap { $0 > 0 ? Double(value.received) / Double($0) : nil }+ self.received = self.downloadedBefore + value.received+ self.progress = self.total.flatMap { $0 > 0 ? Double(self.received) / Double($0) : nil }}}- try Task.checkCancellation()- stage = .installing- progress = nil- let service = self.service- _ = try await Task.detached(priority: .userInitiated) {- try service.install(release: release, archive: archive)- }.value+ if !isCurrent {+ let archive = try await release.download(to: work, progress: report)+ try Task.checkCancellation()+ stage = .installing+ progress = nil+ let service = self.service+ _ = try await Task.detached(priority: .userInitiated) {+ try service.install(release: release, archive: archive)+ }.value+ }+ if let components {+ settingUp = true+ downloadedBefore = isCurrent ? 0 : release.archiveLength+ stage = .downloading+ let archive = try await components.download(to: work, progress: report)+ try Task.checkCancellation()+ stage = .installing+ progress = nil+ componentStatus = nil+ try await Task.detached(priority: .userInitiated) {+ try InstallerComponents.install(archive: archive, work: work) { line in+ Task { @MainActor [weak self] in self?.componentStatus = Self.status(line) }+ }+ }.value+ self.components = nil+ }+ isCurrent = falsestage = .done} catch is CancellationError {stage = .review@@ -159,6 +189,13 @@ final class InstallerModel {} catch { failure = error.localizedDescription; finishing = false }}+ // Install.command's "==>" steps, in the installer's words.+ nonisolated static func status(_ line: String) -> String? {+ if line.contains("Steam") { return tr("Installing Steam from Valve") }+ if line.contains("Game Porting Toolkit") { return tr("Copying Apple's graphics, the engine and settings") }+ return nil+ }+private func fail(_ error: Error) {failure = InstallerMessage.describe(error)stage = .faileddiff --git a/app/Sources/BridgeplayInstaller/InstallerView.swift b/app/Sources/BridgeplayInstaller/InstallerView.swiftindex 89589d7..3402a16 100644--- a/app/Sources/BridgeplayInstaller/InstallerView.swift+++ b/app/Sources/BridgeplayInstaller/InstallerView.swift@@ -7,9 +7,9 @@ struct InstallerView: View {private var title: String {switch model.stage {case .checking: tr("Check your installation")- case .review: model.updating ? tr("Update Bridgeplay") : tr("Install Bridgeplay")- case .downloading: tr("Downloading Bridgeplay")- case .installing: tr("Installing Bridgeplay")+ case .review: model.isCurrent ? tr("Finish setting up Bridgeplay") : model.updating ? tr("Update Bridgeplay") : tr("Install Bridgeplay")+ case .downloading: model.settingUp ? tr("Downloading graphics and engine") : tr("Downloading Bridgeplay")+ case .installing: model.settingUp ? tr("Setting up Bridgeplay") : tr("Installing Bridgeplay")case .done: model.isCurrent ? tr("Bridgeplay is up to date") : tr("Bridgeplay is ready")case .failed: tr("Installation could not continue")}@@ -66,9 +66,13 @@ struct InstallerView: View {switch model.stage {case .checking: tr("Checking the latest release and the application on this Mac.")case .review: tr("The application goes in Applications. Your settings, game prefixes and saves are kept.")- case .downloading: tr("Only the application is downloaded here. Its signature is checked before installation.")- case .installing: tr("Verifying and replacing the application. Please keep the installer open.")- case .done: tr("Open Bridgeplay to continue setup or check its Status page for component updates. Engine and graphics downloads are handled there.")+ case .downloading: model.settingUp+ ? tr("Apple's Game Porting Toolkit and the WineCX engine. The download is checked against Bridgeplay's signature before anything is installed.")+ : tr("Only the application is downloaded here. Its signature is checked before installation.")+ case .installing: model.settingUp+ ? tr("Installing Steam, Apple's graphics, the engine and the default settings. Please keep the installer open.")+ : tr("Verifying and replacing the application. Please keep the installer open.")+ case .done: tr("Open Bridgeplay to finish setup: Rosetta, Steam sign-in and a couple of standard macOS prompts.")case .failed: tr("Review the details below, then try again. The installer does not remove your game data.")}}@@ -136,14 +140,16 @@ struct InstallerView: View {row(tr("Download"), value: bytes(total), icon: "network")}}- Text(tr("Close Bridgeplay before updating. Steam setup and any required permissions are handled by Bridgeplay after installation."))+ Text(model.components == nil+ ? tr("Close Bridgeplay before updating. Steam setup and any required permissions are handled by Bridgeplay after installation.")+ : tr("Steam, Apple's graphics and the WineCX engine are installed too, since this Mac doesn't have them yet.")).font(BP.sans(12)).foregroundStyle(BP.fg3).fixedSize(horizontal: false, vertical: true)case .downloading, .installing:SetupCard {VStack(alignment: .leading, spacing: 14) {HStack(spacing: 10) {ProgressView().controlSize(.small)- Text(model.stage == .downloading ? tr("Downloading") : tr("Verifying and installing"))+ Text(model.stage == .downloading ? tr("Downloading") : model.componentStatus ?? tr("Verifying and installing")).font(BP.sans(13, .semibold))}if model.stage == .downloading {@@ -163,11 +169,11 @@ struct InstallerView: View {row(tr("Game data"), value: tr("Kept in place"), icon: "externaldrive")}Toggle(tr("Open Bridgeplay"), isOn: $model.openBridgeplay).font(BP.sans(13))- Toggle(tr("Eject installer and move DMG to Trash"), isOn: $model.removeInstaller)- .font(BP.sans(13)).disabled(model.cleanupSource == nil)- if model.cleanupSource == nil {- Text(tr("The source DMG could not be identified. You can eject it and move it to Trash in Finder."))- .font(BP.sans(12)).foregroundStyle(BP.fg3).fixedSize(horizontal: false, vertical: true)+ // Only when run from a DMG. From the ZIP the installer stays in Downloads: moving it+ // to Trash would ask for access to the Downloads folder, one more prompt.+ if model.cleanupSource != nil {+ Toggle(tr("Eject installer and move DMG to Trash"), isOn: $model.removeInstaller)+ .font(BP.sans(13))}case .failed: EmptyView()}@@ -197,7 +203,7 @@ struct InstallerView: View {Spacer()switch model.stage {case .review:- Button(model.updating ? tr("Update") : tr("Install")) { model.start() }+ Button(model.updating && !model.isCurrent ? tr("Update") : tr("Install")) { model.start() }.buttonStyle(.pillLarge).keyboardShortcut(.defaultAction)case .failed:Button(tr("Try Again")) { model.retry() }.buttonStyle(.pillLarge).keyboardShortcut(.defaultAction)diff --git a/app/Sources/BridgeplayInstaller/Resources/Localization/Localizable.xcstrings b/app/Sources/BridgeplayInstaller/Resources/Localization/Localizable.xcstringsindex f11183e..32d3b10 100644--- a/app/Sources/BridgeplayInstaller/Resources/Localization/Localizable.xcstrings+++ b/app/Sources/BridgeplayInstaller/Resources/Localization/Localizable.xcstrings@@ -67,6 +67,22 @@}}},+ "Apple's Game Porting Toolkit and the WineCX engine. The download is checked against Bridgeplay's signature before anything is installed." : {+ "localizations" : {+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Game Porting Toolkit di Apple e il motore WineCX. Il download viene verificato con la firma di Bridgeplay prima di installare qualsiasi cosa."+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Apple 的 Game Porting Toolkit 和 WineCX 引擎。安装前会用 Bridgeplay 的签名校验下载内容。"+ }+ }+ }+ },"Bridgeplay Installer" : {"localizations" : {"it" : {@@ -83,6 +99,22 @@}}},+ "Bridgeplay is installed, but Steam, Apple's graphics or the engine could not be set up. Try again." : {+ "localizations" : {+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Bridgeplay è installato, ma non è stato possibile configurare Steam, la grafica di Apple o il motore. Riprova."+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Bridgeplay 已安装,但无法设置 Steam、Apple 图形组件或引擎。请重试。"+ }+ }+ }+ },"Bridgeplay is installed. You can eject the installer and move its DMG to Trash in Finder." : {"localizations" : {"it" : {@@ -211,6 +243,22 @@}}},+ "Copying Apple's graphics, the engine and settings" : {+ "localizations" : {+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Copia della grafica di Apple, del motore e delle impostazioni"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "正在复制 Apple 图形组件、引擎和设置"+ }+ }+ }+ },"Could not reach the release server. Check your connection and try again." : {"localizations" : {"en" : {@@ -281,6 +329,22 @@}}},+ "Downloading graphics and engine" : {+ "localizations" : {+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Scaricamento di grafica e motore"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "正在下载图形组件和引擎"+ }+ }+ }+ },"Eject installer and move DMG to Trash" : {"localizations" : {"it" : {@@ -313,6 +377,22 @@}}},+ "Finish setting up Bridgeplay" : {+ "localizations" : {+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Completa la configurazione di Bridgeplay"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "完成 Bridgeplay 的设置"+ }+ }+ }+ },"Game data" : {"localizations" : {"it" : {@@ -441,6 +521,38 @@}}},+ "Installing Steam from Valve" : {+ "localizations" : {+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Installazione di Steam da Valve"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "正在从 Valve 安装 Steam"+ }+ }+ }+ },+ "Installing Steam, Apple's graphics, the engine and the default settings. Please keep the installer open." : {+ "localizations" : {+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Installazione di Steam, della grafica di Apple, del motore e delle impostazioni predefinite. Tieni aperto il programma di installazione."+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "正在安装 Steam、Apple 图形组件、引擎和默认设置。请保持安装程序打开。"+ }+ }+ }+ },"Kept in place" : {"localizations" : {"it" : {@@ -521,18 +633,18 @@}}},- "Open Bridgeplay to continue setup or check its Status page for component updates. Engine and graphics downloads are handled there." : {+ "Open Bridgeplay to finish setup: Rosetta, Steam sign-in and a couple of standard macOS prompts." : {"localizations" : {"it" : {"stringUnit" : {"state" : "translated",- "value" : "Apri Bridgeplay per continuare la configurazione o controllare gli aggiornamenti dei componenti nella pagina Stato. Da lì puoi scaricare motore e grafica."+ "value" : "Apri Bridgeplay per completare la configurazione: Rosetta, accesso a Steam e un paio di richieste standard di macOS."}},"zh-Hans" : {"stringUnit" : {"state" : "translated",- "value" : "打开 Bridgeplay 继续设置,或在“状态”页面检查组件更新。你可以在那里下载引擎和图形组件。"+ "value" : "打开 Bridgeplay 完成设置:Rosetta、登录 Steam,以及几个常规的 macOS 提示。"}}}@@ -591,6 +703,22 @@}}},+ "Setting up Bridgeplay" : {+ "localizations" : {+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Configurazione di Bridgeplay"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "正在设置 Bridgeplay"+ }+ }+ }+ },"Something went wrong" : {"localizations" : {"it" : {@@ -607,6 +735,22 @@}}},+ "Steam, Apple's graphics and the WineCX engine are installed too, since this Mac doesn't have them yet." : {+ "localizations" : {+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Vengono installati anche Steam, la grafica di Apple e il motore WineCX, perché questo Mac non li ha ancora."+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "由于这台 Mac 还没有 Steam、Apple 图形组件和 WineCX 引擎,它们也会一并安装。"+ }+ }+ }+ },"The application could not be replaced. Check the app and its previous-version backup in Applications before trying again." : {"localizations" : {"en" : {@@ -793,22 +937,6 @@}}},- "The source DMG could not be identified. You can eject it and move it to Trash in Finder." : {- "localizations" : {- "it" : {- "stringUnit" : {- "state" : "translated",- "value" : "Impossibile identificare il DMG di origine. Puoi espellerlo e spostarlo nel Cestino dal Finder."- }- },- "zh-Hans" : {- "stringUnit" : {- "state" : "translated",- "value" : "无法识别来源 DMG。你可以在 Finder 中将其推出并移到废纸篓。"- }- }- }- },"This Bridgeplay version is already installed. Check again to continue." : {"localizations" : {"en" : {diff --git a/app/Sources/BridgeplayInstallerCore/InstallerComponents.swift b/app/Sources/BridgeplayInstallerCore/InstallerComponents.swiftnew file mode 100644index 0000000..ab0e18a--- /dev/null+++ b/app/Sources/BridgeplayInstallerCore/InstallerComponents.swift@@ -0,0 +1,170 @@+import Foundation++/// Apple's Game Porting Toolkit, the WineCX engine and the default configs: the one-click+/// installer ZIP on the `installer` release, which Install.command inside it puts in place.+/// The wizard downloads it only when this Mac lacks them, checks it against the same EdDSA+/// key as the app, then runs that Install.command without the app step and without Terminal.+public struct InstallerComponents: Sendable, Equatable {+ public static let archiveURL = URL(+ string: "https://github.com/raymondchins/Bridgeplay/releases/download/installer/Bridgeplay-Installer.zip"+ )!+ /// "<base64 EdDSA signature> <length>", written by scripts/release-local.sh with Sparkle's sign_update.+ public static let signatureURL = URL(+ string: "https://github.com/raymondchins/Bridgeplay/releases/download/installer/Bridgeplay-Installer.zip.sig"+ )!+ static let maximumLength: Int64 = 2_147_483_648++ public let length: Int64+ public let signature: Data+ let verificationKey: Data+ var archiveURL = Self.archiveURL++ public init(signatureFile text: String) throws {+ try self.init(signatureFile: text, verificationKey: Data(base64Encoded: InstallerRelease.encodedSigningKey)!)+ }++ init(signatureFile text: String, verificationKey: Data) throws {+ let parts = text.split(whereSeparator: \.isWhitespace)+ guard parts.count == 2, let signature = Data(base64Encoded: String(parts[0])), signature.count == 64,+ parts[1].utf8.allSatisfy({ (48...57).contains($0) }), let length = Int64(parts[1]),+ length > 0, length <= Self.maximumLength, verificationKey.count == 32 else {+ throw InstallerError.invalidRelease+ }+ self.length = length+ self.signature = signature+ self.verificationKey = verificationKey+ }++ /// Needed on a Mac without Game Porting Toolkit in Bridgeplay's (or the older NotProton)+ /// support folder, or without Steam.+ public static func needed(home: URL = FileManager.default.homeDirectoryForCurrentUser,+ applications: URL = URL(fileURLWithPath: "/Applications")) -> Bool {+ let support = home.appending(path: "Library/Application Support")+ let gptk = ["bridgeplay", "notproton"].contains {+ FileManager.default.fileExists(atPath: support.appending(path: "\($0)/gptk").path)+ }+ let steam = FileManager.default.fileExists(atPath: applications.appending(path: "Steam.app").path)+ return !gptk || !steam+ }++ /// The signature published beside the archive. For testing an unpublished build, the+ /// `ComponentsSignature` and `ComponentsArchive` (a file: URL) defaults name another+ /// signature and archive; the archive must still be signed by Bridgeplay's key.+ public static func latest(session: URLSession = .shared, defaults: UserDefaults = .standard) async throws -> InstallerComponents {+ if let local = defaults.string(forKey: "ComponentsSignature") {+ var components = try InstallerComponents(signatureFile: local)+ if let path = defaults.string(forKey: "ComponentsArchive"), let url = URL(string: path), url.isFileURL {+ components.archiveURL = url+ }+ return components+ }+ var request = URLRequest(url: signatureURL)+ request.timeoutInterval = 30+ let data: Data, response: URLResponse+ do { (data, response) = try await session.data(for: request) }+ catch { throw InstallerError.networkFailure(error.localizedDescription) }+ guard let http = response as? HTTPURLResponse, http.statusCode == 200, data.count < 1024,+ let text = String(data: data, encoding: .utf8) else { throw InstallerError.invalidRelease }+ return try InstallerComponents(signatureFile: text)+ }++ /// Download to a file in `directory` and verify it. Throws without leaving the file on failure.+ public func download(to directory: URL, session: URLSession = .shared,+ progress: @escaping @Sendable (InstallerDownloadProgress) -> Void = { _ in }) async throws -> URL {+ let delegate = ProgressDelegate(total: length, progress: progress)+ var request = URLRequest(url: archiveURL)+ request.timeoutInterval = 60+ let temporary: URL, response: URLResponse+ do { (temporary, response) = try await session.download(for: request, delegate: delegate) }+ catch is CancellationError { throw CancellationError() }+ catch { throw InstallerError.networkFailure(error.localizedDescription) }+ let archive = directory.appending(path: "Bridgeplay-Installer.zip")+ do {+ guard archiveURL.isFileURL || (response as? HTTPURLResponse)?.statusCode == 200 else { throw InstallerError.invalidRelease }+ try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true)+ try? FileManager.default.removeItem(at: archive)+ try FileManager.default.moveItem(at: temporary, to: archive)+ try verify(archive)+ } catch {+ try? FileManager.default.removeItem(at: temporary)+ try? FileManager.default.removeItem(at: archive)+ throw error+ }+ return archive+ }++ // CEILING: Ed25519 signs the whole file, so it is mapped and checked at once (~0.5 GB of+ // address space); a streamed check would need a different signature scheme.+ func verify(_ archive: URL) throws {+ let size = (try? archive.resourceValues(forKeys: [.fileSizeKey]).fileSize).map(Int64.init)+ guard size == length else { throw InstallerError.invalidArchiveLength }+ let data = try Data(contentsOf: archive, options: .alwaysMapped)+ try InstallerRelease.verify(data, signature: signature, publicKey: verificationKey)+ }++ /// Unpack the verified archive and run its Install.command for Steam, GPTK, the engine and+ /// the configs. `status` gets each "==>" step the script announces.+ public static func install(archive: URL, work: URL, status: @escaping @Sendable (String) -> Void = { _ in }) throws {+ let unpacked = work.appending(path: "components")+ try? FileManager.default.removeItem(at: unpacked)+ try FileManager.default.createDirectory(at: unpacked, withIntermediateDirectories: true)+ try run("/usr/bin/ditto", ["-x", "-k", archive.path, unpacked.path])+ let script = unpacked.appending(path: "Bridgeplay/Install.command")+ guard FileManager.default.isReadableFile(atPath: script.path) else {+ throw InstallerError.invalidInstallation("The components download has no Install.command.")+ }+ var environment = ProcessInfo.processInfo.environment+ environment["BRIDGEPLAY_INSTALL_APP"] = "0"+ environment["BRIDGEPLAY_NONINTERACTIVE"] = "1"+ try run("/bin/bash", [script.path], environment: environment) { line in+ if line.hasPrefix("==> ") { status(String(line.dropFirst(4))) }+ }+ }++ @discardableResult+ static func run(_ executable: String, _ arguments: [String], environment: [String: String]? = nil,+ line: @escaping @Sendable (String) -> Void = { _ in }) throws -> String {+ let process = Process()+ process.executableURL = URL(fileURLWithPath: executable)+ process.arguments = arguments+ if let environment { process.environment = environment }+ let pipe = Pipe()+ process.standardOutput = pipe+ process.standardError = pipe+ process.standardInput = FileHandle.nullDevice+ try process.run()+ var all = ""+ var pending = ""+ while case let chunk = pipe.fileHandleForReading.availableData, !chunk.isEmpty {+ // Strip the script's colour codes before reading its lines.+ let text = String(decoding: chunk, as: UTF8.self)+ .replacingOccurrences(of: #"\u{1B}\[[0-9;]*m"#, with: "", options: .regularExpression)+ all += text+ pending += text+ while let newline = pending.firstIndex(where: { $0 == "\n" || $0 == "\r" }) {+ line(String(pending[..<newline]).trimmingCharacters(in: .whitespaces))+ pending.removeSubrange(...newline)+ }+ }+ process.waitUntilExit()+ guard process.terminationStatus == 0 else {+ let reason = all.split(separator: "\n").last { $0.contains("Gagal:") || !$0.trimmingCharacters(in: .whitespaces).isEmpty }+ throw InstallerError.componentsFailure(reason.map { String($0).replacingOccurrences(of: "Gagal: ", with: "") } ?? "exit \(process.terminationStatus)")+ }+ return all+ }+}++private final class ProgressDelegate: NSObject, URLSessionDownloadDelegate, @unchecked Sendable {+ let total: Int64+ let progress: @Sendable (InstallerDownloadProgress) -> Void+ init(total: Int64, progress: @escaping @Sendable (InstallerDownloadProgress) -> Void) {+ self.total = total+ self.progress = progress+ }+ func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64,+ totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) {+ progress(InstallerDownloadProgress(received: totalBytesWritten, total: total))+ }+ func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) {}+}diff --git a/app/Sources/BridgeplayInstallerCore/InstallerRelease.swift b/app/Sources/BridgeplayInstallerCore/InstallerRelease.swiftindex 6dbf27e..4d38adf 100644--- a/app/Sources/BridgeplayInstallerCore/InstallerRelease.swift+++ b/app/Sources/BridgeplayInstallerCore/InstallerRelease.swift@@ -342,6 +342,7 @@ public enum InstallerError: LocalizedError, Sendable {case installLockedcase appValidation(String)case replacementFailure(String)+ case componentsFailure(String)public var errorDescription: String? {switch self {@@ -361,6 +362,7 @@ public enum InstallerError: LocalizedError, Sendable {case .installLocked: "Another Bridgeplay installation is in progress. Finish it before trying again."case .appValidation(let detail): "The downloaded Bridgeplay app could not be validated. \(detail)"case .replacementFailure(let detail): "Bridgeplay could not replace the existing app. \(detail)"+ case .componentsFailure(let detail): "Steam, the graphics or the engine could not be set up. \(detail)"}}}diff --git a/app/Sources/BridgeplayInstallerCore/InstallerService.swift b/app/Sources/BridgeplayInstallerCore/InstallerService.swiftindex 155f7e0..f9b5caf 100644--- a/app/Sources/BridgeplayInstallerCore/InstallerService.swift+++ b/app/Sources/BridgeplayInstallerCore/InstallerService.swift@@ -5,6 +5,11 @@ public enum InstallationState: Sendable, Equatable {case notInstalledcase updateAvailable(currentBuild: Int, currentVersion: String, release: InstallerRelease)case upToDate(build: Int, version: String)++ public var isCurrent: Bool {+ if case .upToDate = self { return true }+ return false+ }}/// Detects and safely replaces the Bridgeplay app bundle. Game setup stays in the app.diff --git a/app/Tests/BridgeplayInstallerCoreTests/InstallerComponentsTests.swift b/app/Tests/BridgeplayInstallerCoreTests/InstallerComponentsTests.swiftnew file mode 100644index 0000000..881f3cb--- /dev/null+++ b/app/Tests/BridgeplayInstallerCoreTests/InstallerComponentsTests.swift@@ -0,0 +1,69 @@+import Foundation+import CryptoKit+import Testing+@testable import BridgeplayInstallerCore++@Suite("Installer components")+struct InstallerComponentsTests {+ private let key = Curve25519.Signing.PrivateKey()++ private func scratch() throws -> URL {+ let url = FileManager.default.temporaryDirectory.appending(path: "components-\(UUID().uuidString)")+ try FileManager.default.createDirectory(at: url, withIntermediateDirectories: true)+ return url+ }++ private func signed(_ data: Data) throws -> InstallerComponents {+ let signature = try key.signature(for: data).base64EncodedString()+ return try InstallerComponents(signatureFile: "\(signature) \(data.count)\n",+ verificationKey: key.publicKey.rawRepresentation)+ }++ @Test("The signature file is a base64 EdDSA signature and a length")+ func parse() throws {+ let signature = Data(repeating: 7, count: 64).base64EncodedString()+ #expect(try InstallerComponents(signatureFile: "\(signature) 504399923").length == 504_399_923)+ for bad in ["", signature, "\(signature) 0", "\(signature) -5", "\(signature) 12a", "AAAA 10",+ "\(signature) 10 extra", "\(signature) 99999999999"] {+ #expect(throws: InstallerError.self) { try InstallerComponents(signatureFile: bad) }+ }+ }++ @Test("Only an archive signed by the key, at the signed length, passes")+ func verify() throws {+ let dir = try scratch()+ defer { try? FileManager.default.removeItem(at: dir) }+ let payload = Data("components".utf8)+ let archive = dir.appending(path: "Bridgeplay-Installer.zip")+ try payload.write(to: archive)+ try signed(payload).verify(archive)++ try Data("tampered!!".utf8).write(to: archive)+ #expect(throws: InstallerError.self) { try signed(payload).verify(archive) }+ try Data("longer components".utf8).write(to: archive)+ #expect(throws: InstallerError.self) { try signed(payload).verify(archive) }+ }++ @Test("Needed without GPTK in either support folder, or without Steam")+ func needed() throws {+ let home = try scratch(), apps = try scratch()+ defer { try? FileManager.default.removeItem(at: home); try? FileManager.default.removeItem(at: apps) }+ #expect(InstallerComponents.needed(home: home, applications: apps))+ try FileManager.default.createDirectory(at: apps.appending(path: "Steam.app"), withIntermediateDirectories: true)+ #expect(InstallerComponents.needed(home: home, applications: apps))+ let legacy = home.appending(path: "Library/Application Support/notproton/gptk")+ try FileManager.default.createDirectory(at: legacy, withIntermediateDirectories: true)+ #expect(!InstallerComponents.needed(home: home, applications: apps))+ try FileManager.default.removeItem(at: apps.appending(path: "Steam.app"))+ #expect(InstallerComponents.needed(home: home, applications: apps))+ }++ @Test("A failing Install.command reports its last message")+ func scriptFailure() throws {+ #expect(throws: InstallerError.self) {+ try InstallerComponents.run("/bin/sh", ["-c", "echo '==> step'; echo 'Gagal: disk full' >&2; exit 1"])+ }+ let output = try InstallerComponents.run("/bin/sh", ["-c", "printf '==> one\\n==> two\\n'"])+ #expect(output == "==> one\n==> two\n")+ }+}diff --git a/docs/NATIVE-INSTALLER.md b/docs/NATIVE-INSTALLER.mdindex a979d0a..48fe536 100644--- a/docs/NATIVE-INSTALLER.md+++ b/docs/NATIVE-INSTALLER.md@@ -1,4 +1,4 @@-# Native installer DMG+# Native installerThe native installer is an optional small bootstrap for a new installation or an appupdate. It downloads the existing Bridgeplay release, verifies its Sparkle EdDSA signature@@ -13,7 +13,7 @@ make native-installerThis builds the `BridgeplayInstaller` SwiftPM product for arm64, copies its two resourcebundles and font license files, compiles installer translations, renders the existing-Bridgeplay mark as the icon, signs the app and packages `out/Bridgeplay-Installer.dmg`.+Bridgeplay mark as the icon, signs the app and packages `out/Bridgeplay-Setup.zip`, a ZIP with only the app in it (a downloaded DMG makes Gatekeeper ask twice).The default is an ad hoc local build. `BRIDGEPLAY_SIGN_IDENTITY` selects the maintainer'ssigning identity. The default size budget is 5 MiB; a larger artifact fails packaging.`BRIDGEPLAY_INSTALLER_MAX_BYTES` can override the budget for a deliberate size review.diff --git a/docs/RELEASING.md b/docs/RELEASING.mdindex 76f4abf..21230ab 100644--- a/docs/RELEASING.md+++ b/docs/RELEASING.md@@ -1,7 +1,10 @@# Releasing BridgeplayEvery release is a GitHub release of `raymondchins/Bridgeplay` carrying `Bridgeplay.zip`,-`appcast.xml` and the small native `Bridgeplay-Installer.dmg` bootstrap. The one-click `Bridgeplay-Installer.zip` lives on its own prerelease, tag+`appcast.xml` and the small native installer, `Bridgeplay-Setup.zip` (a ZIP, not a DMG, so+Gatekeeper asks for Open Anyway once instead of twice). The native installer also downloads the `installer`+release's `Bridgeplay-Installer.zip` for GPTK, the engine and the configs, checked against+the `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`downloads the Latest release's `Bridgeplay.zip` when it runs, so `release-local.sh` uploads@@ -52,14 +55,14 @@ a newer install and leaves it alone. `VersioningTests` guards both.`scripts/sync-upstream.sh` already bumps the patch after an upstream merge.2. Push to `main` of `raymondchins/Bridgeplay` (the script refuses anything else).3. Optionally rehearse: `scripts/release-local.sh --dry-run` writes the zip, appcast and- an ad hoc native installer DMG to+ an ad hoc native installer ZIP to`out/release/` from an app already built with `make app`, without publishing or readingthe keychain.4. Release: `scripts/release-local.sh` (notes default to the commit subjects since theprevious `vX.Y.Z` release; pass a string to override). It builds with`scripts/build-local.sh --checks`, signs the app with the `Bridgeplay Release` identity(see Signing), signs the zip with the EdDSA key in the login keychain, writes an appcast with `minimumSystemVersion` 26.0, packages the installer from the- same app (`scripts/package-installer.sh`). It also builds the native DMG with the same+ same app (`scripts/package-installer.sh`). It also builds the native installer ZIP with the samerelease identity and attaches it beside the product ZIP and appcast on `vX.Y.Z` Latest.The existing bundled installer ZIP remains on the separate `installer` tag.diff --git a/installer/Install.command b/installer/Install.commandindex 3a8e62a..277a7c2 100755--- a/installer/Install.command+++ b/installer/Install.command@@ -7,6 +7,12 @@# permission and the Steam setup. Assembled into a zip by scripts/package-installer.sh.set -uo pipefail+# Bridgeplay Installer.app runs this script too, after it has installed the app itself:+# BRIDGEPLAY_INSTALL_APP=0 skips the app, BRIDGEPLAY_NONINTERACTIVE=1 never waits for Enter+# and leaves opening Bridgeplay and the Terminal window to the caller.+install_app=${BRIDGEPLAY_INSTALL_APP:-1}+noninteractive=${BRIDGEPLAY_NONINTERACTIVE:-0}+here="$(cd "$(dirname "$0")" && pwd)"support="$HOME/Library/Application Support/bridgeplay"caches="$HOME/Library/Caches/bridgeplay"@@ -27,7 +33,11 @@ if [ ! -d "$caches" ] && [ -d "$legacy_caches" ]; thenfisay() { 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; }+die() {+ printf '\n\033[1;31mGagal:\033[0m %s\n' "$*" >&2+ [ "$noninteractive" = 1 ] || 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"@@ -58,7 +68,7 @@ major="$(sw_vers -productVersion | cut -d. -f1)"[ -w /Applications ] || die "Akun ini tidak bisa menulis ke folder Applications. Login dengan akun admin, lalu jalankan Install.command lagi."# An installer from before the app was left out still carries Bridgeplay.app; use it.app_src="$here/Bridgeplay.app"-if [ ! -d "$app_src" ]; then+if [ "$install_app" = 1 ] && [ ! -d "$app_src" ]; thensay "Mengunduh Bridgeplay versi terbaru..."app_tmp="$(mktemp -d)"curl -fL --retry 3 --connect-timeout 20 --progress-bar -o "$app_tmp/Bridgeplay.zip" "$app_url" \@@ -72,18 +82,20 @@ if [ ! -d "$app_src" ]; then|| die "Tanda tangan Bridgeplay yang diunduh tidak valid. Jalankan Install.command lagi."fi-say "Memasang Bridgeplay..."-# quit is asynchronous: wait until the app has gone before its bundle is removed.-osascript -e 'tell application id "com.bridgeplay.Bridgeplay" to quit' >/dev/null 2>&1 || true-waited=0-while pgrep -qx BridgeplayApp; do- [ "$waited" -lt 30 ] || die "Bridgeplay masih berjalan. Tutup Bridgeplay dulu, lalu jalankan Install.command lagi."- sleep 1- waited=$((waited + 1))-done-rm -rf /Applications/Bridgeplay.app || die "Bridgeplay lama tidak bisa dihapus dari Applications."-ditto "$app_src" /Applications/Bridgeplay.app || die "Bridgeplay gagal disalin ke Applications."-xattr -dr com.apple.quarantine /Applications/Bridgeplay.app 2>/dev/null || true+if [ "$install_app" = 1 ]; then+ say "Memasang Bridgeplay..."+ # quit is asynchronous: wait until the app has gone before its bundle is removed.+ osascript -e 'tell application id "com.bridgeplay.Bridgeplay" to quit' >/dev/null 2>&1 || true+ waited=0+ while pgrep -qx BridgeplayApp; do+ [ "$waited" -lt 30 ] || die "Bridgeplay masih berjalan. Tutup Bridgeplay dulu, lalu jalankan Install.command lagi."+ sleep 1+ waited=$((waited + 1))+ done+ rm -rf /Applications/Bridgeplay.app || die "Bridgeplay lama tidak bisa dihapus dari Applications."+ ditto "$app_src" /Applications/Bridgeplay.app || die "Bridgeplay gagal disalin ke Applications."+ xattr -dr com.apple.quarantine /Applications/Bridgeplay.app 2>/dev/null || true+fiif [ ! -d /Applications/Steam.app ]; thensay "Steam belum terpasang. Mengunduh installer Steam resmi dari Valve..."@@ -164,6 +176,7 @@ xattr -dr com.apple.quarantine "$support" 2>/dev/null || truedefaults delete com.bridgeplay.Bridgeplay setupAssistantFinished >/dev/null 2>&1 || truesay "Selesai. Bridgeplay terbuka, ikuti Setup Assistant-nya."+[ "$noninteractive" = 1 ] && exit 0open /Applications/Bridgeplay.appsleep 2osascript -e 'tell application "Terminal" to close (every window whose name contains "Install.command")' >/dev/null 2>&1 &diff --git a/installer/native/READ ME FIRST.html b/installer/native/READ ME FIRST.htmlnew file mode 100644index 0000000..7516d29--- /dev/null+++ b/installer/native/READ ME FIRST.html@@ -0,0 +1,147 @@+<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8">+<meta name="viewport" content="width=device-width, initial-scale=1">+<title>Open Bridgeplay Installer</title>+<style>+ @font-face { font-family: "Geist"; src: url("{{font:geist}}") format("woff2"); font-weight: 100 900; }+ :root {+ color-scheme: dark;+ --bg: #000; --raise: #0b0b0d; --fg: #f5f5f7; --fg-2: #a1a1a6; --fg-3: #86868b;+ --line: rgb(255 255 255 / 0.1); --line-strong: rgb(255 255 255 / 0.18);+ --iri-violet: #8b7bff; --iri-blue: #4fb3ff; --iri-pink: #ff7ac6;+ --sans: "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;+ }+ * { box-sizing: border-box; }+ html { background: var(--bg); }+ body {+ margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans);+ font-size: 17px; line-height: 1.47; letter-spacing: -0.012em;+ -webkit-font-smoothing: antialiased; font-feature-settings: "ss01";+ }+ ::selection { background: var(--iri-violet); color: #fff; }+ main { width: min(760px, 100% - 40px); margin: 0 auto; padding: 36px 0 72px; }+ .wordmark { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; letter-spacing: -0.03em; }+ .mark { width: 24px; height: 24px; }+ h1 { margin: 56px 0 0; font-size: clamp(34px, 5vw, 48px); line-height: 1.06; letter-spacing: -0.035em; font-weight: 700; text-wrap: balance; }+ .iri { background: linear-gradient(100deg, var(--iri-violet), var(--iri-blue) 50%, var(--iri-pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }+ .lede { margin: 14px 0 0; max-width: 34em; color: var(--fg-2); text-wrap: pretty; }+ ol { list-style: none; margin: 44px 0 0; padding: 0; position: relative; }+ ol::before { content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 1px; background: linear-gradient(var(--line), var(--line-strong), var(--line)); }+ li { display: grid; grid-template-columns: 44px 1fr; gap: 20px; padding: 0 0 40px; }+ li:last-child { padding-bottom: 0; }+ .num {+ position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center;+ background: #161618; border: 1px solid var(--line); box-shadow: 0 0 0 6px var(--bg); font-weight: 600; font-size: 16px;+ }+ li:last-child .num { color: #000; border-color: transparent; background: linear-gradient(135deg, var(--iri-violet), var(--iri-blue) 55%, var(--iri-pink)); }+ h2 { margin: 9px 0 6px; font-size: 20px; letter-spacing: -0.02em; font-weight: 650; }+ li p { margin: 0 0 16px; font-size: 15px; line-height: 1.5; color: var(--fg-2); max-width: 36em; }+ li p b { color: var(--fg); font-weight: 600; }+ /* Drawn copies of macOS's own dialogs and Settings rows; the button to click is ringed. */+ .mac { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif; letter-spacing: 0; color: #f5f5f7; }+ .dialog {+ position: relative; width: min(300px, 100%); padding: 22px 18px 18px; border-radius: 28px;+ background: #2c2c2e; border: 1px solid rgb(255 255 255 / 0.12);+ box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.8), inset 0 1px 0 rgb(255 255 255 / 0.06);+ }+ .dialog .help { position: absolute; right: 16px; top: 16px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / 0.1); color: #c7c7cc; font-size: 14px; font-weight: 600; }+ .dialog .icon { width: 64px; height: 64px; margin: 0 0 16px 4px; display: block; }+ .dialog h3 { margin: 0 4px 8px; font-size: 15px; line-height: 1.3; font-weight: 700; }+ .dialog .body { margin: 0 4px 18px; font-size: 13px; line-height: 1.4; color: #d1d1d6; }+ .dialog .btn { display: block; width: 100%; margin-top: 8px; padding: 7px 0; border-radius: 999px; text-align: center; font-size: 13px; font-weight: 500; background: rgb(255 255 255 / 0.12); }+ .dialog .btn.blue { background: #0a84ff; color: #fff; }+ .target { position: relative; box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--iri-blue), 0 0 18px 4px rgb(79 179 255 / 0.45); }+ .settings { width: min(560px, 100%); padding: 18px 16px 4px; border-radius: 16px; background: #1e1e20; border: 1px solid rgb(255 255 255 / 0.1); }+ .settings h4 { margin: 0 4px 10px; font-size: 14px; font-weight: 700; }+ .group { border-radius: 12px; background: #2a2a2d; margin-bottom: 12px; }+ .row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; font-size: 13px; }+ .row + .row { border-top: 1px solid rgb(255 255 255 / 0.07); }+ .row .grow { flex: 1; }+ .row .value { color: #d1d1d6; display: inline-flex; align-items: center; gap: 8px; }+ .row .stepper { width: 20px; height: 20px; border-radius: 6px; background: rgb(255 255 255 / 0.12); display: grid; place-items: center; font-size: 10px; }+ .row .small { font-size: 12px; color: #a1a1a6; line-height: 1.4; }+ .row .mbtn { padding: 4px 12px; border-radius: 7px; background: rgb(255 255 255 / 0.14); white-space: nowrap; }+ .faded { opacity: 0.4; }+ .pill {+ display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 22px 0 18px; margin: 2px 0 18px;+ border-radius: 999px; background: #f5f5f7; color: #000; text-decoration: none;+ font-weight: 600; font-size: 16px; letter-spacing: -0.015em; box-shadow: 0 10px 24px -12px rgb(0 0 0 / 0.9);+ transition: background 0.25s cubic-bezier(0.16, 1, 0.3, 1);+ }+ .pill:hover { background: #fff; }+ .pill svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }+ .foot { margin: 56px 0 0; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--fg-3); }+</style>+</head>+<body>+<main>+ <span class="wordmark">+ <svg class="mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M2 14h20" stroke="#f5f5f7" stroke-width="1.8" stroke-linecap="round"/><path d="M6.5 4v10M17.5 4v10" stroke="#f5f5f7" stroke-width="1.8" stroke-linecap="round"/><path d="M2 7c2.5 0 3.5-3 4.5-3S9.5 11 12 11s4.5-7 5.5-7 2 3 4.5 3" fill="none" stroke="#f5f5f7" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/><path d="M6.5 16.5v3M17.5 16.5v3M2 21c2.5 0 3.5-1.6 4.5-1.6S9.5 17.3 12 17.3s4.5 2.1 5.5 2.1 2 1.6 4.5 1.6" fill="none" stroke="#f5f5f7" stroke-width="1.2" stroke-linecap="round" opacity=".35"/></svg>+ Bridgeplay+ </span>++ <h1>Three clicks to <span class="iri">open the installer</span>.</h1>+ <p class="lede">macOS asks once before it opens an app from outside the App Store. Allow it here, and the installer downloads Bridgeplay, Steam and everything else for you.</p>++ <ol>+ <li>+ <span class="num">1</span>+ <div>+ <h2>Open the installer, then click Done</h2>+ <p>The Finder window is right behind this page. Double-click <b>Bridgeplay Installer</b> there. macOS says it can't check the app: click <b>Done</b>, not Move to Trash.</p>+ <div class="mac dialog" role="img" aria-label="macOS dialog: Bridgeplay Installer Not Opened, with Move to Trash and Done buttons">+ <span class="help">?</span><svg class="icon" viewBox="0 0 64 64" aria-hidden="true"><defs><linearGradient id="sv" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#f2f2f4"/><stop offset="1" stop-color="#a9a9ae"/></linearGradient><radialGradient id="dl" cx=".5" cy=".45" r=".6"><stop offset="0" stop-color="#9a9aa0"/><stop offset="1" stop-color="#5d5d63"/></radialGradient></defs><rect x="4" y="4" width="50" height="50" rx="12" fill="url(#sv)"/><circle cx="29" cy="29" r="16" fill="#e6e6ea" stroke="#8e8e93" stroke-width="1.5"/><circle cx="29" cy="29" r="12" fill="url(#dl)"/><path d="M29 15v5M29 38v5M15 29h5M38 29h5" stroke="#6e6e73" stroke-width="2" stroke-linecap="round"/><path d="M45 36 58 59H32Z" fill="#ffcc00" stroke="#c99a00" stroke-width="1.5" stroke-linejoin="round"/><path d="M45 44v7" stroke="#3a3000" stroke-width="2.6" stroke-linecap="round"/><circle cx="45" cy="55" r="1.6" fill="#3a3000"/></svg>+ <h3>“Bridgeplay Installer”<br>Not Opened</h3>+ <p class="body">Apple could not verify “Bridgeplay Installer” is free of malware that may harm your Mac or compromise your privacy.</p>+ <span class="btn blue">Move to Trash</span>+ <span class="btn target">Done</span>+ </div>+ </div>+ </li>+ <li>+ <span class="num">2</span>+ <div>+ <h2>Allow it in Privacy & Security</h2>+ <a class="pill" href="x-apple.systempreferences:com.apple.settings.PrivacySecurity.extension">+ <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3l7 3v5c0 4.5-3 8.3-7 10-4-1.7-7-5.5-7-10V6l7-3z"/><path d="M9 12l2 2 4-4"/></svg>+ Open Privacy & Security+ </a>+ <p>Scroll down to <b>Security</b>. Next to “Bridgeplay Installer was blocked”, click <b>Open Anyway</b>.</p>+ <div class="mac settings" role="img" aria-label="System Settings, Privacy and Security, Security section with the Open Anyway button">+ <h4>Security</h4>+ <div class="group">+ <div class="row"><span class="grow">Allow applications from</span><span class="value">App Store & Known Developers <span class="stepper">⌃</span></span></div>+ </div>+ <div class="group">+ <div class="row"><span class="grow">“Bridgeplay Installer” was blocked to protect your Mac.</span><span class="mbtn target">Open Anyway</span></div>+ <div class="row"><span class="small">Apple could not verify “Bridgeplay Installer” is free of malware that may harm your Mac or compromise your privacy.</span></div>+ </div>+ <div class="group faded">+ <div class="row"><span class="grow">FileVault</span><span class="value">On ›</span></div>+ </div>+ </div>+ </div>+ </li>+ <li>+ <span class="num">3</span>+ <div>+ <h2>Confirm, and you're done here</h2>+ <p>Click <b>Open Anyway</b> once more and use Touch ID or your Mac password. The installer opens and takes it from there.</p>+ <div class="mac dialog" role="img" aria-label="macOS dialog: Open Bridgeplay Installer?, with Move to Trash, Open Anyway and Done buttons">+ <span class="help">?</span><svg class="icon" viewBox="0 0 64 64" aria-hidden="true"><defs><linearGradient id="sv" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#f2f2f4"/><stop offset="1" stop-color="#a9a9ae"/></linearGradient><radialGradient id="dl" cx=".5" cy=".45" r=".6"><stop offset="0" stop-color="#9a9aa0"/><stop offset="1" stop-color="#5d5d63"/></radialGradient></defs><rect x="4" y="4" width="50" height="50" rx="12" fill="url(#sv)"/><circle cx="29" cy="29" r="16" fill="#e6e6ea" stroke="#8e8e93" stroke-width="1.5"/><circle cx="29" cy="29" r="12" fill="url(#dl)"/><path d="M29 15v5M29 38v5M15 29h5M38 29h5" stroke="#6e6e73" stroke-width="2" stroke-linecap="round"/><path d="M45 36 58 59H32Z" fill="#ffcc00" stroke="#c99a00" stroke-width="1.5" stroke-linejoin="round"/><path d="M45 44v7" stroke="#3a3000" stroke-width="2.6" stroke-linecap="round"/><circle cx="45" cy="55" r="1.6" fill="#3a3000"/></svg>+ <h3>Open “Bridgeplay Installer”?</h3>+ <p class="body">Apple is not able to verify that it is free from malware that could harm your Mac or compromise your privacy. Don’t open this unless you are certain it is from a trustworthy source.</p>+ <span class="btn blue">Move to Trash</span>+ <span class="btn target">Open Anyway</span>+ <span class="btn">Done</span>+ </div>+ </div>+ </li>+ </ol>++ <p class="foot">macOS asks because Bridgeplay is free and not notarized by Apple. It asks only this once. Updates keep your settings, game prefixes and saves.</p>+</main>+</body>+</html>diff --git a/scripts/package-native-installer.sh b/scripts/package-native-installer.shindex d47d178..d7f1fc5 100755--- a/scripts/package-native-installer.sh+++ b/scripts/package-native-installer.sh@@ -1,5 +1,8 @@#!/bin/sh-# Build a small native bootstrap DMG without Wine, GPTK or the product payload.+# Build the small native bootstrap without Wine, GPTK or the product payload, as a ZIP with+# the app and READ ME FIRST.html, which shows how to get past Gatekeeper. A downloaded DMG is+# checked by Gatekeeper on its own, then the app in it again: two Open Anyway prompts. A ZIP+# is not, so the app is the only one.set -eurepo=$(cd "$(dirname "$0")/.." && pwd)cd "$repo"@@ -7,7 +10,7 @@ identity=${BRIDGEPLAY_SIGN_IDENTITY:--}configuration=${CONFIGURATION:-release}out="$repo/out/native-installer"app="$out/Bridgeplay Installer.app"-dmg="$repo/out/Bridgeplay-Installer.dmg"+zip="$repo/out/Bridgeplay-Setup.zip"swift build --package-path app -c "$configuration" --product BridgeplayInstaller --arch arm64bin=$(swift build --package-path app -c "$configuration" --show-bin-path --arch arm64)@@ -73,13 +76,27 @@ codesign --verify --strict --deep "$bundle"# Only replace previous local packaging outputs after a complete bundle is available.rm -rf "$app"ditto "$bundle" "$app"-hdiutil create -quiet -volname 'Bridgeplay Installer' -srcfolder "$stage" -format UDZO -ov "$dmg"-codesign --force --sign "$identity" "$dmg"-size=$(stat -f '%z' "$dmg")+# READ ME FIRST.html carries its Geist font inline, so it is one file.+package="$stage/package"+mkdir -p "$package"+ditto "$app" "$package/Bridgeplay Installer.app"+python3 - "$repo/installer/native/READ ME FIRST.html" "$repo/app/Sources/BridgeplayUI/Resources/Fonts" "$package/READ ME FIRST.html" <<'PYTHON'+import base64+import pathlib+import re+import sys+page, fonts, out = pathlib.Path(sys.argv[1]), pathlib.Path(sys.argv[2]), pathlib.Path(sys.argv[3])+def font(match):+ return "data:font/woff2;base64," + base64.b64encode((fonts / (match.group(1) + ".woff2")).read_bytes()).decode()+out.write_text(re.sub(r"\{\{font:(\w+)\}\}", font, page.read_text()))+PYTHON+rm -f "$zip"+(cd "$package" && ditto -c -k --norsrc --noextattr . "$zip")+size=$(stat -f '%z' "$zip")limit=${BRIDGEPLAY_INSTALLER_MAX_BYTES:-5242880}if [ "$size" -gt "$limit" ]; then- echo "Installer DMG exceeds size budget: $size > $limit bytes" >&2+ echo "Installer ZIP exceeds size budget: $size > $limit bytes" >&2exit 1fi-printf 'DMG: %s\nSize: %s bytes (budget %s)\n' "$dmg" "$size" "$limit"-shasum -a 256 "$dmg"+printf 'ZIP: %s\nSize: %s bytes (budget %s)\n' "$zip" "$size" "$limit"+shasum -a 256 "$zip"diff --git a/scripts/release-local.sh b/scripts/release-local.shindex 565abb5..ab84c55 100755--- a/scripts/release-local.sh+++ b/scripts/release-local.sh@@ -244,14 +244,14 @@ if [ "$dry_run" -eq 1 ]; thenelsescripts/package-native-installer.shfi-cp out/Bridgeplay-Installer.dmg "$out/bridgeplay/Bridgeplay-Installer.dmg"+cp out/Bridgeplay-Setup.zip "$out/bridgeplay/Bridgeplay-Setup.zip"title="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-Installer.dmg" \+ "$out/bridgeplay/Bridgeplay-Setup.zip" \-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@@ -273,12 +273,24 @@ if [ -n "$installer_fp" ] && [ "$installer_fp" = "$published_fp" ]; thenelsescripts/package-installer.shmv out/Bridgeplay-Installer.zip "$out/bridgeplay/Bridgeplay-Installer.zip"+ # Bridgeplay Installer.app downloads this zip for GPTK, the engine and the configs and+ # checks it against "<EdDSA signature> <length>" in the .sig beside it (InstallerComponents).+ # A dry run doesn't read the keychain, so it writes no signature.+ if [ "$dry_run" -eq 0 ]; then+ installer_signed=$("$sparkle/sign_update" "$out/bridgeplay/Bridgeplay-Installer.zip") \+ || die "could not sign the installer zip"+ installer_sig=$(printf '%s\n' "$installer_signed" | sed -nE 's/.*edSignature="([^"]+)".*length="([0-9]+)".*/\1 \2/p')+ [ -n "$installer_sig" ] || die "sign_update printed no signature for the installer zip"+ printf '%s\n' "$installer_sig" >"$out/bridgeplay/Bridgeplay-Installer.zip.sig"+ fiinstaller_body=$(printf 'The one-click installer behind bridgeplay.dev/download. It downloads the latest Bridgeplay when it runs.\n\nFingerprint: %s\n' "$installer_fp")if gh release view "$installer_tag" -R "$slug" >/dev/null 2>&1; then- run gh release upload "$installer_tag" "$out/bridgeplay/Bridgeplay-Installer.zip" -R "$slug" --clobber+ run gh release upload "$installer_tag" "$out/bridgeplay/Bridgeplay-Installer.zip" \+ "$out/bridgeplay/Bridgeplay-Installer.zip.sig" -R "$slug" --clobberrun gh release edit "$installer_tag" -R "$slug" --notes "$installer_body"else- run gh release create "$installer_tag" "$out/bridgeplay/Bridgeplay-Installer.zip" -R "$slug" \+ run gh release create "$installer_tag" "$out/bridgeplay/Bridgeplay-Installer.zip" \+ "$out/bridgeplay/Bridgeplay-Installer.zip.sig" -R "$slug" \--target "$(git rev-parse HEAD)" --title "Bridgeplay Installer" --notes "$installer_body" \--prerelease --latest=falsefi