When we double click on the easyrpg-player file, it launch the game browser, which doesn't find any game.
We have to execute it with a terminal to launch the game or the game browser (which is abble to find games in this case).
The game browser finding only works when the browser is one directory above the games currently
There is a misunderstood, if the player is in a game folder, it launches the game browser (not the game) which found no game.
If the player is in a folder containing games, it launch the game browser which found no game.
In all cases, the Player seems to not detect games if we execute it via a double click.
But everything is fine when we execute it with a terminal.
Could you patch the player to output the working directory (getcwd()) on startup? And then give me the output for both cases (double click and console)
The launcher (how is it called again, Finder?) will likely start in the home directory.
I actually had this problem the other way around when packaging mkxp.
It switches to the directory of the executable on startup to read configuration files and assets:
/* set working directory */
char *dataDir = SDL_GetBasePath();
int result = chdir(dataDir);
So when installed in /usr/bin this makes no sense 😀. However, this code might be useful here.
Ho nice ^^.
I've patched the Player as you asked me Ghabry. This is the result.
Execution with terminal :
Execution by double click :
An OS X specific patch could compare user homedir, e.g. getenv("HOME") with the working directory, this hack probably would be reliable enough.
The purpose of this condition is to prevent chdir when launched from command line from a different path.
Just got reminded of this. I don't like the SDL dependency but is a better short-term solution then trying to get the Objective C compiler working which is required for the MacOS API >.<
Change working directory on MacOS to the application directory when r…
…un from Finder. Fix #705
This works like a charm :).