Skip to content
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

[BUG] Browser Mode extension is broken on MacOS #333

Open
n0samu opened this issue May 17, 2022 · 3 comments · Fixed by #344
Open

[BUG] Browser Mode extension is broken on MacOS #333

n0samu opened this issue May 17, 2022 · 3 comments · Fixed by #344
Labels
bug Something isn't working

Comments

@n0samu
Copy link
Member

n0samu commented May 17, 2022

Describe the bug
Games that use :browser-mode: fail to launch on MacOS. When clicking the Play button, nothing happens. One of the games affected is Mini Metro: London.

Expected behavior
These games should launch in a separate launcher window (Browser Mode).

Desktop (please complete the following information):

  • OS: MacOS Catalina (10.15)
  • Flashpoint Version: 10.1 Infinity
  • Log text: INFO [21:13:44] Mini Metro: London: Mini Metro: London failed to start - spawn "/Users/nosamu/Flashpoint/Flashpoint 10.1 Infinity - Modded/Launcher/Flashpoint.app/Contents/Frameworks/Flashpoint Helper.app/Contents/MacOS/Flashpoint Helper" ENOENT

Additional context
I have verified that the Flashpoint Helper path actually exists, despite the launcher's ENOENT message.

@n0samu n0samu added the bug Something isn't working label May 17, 2022
@colin969
Copy link
Member

Can you make sure this happens on the latest version

@LindirQuenya
Copy link
Member

I've hunted it down: quotes are added to the filename regardless of execFile on Mac and Linux.

launcher/src/back/responses.ts

Lines 1354 to 1364 in 6d2bfc4

switch (process.platform) {
case 'win32':
return execFile ? filename : `"${filename}"`; // Quotes cause issues with execFile
case 'darwin':
case 'linux':
if (useWine) {
return `wine start /wait /unix "${filename}"`;
}
return `"${filename}"`;
default:
throw Error('Unsupported platform');

I'll be changing execFile(file, args) to spawn(file, args, {'shell':false}) in an upcoming PR. I'll fix this in that too.

@LindirQuenya LindirQuenya linked a pull request Jul 12, 2022 that will close this issue
@n0samu
Copy link
Member Author

n0samu commented Aug 17, 2022

Unfortunately, Browser Mode still seems to be broken. Here are the errors I receive now:
image

INFO  [15:23:44]                      (node:22878) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'preferences.json'
INFO  [15:23:44]                          at Object.openSync (node:fs:585:3)
INFO  [15:23:44]                          at Object.func [as openSync] (node:electron/js2c/asar_bundle:5:1812)
INFO  [15:23:44]                          at Object.readFileSync (node:fs:453:35)
INFO  [15:23:44]                          at e.readFileSync (node:electron/js2c/asar_bundle:5:9160)
INFO  [15:23:44]                          at readJsonFileSync (/Applications/Flashpoint/Flashpoint.app/Contents/Resources/app.asar/build/shared/Util.js:32:26)
INFO  [15:23:44]                          at Object.readOrCreateFileSync (/Applications/Flashpoint/Flashpoint.app/Contents/Resources/app.asar/build/shared/preferences/PreferencesFile.js:20:50)
INFO  [15:23:44]                          at startup (/Applications/Flashpoint/Flashpoint.app/Contents/Resources/app.asar/build/main/BrowserMode.js:32:57)
INFO  [15:23:44]                          at startBrowserMode (/Applications/Flashpoint/Flashpoint.app/Contents/Resources/app.asar/build/main/BrowserMode.js:22:11)
INFO  [15:23:44]                          at Object.<anonymous> (/Applications/Flashpoint/Flashpoint.app/Contents/Resources/app.asar/build/main/index.js:14:40)
INFO  [15:23:44]                          at Module._compile (node:internal/modules/cjs/loader:1118:14)
INFO  [15:23:44]                      (Use `Flashpoint Helper --trace-warnings ...` to show where the warning was created)
INFO  [15:23:44]                      (node:22878) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
INFO  [15:23:45]                      [0817/152345.035417:FATAL:electron_main_delegate_mac.mm(71)] Unable to find helper app

@n0samu n0samu reopened this Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants