FreeCol / freecol

FreeCol: FreeCol is a turn-based strategy game based on the old game Colonization, and similar to Civilization. The objective of the game is to create an independent nation.
GNU General Public License v2.0
585 stars 170 forks source link

Modifications to support proper build of FreeCol as a Mac application bundle #62

Closed DonWaugaman closed 4 years ago

DonWaugaman commented 4 years ago

Modifications to support proper build of FreeCol as a Mac application bundle.

Without this, a user who unpacks the app bundle in /Applications and then clicks on the FreeCol icon will get a dialog saying that the bundle is damaged or cannot be executed. With these changes, it starts correctly. I've tested this on Mac OS 10.11, 10.14 and 10.15.

However, when a brand new FreeCol user starts up the app, it will close itself immediately with no error message displayed. This happens because the freecol per-user directory under ~/Library/Preferences hasn't been created. You can see this if you invoke the universalJavaApplicationStub directly; e.g. calvin[bash]~ -> /Applications/FreeCol.app/Contents/MacOS/universalJavaApplicationStub Bad user configuration directory: /Users/dpw/Library/Preferences/freecol

A workaround is to create it by hand: mkdir ~/Library/Preferences/freecol but the application really needs to create this directory for the user if it does not yet exist.

A similar subdirectory, ~/Library/Application Support/freecol, is created if it does not yet exist. Would it be possible to add code to create the subdirectory under Preferences in the same way?

mpope042 commented 4 years ago

Looks good, at least as far as I can tell without a mac. Merged in git.182376b.