fix: open game with parameters

This commit is contained in:
Zamitto 2024-12-31 19:38:17 -03:00
parent 0661cbd661
commit 1226483deb
4 changed files with 10 additions and 7 deletions

View file

@ -20,13 +20,16 @@ const openGame = async (
{ executablePath: parsedPath, launchOptions }
);
if (process.platform === "linux" || process.platform === "darwin") {
if (
process.platform === "linux" ||
process.platform === "darwin" ||
parsedParams.length === 0
) {
shell.openPath(parsedPath);
return;
}
if (process.platform === "win32") {
spawn(parsedPath, parsedParams, { shell: false, detached: true });
}
spawn(parsedPath, parsedParams, { shell: false, detached: true });
};
registerEvent("openGame", openGame);