Return-To-The-Roots / s25client

Return To The Roots (Settlers II(R) Clone)
http://www.rttr.info
GNU General Public License v2.0
476 stars 75 forks source link

Game does not start on MacOS Ventura: "rttr.terminal" can't be opened because 'null' is not allowed to open documents in Terminal #1543

Closed FixedSpeed closed 1 year ago

FixedSpeed commented 1 year ago

When running the latest version 20220922 rev. 0537322 on MacOS Ventura 13.0.1 (MacBook Pro i5) the following error message is shown:

Screenshot_2022-12-07_at_21 35 09 There is description on why this happens, the game does not start.

FixedSpeed commented 1 year ago

I have checked out the master and the local build failed because of the use of the sprintf() function. Apparently the use of snprintf() is needed. After replacing sprintf() occurences, the build was completed and the game started without issues.

I will create a pull request for this change.

FixedSpeed commented 1 year ago

@Flamefire As you were expecting, the latest nightly build (which included the snprint() replacement) didn't fix this issue.

Can you give me some pointers on where to look for regarding this rttr.terminal error maybe ? Have you seen this error before on macOS ?

FixedSpeed commented 1 year ago

Apparently the game does load when the s25client is run directly from the macOS package (Contents/MacOS/).

mtoensing commented 1 year ago

Same problem here!

mtoensing commented 1 year ago

Maybe a problem or challenge with the security system of macOS Ventura. https://github.com/facebook/react-native/issues/35726

mtoensing commented 1 year ago

More info about the know bug from Apple: https://developer.apple.com/forums/thread/723842

mtoensing commented 1 year ago

It seems like this is not a bug on Apples end, but a security measure. So this has to be fixed in RTTR. My idea would be instead of one launcher it would be more compatible to use 3 .app files for updater, client and editor. At least for macOS Ventura and up.

Flamefire commented 1 year ago

Currently the design is that the updater runs prior to starting the client to keep it up to date. Having 3 .app files might not ensure this and hence require manual updating.

Unfortunately I don't know enough about macOS to fix this, so someone with expertise there and a system to test this on would be welcome.

mtoensing commented 1 year ago

I can offer to test. I started s25clienr directly and never used the updater

FixedSpeed commented 1 year ago

Same here, happy to test!

And, not to jump to conclusions, but maybe we think of different ways to keep the client up to date. For example: offer the option in the main menu, maybe with a notification of a new version available.

mtoensing commented 1 year ago

Would be great. Because on Mac you will most likely update to Ventura or at least to Big Sur. It is not like Windows where you can stay on W10 for eternity.

mtoensing commented 1 year ago

And getting rid of the .app approach would be better for everyone. Because the s2. folder inside the .app "folder" is something which not everyone will understand that you have to open it with "show contents" to put the GFX and DATA folder inside that. Normally you don't open these .app folders.

Separate executables would be great along with s2 folder on the same depth. Or if you use .app folders the data goes to ~/Documents/RTTR/s2 or something.

Spikeone commented 1 year ago

@Flamefire on windows we don't have that design, you'd have to run the rttr.bat (on linux I guess rttr.sh?) so I'm suprised that the mac client always updates (you have no chance to use a specific version then, do you?)

mtoensing commented 1 year ago

Okay, in that case: why not just a single rttr.sh file for Mac that points to he binary alongside the s2 folder?

mtoensing commented 1 year ago

I just looked at the windows and linux file structures of RTTR:

Screenshot 2023-03-01 at 22 46 22

I don't know who came up with the idea to bundle the mac version as the .app file. Just distribute it like windows and linux. Everyone will easier understand where to put the original files and no more problems with macOS security measures in the future.

FixedSpeed commented 1 year ago

Agree, that was my thought as well. Sounds much more clear and simple.

mtoensing commented 1 year ago

~~Since the last update of Ventura it starts without this error. ~~

I was wrong. I played around with the scripts and Info.plist and made it work somehow. When I download the regular version, it still crashes with the error

FixedSpeed commented 1 year ago

Seit dem letzten Update von macOS Ventura startet das Spiel ganz normal bei mir.

Hi, on which version of macOS Ventura are you currently ? Did you use the latest nightly build 20230312 (40018c4) for Mac ?

I'm on 13.2.1 (22D68).

mtoensing commented 1 year ago

Stable non-beta. I just pressed update

mtoensing commented 1 year ago

I was wrong. I played around with the scripts and Info.plist and made it work somehow. When I download the regular version, it still crashes with the error.

I changed

<key>CFBundleExecutable</key>
<string>starter</string>

to

<key>CFBundleExecutable</key>
<string>s25client</string>
MLipfert1 commented 1 year ago

This issue is fixed in Ventura 13.3.

mtoensing commented 1 year ago

This issue can be closed, but there is a new issue #1573 with macOS if someone discovers this by searching google.

Spikeone commented 1 year ago

closing as requested, thanks for keeping this updated @mtoensing :)