Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README-MERGED.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ NotProton remembers where the app lives, so keep it in Applications.
checked to apply cleanly to the real 1.2.6 source, but nothing has been compiled or run. If `./build.sh`
stops with a compiler error, copy the red text and send it to me; it should be a quick fix.
- **Steam client version.** This macSteam accepts Steam builds 1792618285 and 1794424036. 1794424036 is also NotProton's stable build, so it is the one that suits both. If Steam is on any other build, Install offers to switch it.
- **Updates are off** in this build (macSteam's updater would replace this app with plain macSteam).
To update either project, rebuild from newer sources. The patch in `patches/` is tied to NotProton 1.2.6
and may need updating for other versions.
- **Automatic updates** come from this repo's own `appcast.xml`, never from plain macSteam's feed.
They are on once `SPARKLE_PUBLIC_KEY` in `build.sh` holds this repo's Sparkle key; until then builds
don't update, as before. For each release: build, upload the DMG to the GitHub release, then run
`./scripts/appcast-add.sh dist/macSteam-X.Y.Z.dmg X.Y.Z` and push `appcast.xml`.
The patch in `patches/` is tied to NotProton 1.2.6 and may need updating for other versions.
- **NotProton's menu-bar items** (Setup, Prefix menus, keyboard shortcuts) aren't in this app. The same
actions are buttons inside the NotProton pages. Its Refresh and prefix buttons are in a bar at the top of
each page.
Expand Down
88 changes: 2 additions & 86 deletions appcast.xml
Original file line number Diff line number Diff line change
@@ -1,92 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>macSteam Config</title>
<description>Most recent changes for macSteam Config.</description>
<title>macSteam</title>
<description>Combined macSteam + NotProton releases. Add each one with scripts/appcast-add.sh.</description>
<language>en</language>
<item>
<title>Version 0.8.2</title>
<pubDate>Thu, 23 Oct 2026 04:38:12 +0000</pubDate>
<sparkle:version>13</sparkle:version>
<sparkle:shortVersionString>0.8.2</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>13.0</sparkle:minimumSystemVersion>
<description><![CDATA[<ul><li>Support Steam build 1792618285</li><li>Anchor-based signature resolution survives Steam updates</li></ul>]]></description>
<enclosure url="https://github.com/crghofficial/macsteam/releases/download/v0.8.2/macSteam-0.8.2.dmg"
type="application/octet-stream"
sparkle:edSignature="JbFolplpUxOeBh0FZk9FY6Lk6PoFmoCM7vgLrhU12HZ+ZFpkDMW586BjcL/Yj9p4err9UOilXF1zQcn1vGQXCg=="
length="1882787" />
</item>
<item>
<title>Version 0.8.0</title>
<pubDate>Wed, 23 Sep 2026 11:46:16 -0400</pubDate>
<sparkle:version>11</sparkle:version>
<sparkle:shortVersionString>0.8.0</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>13.0</sparkle:minimumSystemVersion>
<description><![CDATA[Adds support for Steam Client 1788652215, switches manifest provider]]></description>
<enclosure url="https://github.com/Selectively11/macsteam/releases/download/v0.8.0/macSteam-Config-0.8.0.zip"
type="application/octet-stream"
sparkle:edSignature="38j1HYAeL7w5pxBcetpzFX5u77Ejm95S1aOirUPl2xBXme/2A9M4bPjzSKGhUc2pfUyR4g+Q/xb75m1z2zcgDg=="
length="1509379" />
</item>
<item>
<title>Version 0.7.1</title>
<pubDate>Sat, 05 Sep 2026 00:15:45 -0400</pubDate>
<sparkle:version>10</sparkle:version>
<sparkle:shortVersionString>0.7.1</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>13.0</sparkle:minimumSystemVersion>
<description><![CDATA[<ul><li>Adds support for SteamStub</li><li>Some correctness changes</li><li>Fixed a bug that zero users encountered that would cause failed downloads in some cases</li></ul>]]></description>
<enclosure url="https://github.com/Selectively11/macsteam/releases/download/v0.7.1/macSteam-Config-0.7.1.zip"
type="application/octet-stream"
sparkle:edSignature="nnViWx1f8EhMn02i9VycwFtB2DZ9o3bGUqHfl3UwAyxA9LYZj+FBLyA3FmZrtkvRWKRrzIUmBsXLVd/0ViIhDw=="
length="1508172" />
</item>
<item>
<title>Version 0.7.0</title>
<pubDate>Thu, 03 Sep 2026 00:17:49 -0400</pubDate>
<sparkle:version>9</sparkle:version>
<sparkle:shortVersionString>0.7.0</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>13.0</sparkle:minimumSystemVersion>
<description><![CDATA[<ul><li>Bounded the Store reviews fetch with an 8s timeout so a hung endpoint can no longer stall stat lookups</li><li>Trimmed the signature database to only the entries actually used at runtime</li></ul>]]></description>
<enclosure url="https://github.com/Selectively11/macsteam/releases/download/v0.7.0/macSteam-Config-0.7.0.zip"
type="application/octet-stream"
sparkle:edSignature="jts5hRm6CRluo3zdUcrb/CPiWuirFLME/aggBI39uhtHS1B4xOAoTfCWSr82DcFffGdbXv4g9lpfovcjXObeBA=="
length="1506210" />
</item>
<item>
<title>Version 0.6.0</title>
<pubDate>Tue, 02 Sep 2026 16:00:00 +0000</pubDate>
<sparkle:version>8</sparkle:version>
<sparkle:shortVersionString>0.6.0</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>13.0</sparkle:minimumSystemVersion>
<description><![CDATA[<ul><li>Initial Public Release</li></ul>]]></description>
<enclosure url="https://github.com/Selectively11/macsteam/releases/download/v0.6.0/macSteam-Config-0.6.0.zip"
type="application/octet-stream"
sparkle:edSignature="sYey5Vir+vUAw0/ivlbgz9+cNfE+DnxWfXUORYnoK+dSLLveISyM4tT9q20efllTudjft+tKgNYH90uflDsnAQ=="
length="1503467" />
</item>
<item>
<title>Version 0.5.6</title>
<pubDate>Tue, 02 Sep 2026 15:30:00 +0000</pubDate>
<sparkle:version>7</sparkle:version>
<sparkle:shortVersionString>0.5.6</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>13.0</sparkle:minimumSystemVersion>
<description><![CDATA[<ul><li>Removed config.yaml header comment</li></ul>]]></description>
<enclosure url="https://github.com/Selectively11/macsteam/releases/download/v0.5.6/macSteam-Config-0.5.6.zip"
type="application/octet-stream"
sparkle:edSignature="8a9BuEmseLzmDJ+XR5nVUNn4ywqTUNnb+lhYCE0iYjmjEsxbnuCc5YLHY7H9aRJaO8WCZqm8SIaOae3WSNbuCg=="
length="1503468" />
</item>
<item>
<title>Version 0.5.5</title>
<pubDate>Tue, 02 Sep 2026 15:20:00 +0000</pubDate>
<sparkle:version>6</sparkle:version>
<sparkle:shortVersionString>0.5.5</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>13.0</sparkle:minimumSystemVersion>
<description><![CDATA[<ul><li>Multi-gen zip import (multiple games per zip)</li><li>Folder drag-and-drop import</li><li>Sparkle auto-update support</li></ul>]]></description>
<enclosure url="https://github.com/Selectively11/macsteam/releases/download/v0.5.5/macSteam-Config-0.5.5.zip"
type="application/octet-stream"
sparkle:edSignature="jPsMj1f4f0WjoPMwv7subj7N3raRrXIw8DchwLZZVrsKNeKS5qHIsLwo4tPBZ+BwyhI1WYjce2ryU5yfSmd2Cw=="
length="1503476" />
</item>
</channel>
</rss>
18 changes: 16 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ say "Building CloudRedirect's cloud runtime"

"$ROOT/scripts/build-onlinefix.sh" "$APP"

# Sparkle (needed to launch; automatic updating is switched off in this build)
# Sparkle: the updater framework (feed and key are set in Info.plist below)
if [ -d "$BIN_DIR/Sparkle.framework" ]; then
ditto "$BIN_DIR/Sparkle.framework" "$APP/Contents/Frameworks/Sparkle.framework"
else
Expand All @@ -179,6 +179,19 @@ else
fi

NP_APP_VERSION="$(sed -n 's/^#define NOTPROTON_VERSION "\(.*\)"/\1/p' "$NP_DIR/dylib/version.h")"
# Automatic updates (Sparkle). The app checks this repo's appcast.xml, and only
# installs an update signed with the private key whose public half is below
# (the app is ad-hoc signed, so this key is what proves an update is ours).
# Until the key is pasted after ":-" below, builds leave updates off, as before.
# Set MACSTEAM_FEED_URL="" to build a copy that never updates.
SPARKLE_FEED_URL="${MACSTEAM_FEED_URL-https://raw.githubusercontent.com/Falhoo/macsteam/main/appcast.xml}"
SPARKLE_PUBLIC_KEY="${MACSTEAM_SPARKLE_PUBLIC_KEY:-}"
SPARKLE_PLIST=""
if [ -n "$SPARKLE_FEED_URL" ] && [ -n "$SPARKLE_PUBLIC_KEY" ]; then
SPARKLE_PLIST="<key>SUFeedURL</key> <string>$SPARKLE_FEED_URL</string>
<key>SUPublicEDKey</key> <string>$SPARKLE_PUBLIC_KEY</string>
<key>SUEnableAutomaticChecks</key> <true/>"
fi
cat > "$APP/Contents/Info.plist" <<PLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
Expand All @@ -194,7 +207,8 @@ cat > "$APP/Contents/Info.plist" <<PLIST
<key>CFBundleLocalizations</key>
<array><string>en</string><string>de</string><string>fr</string><string>it</string><string>zh-Hans</string></array>
<key>CFBundleShortVersionString</key> <string>$MS_VERSION</string>
<key>CFBundleVersion</key> <string>19</string>
<key>CFBundleVersion</key> <string>$MS_VERSION</string>
$SPARKLE_PLIST
<key>NotProtonVersion</key> <string>$NP_APP_VERSION</string>
<key>LSMinimumSystemVersion</key> <string>26.0</string>
<key>LSApplicationCategoryType</key> <string>public.app-category.utilities</string>
Expand Down
4 changes: 2 additions & 2 deletions macsteam-app/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>SUFeedURL</key>
<string>https://raw.githubusercontent.com/Selectively11/macsteam/main/appcast.xml</string>
<string>https://raw.githubusercontent.com/Falhoo/macsteam/main/appcast.xml</string>
<key>SUPublicEDKey</key>
<string>rDOXzJ+vt12aWeu9hATgvz6q46MlRcgR4gbTfj5YuWQ=</string>
<string></string>
</dict>
</plist>
42 changes: 31 additions & 11 deletions macsteam-app/Sources/MacsteamApp/UpdaterManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import AppKit
import Combine
import Sparkle

/// Updates come from the combined macSteam + NotProton feed named by `SUFeedURL` in the
/// app's Info.plist (build.sh writes it). Each update is checked against `SUPublicEDKey`
/// before it is installed, because the app itself is only ad-hoc signed.
@MainActor
final class UpdaterManager: NSObject, ObservableObject {
static let shared = UpdaterManager()
Expand All @@ -11,9 +14,21 @@ final class UpdaterManager: NSObject, ObservableObject {

@Published var canCheckForUpdates = false

/// A build without a feed or a key (a `swift run` dev build, or an older build.sh)
/// cannot update; starting Sparkle there would only show an error.
let isConfigured: Bool = {
let info = Bundle.main.infoDictionary ?? [:]
let feed = (info["SUFeedURL"] as? String) ?? ""
let key = (info["SUPublicEDKey"] as? String) ?? ""
return !feed.isEmpty && !key.isEmpty
}()

var automaticallyChecksForUpdates: Bool {
get { controller.updater.automaticallyChecksForUpdates }
set { controller.updater.automaticallyChecksForUpdates = newValue }
get { isConfigured && controller.updater.automaticallyChecksForUpdates }
set {
guard isConfigured else { return }
controller.updater.automaticallyChecksForUpdates = newValue
}
}

private override init() {
Expand All @@ -28,16 +43,21 @@ final class UpdaterManager: NSObject, ObservableObject {
.assign(to: &$canCheckForUpdates)
}

// Combined macSteam + NotProton build: automatic updates are switched off on purpose. The
// stock macSteam update feed would replace this app with plain macSteam (no NotProton).
func start() {}
func start() {
guard isConfigured else { return }
controller.startUpdater()
}

func checkForUpdates() {
let alert = NSAlert()
alert.messageText = "Updates are turned off in this combined build"
alert.informativeText = "macSteam and NotProton are built together, so the built-in updater "
+ "(which only knows about plain macSteam) is disabled. To update, rebuild from newer sources."
alert.addButton(withTitle: "OK")
alert.runModal()
guard isConfigured else {
let alert = NSAlert()
alert.messageText = "This build can't update itself"
alert.informativeText = "It was built without an update feed or signing key. "
+ "To update, download and install a newer macSteam release."
alert.addButton(withTitle: "OK")
alert.runModal()
return
}
controller.checkForUpdates(nil)
}
}
70 changes: 70 additions & 0 deletions scripts/appcast-add.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash
# Sign a release DMG for Sparkle and put it at the top of appcast.xml, the feed
# the app checks for automatic updates.
#
# ./scripts/appcast-add.sh DMG VERSION [DOWNLOAD_URL] [NOTES_FILE]
#
# Run it after uploading the DMG to the GitHub release, then commit and push
# appcast.xml; installed copies see the update on their next check.
#
# DOWNLOAD_URL defaults to the DMG on this repo's v<VERSION> release. The private
# key comes from $SPARKLE_KEY_FILE when set, otherwise from your login Keychain
# (Sparkle's generate_keys puts it there; $SPARKLE_ACCOUNT picks another account).
# NOTES_FILE is plain text or Markdown; it is shown as-is in the update window.
set -euo pipefail

ROOT="$(cd "$(dirname "$0")/.." && pwd)"
DMG="${1:?DMG path}"
VERSION="${2:?version, e.g. 0.8.10}"
URL="${3:-https://github.com/Falhoo/macsteam/releases/download/v$VERSION/$(basename "$DMG")}"
NOTES_FILE="${4:-}"
APPCAST="${APPCAST:-$ROOT/appcast.xml}"

SIGN_UPDATE="${SIGN_UPDATE:-$(find "$ROOT/macsteam-app/.build/artifacts" -path '*Sparkle/bin/sign_update' -type f 2>/dev/null | head -1)}"
[ -x "$SIGN_UPDATE" ] || { echo "error: Sparkle's sign_update not found; run ./build.sh first or set SIGN_UPDATE" >&2; exit 1; }
[ -f "$DMG" ] || { echo "error: $DMG is missing" >&2; exit 1; }

if [ -n "${SPARKLE_KEY_FILE:-}" ]; then
SIG_ATTRS="$("$SIGN_UPDATE" --ed-key-file "$SPARKLE_KEY_FILE" "$DMG")"
else
SIG_ATTRS="$("$SIGN_UPDATE" --account "${SPARKLE_ACCOUNT:-ed25519}" "$DMG")"
fi
# sign_update prints: sparkle:edSignature="..." length="..."
SIGNATURE="$(printf '%s' "$SIG_ATTRS" | sed -n 's/.*sparkle:edSignature="\([^"]*\)".*/\1/p')"
LENGTH="$(printf '%s' "$SIG_ATTRS" | sed -n 's/.*length="\([0-9]*\)".*/\1/p')"
[ -n "$SIGNATURE" ] && [ -n "$LENGTH" ] || { echo "error: sign_update gave no signature: $SIG_ATTRS" >&2; exit 1; }

python3 -I - "$APPCAST" "$VERSION" "$URL" "$SIGNATURE" "$LENGTH" "$NOTES_FILE" <<'PY'
import html, sys
from email.utils import formatdate

appcast, version, url, signature, length, notes_file = sys.argv[1:7]
notes = open(notes_file, encoding="utf-8").read().strip() if notes_file else ""
notes = notes or f"macSteam {version}"
body = f'<div style="white-space: pre-wrap">{html.escape(notes)}</div>'

text = open(appcast, encoding="utf-8").read()
if f"<sparkle:shortVersionString>{version}</sparkle:shortVersionString>" in text:
sys.exit(f"appcast.xml already lists {version}")

item = f""" <item>
<title>Version {html.escape(version)}</title>
<pubDate>{formatdate(usegmt=True)}</pubDate>
<sparkle:version>{html.escape(version)}</sparkle:version>
<sparkle:shortVersionString>{html.escape(version)}</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>26.0</sparkle:minimumSystemVersion>
<description><![CDATA[{body}]]></description>
<enclosure url="{html.escape(url, quote=True)}"
type="application/octet-stream"
sparkle:edSignature="{signature}"
length="{length}" />
</item>
"""
anchor = text.find(" <item>")
if anchor < 0:
anchor = text.find(" </channel>")
if anchor < 0:
sys.exit("appcast.xml has no <channel>")
open(appcast, "w", encoding="utf-8").write(text[:anchor] + item + text[anchor:])
print(f"appcast.xml: added {version}")
PY
Loading