FS#153 - Language crash with app renaming

Attached to Project: OpenTTD
Opened by Anonymous Submitter - Friday, 05 May 2006, 08:19 GMT
Last edited by Bjarni (Bjarni) - Tuesday, 29 May 2007, 10:48 GMT
Type Bug
Category Core
Status Closed
Assigned To Bjarni (Bjarni)
Operating System Mac OS X
Severity Low
Priority Low
Reported Version 0.4.7
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


OpenTTD appears hardcoded to using, instead of $(APPDIR)/Contents/Lang, which makes parallel versions a minor pain.

This causes a couple of possible crashes:

Directory layout:
# no /Applications/
Running any of them causes "No available language packs"

Directory layout:
/Applications/ # any of the above versions
/Applications/*.app/ # others remaining unchanged
Running any of the ones causes "Invalid version of language packs"

Workarounds tried:
Changing $(APPNAME).app/Contents/Info.plist's CFBundleName to match $(APPNAME) has no effect.
Changing /Applications/OpenTTD-$(VER).app/ to /Applications/OpenTTD-$(VER)/ works, although appbar becomes confusing (no version names)

Assigned to Bjarni at Celestar's request.

Closed by  Remko Bijker (Rubidium)
Sunday, 17 June 2007, 15:49 GMT
Reason for closing:  Fixed
Additional comments about closing:  In r10182.
Comment by Bjarni (Bjarni) - Sunday, 21 May 2006, 15:20 GMT
I have known this bug from the time it was added (0.2.x or something like that)

The issue is that it got a hardcoded relative path for the lang dir, which contains the name. I got a plan to make all the paths hardcoded, but relative to the dir where the binary file is in the bundle, since the dir ".." will work even if somebody renames the bundle

I just got other stuff to do first, so a workaround is to NOT rename the bundle app. This should be somewhat easy to do. Another workaround is to edit Makefile to set a different name, like

replace it with

It's not a nice solution, but it should work

Another thing: OpenTTD do not need to be in Applications, so another solution could be to make a folder (say in your homedir) called OpenTTD and inside that one make a folder for each version, then no renaming will be needed. It's not recommended to use savegames and config files for more than one version anyway. You can upgrade them to a newer version, but it's pure luck if it works the other way without problems
Comment by Darkvater (Darkvater) - Thursday, 02 November 2006, 17:44 GMT
Any progress on this?
Comment by Bjarni (Bjarni) - Thursday, 02 November 2006, 18:09 GMT
err, the plan was to wait for a certain path patch to be finished as it could be used to solve this. Maybe it's time to solve this in a different way.

But there is one thing, that's important here: the game was never meant to be used in the application folder and adding support for it without doing real work to the path handling will likely end up as a hack.
Comment by Bjarni (Bjarni) - Tuesday, 05 December 2006, 10:31 GMT
The makefile rewrite will be able to solve this.
Comment by Bjarni (Bjarni) - Thursday, 14 June 2007, 19:27 GMT
The makefile rewrite didn't solve this because the path update was taken out of it. Now it will be solved when the path patch is done (look at task dependancies)