Skip to content

Native arm64 macOS build + fix bundle-corrupting data storage - #101

Open
paulohenriquesg wants to merge 2 commits into
SirDiabo:mainfrom
paulohenriquesg:macos-arm64-support
Open

Native arm64 macOS build + fix bundle-corrupting data storage#101
paulohenriquesg wants to merge 2 commits into
SirDiabo:mainfrom
paulohenriquesg:macos-arm64-support

Conversation

@paulohenriquesg

@paulohenriquesg paulohenriquesg commented Jun 29, 2026

Copy link
Copy Markdown

Summary

Makes the launcher build and run as a native arm64 macOS .app, and fixes a data-storage bug that corrupts the app bundle on macOS. Two independent commits.

1. Native arm64 macOS build + .app packaging

  • Add osx-arm64 to RuntimeIdentifiers.
  • ppy.SDL2-CS ships native SDL2 for osx-x64/Linux/Windows but not osx-arm64, so an Apple-Silicon publish crashes on launch with System.DllNotFoundException: Unable to load shared library 'SDL2'. build-app.sh now downloads the official SDL2 release, sha256-verifies it, thins it to arm64, and bundles it. An MSBuild guard fails the publish with a clear message if the native is missing (it is git-ignored, not vendored).
  • build-app.sh publishes self-contained, assembles a signed .app with a generated .icns icon, and ad-hoc signs it.

2. Store writable data outside the app directory on macOS

The launcher wrote settings.json, the app registry, caches, and installed games next to its executable (AppDomain.CurrentDomain.BaseDirectory). Inside a .app that is Contents/MacOS/ — writing there corrupts the bundle code signature (a sealed resource is missing or invalid) and blocks installs into read-only locations like /Applications.

New AppPaths.DataDirectory resolves to ~/Library/Application Support/GithubLauncher on macOS and stays next to the executable on Windows/Linux (behavior unchanged off macOS). All writable paths route through it; self-update / executable replacement still targets the real app directory.

Verification (macOS 15.6, Apple M4 Max)

  • Fresh ./build-app.sh from a clean tree: downloads + verifies SDL2, builds, signs — codesign --verify --strict passes.
  • App launches; SDL2 loads.
  • After running, nothing is written into the bundle and the signature stays valid (previously broken on first run).
  • Data correctly lands in ~/Library/Application Support/GithubLauncher/.

Related issues

Relates to #61 (macOS version) and #98 (Apple Silicon release).

- Add osx-arm64 to RuntimeIdentifiers.
- ppy.SDL2-CS ships no arm64-macOS SDL2 native, which crashes the app on
  launch (DllNotFoundException: SDL2). build-app.sh now downloads the official
  SDL2 release, sha256-verifies it, thins it to arm64, and bundles it; an
  MSBuild guard fails the publish with a clear message if the native is absent.
- build-app.sh publishes self-contained, assembles a signed .app bundle with a
  generated .icns icon, and ad-hoc signs it.
- Ignore build output (dist/), the downloaded SDL2 native, and .serena/.
The launcher wrote settings, the app registry, caches, and installed games next
to its executable (AppDomain.CurrentDomain.BaseDirectory). Inside a macOS .app
that is Contents/MacOS/ — writing there corrupts the bundle's code signature
('a sealed resource is missing or invalid') and blocks installs into read-only
locations like /Applications.

Add AppPaths.DataDirectory, which resolves to
~/Library/Application Support/GithubLauncher on macOS and stays next to the
executable on Windows/Linux (unchanged). Route all writable paths through it:
settings.json, apps.json/games.json, Cache/, the Apps/ install folder, catalog
caches, apps_export.json, and update_check.json. Self-update / executable
replacement still uses the real app directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants