Skip to content

Add support for macOS - #34

Merged
Gymnasiast merged 8 commits into
OpenRCT2:masterfrom
MichaelJBerk:mac-fix
May 19, 2025
Merged

Gymnasiast merged 8 commits into
OpenRCT2:masterfrom
MichaelJBerk:mac-fix

Conversation

@MichaelJBerk

Copy link
Copy Markdown
Contributor

This PR adds support for OpenLauncher on macOS. Currently the launcher builds and runs on macOS, but can't download new releases or launch the game.

  • OpenLauncher now uses the correct binary name on macOS so that it can launch the executable properly.
  • On all platforms, OpenLauncher currently uses ZipFile.ExtractToDirectory to extract the release once it's been downloaded. However, this method will not preserve file aliases on macOS, and since OpenRCT2.app contains several of them, the extracted application won't launch. To fix this, this PR calls/usr/bin/ditto in a subprocess to extract the .zip, which will preserve the files properly.
  • Since OpenLoco isn't currently supported on macOS, it doesn't appear in the launcher.
  • .gitignore is updated to ignore .ds_store and other hidden files that macOS likes to make

@IntelOrca

Copy link
Copy Markdown
Collaborator

Currently the CI does not build or publish a macOS version, are you able to add this? Without it, no macOS version will be released.

@MichaelJBerk

Copy link
Copy Markdown
Contributor Author

I added a macOS build to the CI action, though it needs to use scripts to build/package it, since the process is a bit more complicated for macOS (it needs to build both x64 and arm64 versions, combine them, and then build the proper .app structure for them). The action doesn't sign and notarize the app, since I'm not entirely sure of the best way to handle that for CI.

Comment thread .github/workflows/ci.yml Outdated

@AaronVanGeffen AaronVanGeffen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builds fine locally using build-mac.sh with .NET 9.0. Packages fine into a bundle using package-mac.sh. The resulting launcher runs fine, downloads and runs releases as well:

Screenshot 2025-04-22 at 22 14 27

Looks like the CI job needs work, though? I'd try restarting it, but it seems I don't have the required rights for the OpenLauncher repository.

Comment thread build-mac.sh
Comment thread package-mac.sh
@Gymnasiast
Gymnasiast force-pushed the mac-fix branch 4 times, most recently from 3dd56c5 to 1e940ee Compare May 19, 2025 17:49
@AaronVanGeffen

Copy link
Copy Markdown
Member

That call to codesign seems to have done the trick. I don't quite understand how (what key is being used?) but it launches:

Screenshot 2025-05-19 at 23 32 03

@Gymnasiast
Gymnasiast merged commit 358d5c8 into OpenRCT2:master May 19, 2025
@MichaelJBerk
MichaelJBerk deleted the mac-fix branch November 26, 2025 20:03
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.

5 participants