Skip to content

Add support for macOS #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 19, 2025
Merged

Add support for macOS #34

merged 8 commits into from
May 19, 2025

Conversation

MichaelJBerk
Copy link
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
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
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.

Copy link
Member

@AaronVanGeffen AaronVanGeffen left a comment

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.

@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
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
5 checks passed
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