From 4357454b141e9b2766ba10943194aa23b29fbf99 Mon Sep 17 00:00:00 2001 From: MathieuG-P <40181755+Zagrios@users.noreply.github.com> Date: Wed, 1 Mar 2023 21:02:06 +0100 Subject: [PATCH] [hotfix] open debug console when launch BS with debug mode --- src/main/services/bs-launcher.service.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/services/bs-launcher.service.ts b/src/main/services/bs-launcher.service.ts index e15811c4..416bf95c 100644 --- a/src/main/services/bs-launcher.service.ts +++ b/src/main/services/bs-launcher.service.ts @@ -44,12 +44,21 @@ export class BSLauncherService{ if(!this.utilsService.pathExist(exePath)){ return "EXE_NOT_FINDED"; } - const launchMods = [launchOptions.oculus && "-vrmode oculus", launchOptions.desktop && "fpfc", launchOptions.debug && "--verbose"]; + const launchMods = []; - this.bsProcess = spawn(`\"${exePath}\"`, launchMods, {shell: true, cwd, env: {...process.env, "SteamAppId": BS_APP_ID}}); + if(launchOptions.oculus){ launchMods.push("-vrmode oculus"); } + if(launchOptions.desktop){ launchMods.push("fpfc"); } + if(launchOptions.debug){ launchMods.push("--verbose"); } - this.bsProcess.on('message', msg => { /** EMIT HERE **/ }); - this.bsProcess.on('error', err => { /** EMIT HERE **/ }); + if(launchOptions.debug){ + this.bsProcess = spawn(`\"${exePath}\"`, launchMods, {shell: true, cwd, env: {...process.env, "SteamAppId": BS_APP_ID}, detached: true, windowsVerbatimArguments: true }); + } + else{ + this.bsProcess = spawn(`\"${exePath}\"`, launchMods, {shell: true, cwd, env: {...process.env, "SteamAppId": BS_APP_ID} }); + } + + this.bsProcess.on('message', msg => console.log(msg)); + this.bsProcess.on('error', err => console.log(err)); this.bsProcess.on('exit', code => this.utilsService.ipcSend("bs-launch.exit", {data: code, success: code === 0})); return "LAUNCHED";