From c098d8ffcf5a8951ef2b8df2633623c79913a737 Mon Sep 17 00:00:00 2001 From: Davi Souto Date: Thu, 26 Dec 2024 22:17:22 -0300 Subject: [PATCH] fix: added detached to the spawn to fix the game closing with the launcher --- src/main/events/library/open-game.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/events/library/open-game.ts b/src/main/events/library/open-game.ts index 054a7cb5..f43dd1a9 100644 --- a/src/main/events/library/open-game.ts +++ b/src/main/events/library/open-game.ts @@ -15,14 +15,17 @@ const openGame = async ( const parsedPath = parseExecutablePath(executablePath); const parsedParams = parseLaunchOptions(launchOptions); - await gameRepository.update({ id: gameId }, { executablePath: parsedPath, launchOptions }); + await gameRepository.update( + { id: gameId }, + { executablePath: parsedPath, launchOptions } + ); if (process.platform === "linux" || process.platform === "darwin") { shell.openPath(parsedPath); } if (process.platform === "win32") { - spawn(parsedPath, parsedParams, { shell: false }); + spawn(parsedPath, parsedParams, { shell: false, detached: true }); } };