FlashpointProject / launcher

Launcher for Flashpoint Archive

Home Page:https://flashpointarchive.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] MacOS: Launcher cannot load its own config and preferences

n0samu opened this issue · comments

Describe the bug
On MacOS, the launcher is unable to load its own preferences/config when opened directly because it tries to read the config.json file from its working directory. On MacOS, the working directory of the executable is inside of the app package, which is not where the config,json file is stored. Also, relative Flashpoint Paths (set in the Config tab) are interpreted as relative to the current working directory, rather than being relative to the directory where the app package is located (the main Launcher directory).

I believe that this problem is caused by using app.getPath('exe') to get the path to the launcher's containing folder. app.getAppPath() should be used instead because it has the correct behavior on all platforms: https://github.com/electron/electron/blob/main/docs/api/app.md#appgetapppath

To Reproduce
Steps to reproduce the behavior:

  1. Download the Flashpoint Infinity for Mac Beta: https://bluemaxima.org/flashpoint/datahub/Mac_Support#Latest_Package
  2. On a Mac, unzip the file and double-click the Flashpoint Launcher app. You'll see that Flashpoint does not work properly, as described in detail above,

Expected behavior
Flashpoint should try to read its config file from the main Launcher folder, not from its app package. And relative Flashpoint Paths should be relative to the Launcher directory, as they are on Windows.

Desktop (please complete the following information):

  • OS: MacOS