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

OS X : Double click on the Player file doesn't find game #705

Closed
BlisterB opened this Issue Dec 30, 2015 · 8 comments

Comments

Projects
None yet
4 participants
@BlisterB
Member

BlisterB commented Dec 30, 2015

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).

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Dec 30, 2015

Member

The game browser finding only works when the browser is one directory above the games currently

Member

Ghabry commented Dec 30, 2015

The game browser finding only works when the browser is one directory above the games currently

@BlisterB

This comment has been minimized.

Show comment
Hide comment
@BlisterB

BlisterB Dec 30, 2015

Member

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.

Member

BlisterB commented Dec 30, 2015

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.

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Dec 30, 2015

Member

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)

Member

Ghabry commented Dec 30, 2015

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)

@Ghabry Ghabry added this to the 0.4.1 milestone Dec 30, 2015

@carstene1ns

This comment has been minimized.

Show comment
Hide comment
@carstene1ns

carstene1ns Dec 30, 2015

Member

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();
    if (dataDir)
    {
        int result = chdir(dataDir);
        (void)result;
        SDL_free(dataDir);
    }

So when installed in /usr/bin this makes no sense 😀. However, this code might be useful here.

Member

carstene1ns commented Dec 30, 2015

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();
    if (dataDir)
    {
        int result = chdir(dataDir);
        (void)result;
        SDL_free(dataDir);
    }

So when installed in /usr/bin this makes no sense 😀. However, this code might be useful here.

@BlisterB

This comment has been minimized.

Show comment
Hide comment
@BlisterB

BlisterB Dec 31, 2015

Member

Ho nice ^^.

I've patched the Player as you asked me Ghabry. This is the result.
Execution with terminal :

/Users/mehdi/Desktop/Dyhortfight2

Execution by double click :

/Users/mehdi
Member

BlisterB commented Dec 31, 2015

Ho nice ^^.

I've patched the Player as you asked me Ghabry. This is the result.
Execution with terminal :

/Users/mehdi/Desktop/Dyhortfight2

Execution by double click :

/Users/mehdi
@fdelapena

This comment has been minimized.

Show comment
Hide comment
@fdelapena

fdelapena Dec 31, 2015

Contributor

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.

Contributor

fdelapena commented Dec 31, 2015

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.

@Ghabry Ghabry modified the milestones: 0.4.1, 0.5.0 Feb 19, 2016

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry May 10, 2016

Member

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 >.<

Member

Ghabry commented May 10, 2016

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 >.<

Ghabry added a commit to Ghabry/easyrpg-player that referenced this issue May 14, 2016

Ghabry added a commit to Ghabry/easyrpg-player that referenced this issue May 16, 2016

@fdelapena fdelapena closed this in dbb08a4 May 29, 2016

@BlisterB

This comment has been minimized.

Show comment
Hide comment
@BlisterB

BlisterB May 31, 2016

Member

This works like a charm :).

Member

BlisterB commented May 31, 2016

This works like a charm :).

@Ghabry Ghabry modified the milestones: 0.5.0, 0.4.2 Jun 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment