FlashpointProject / launcher

Launcher for Flashpoint Archive
https://flashpointarchive.org
Other
941 stars 54 forks source link

[BUG] Relative Flashpoint Path is highlighted in red on MacOS even when valid #378

Open n0samu opened 1 year ago

n0samu commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Set a valid relative Flashpoint Path in MacOS, such as ../ (when using our current Flashpoint folder structure)
  2. After clicking "Save and Restart" Flashpoint will work fine. Yet the path will still be highlighted in red on the Config tab.

Expected behavior When typing in a valid relative Flashpoint Path, the text box highlight should change to green.

Screenshots image

Desktop (please complete the following information):

Additional context The problem is in renderer/Util.ts:

// @TODO Move this to the back process
export function isFlashpointValidCheck(flashpointPath: string): Promise<boolean> {
  return new Promise(resolve => fs.stat(path.join(flashpointPath, 'FPSoftware'), error => resolve(!error)));
}

On MacOS, we need to resolve the Flashpoint Path path relative to the path to the launcher's .app package, rather than relative to the executable file (which is inside the .app package).