Merge pull request #735 from Zagrios/bugfix/reduce-dll-deps-and-add-logs-file-to-external-scripts

Reduce DLL dependencies for "oculus-allow-dev-sideloaded.exe"  and add logging for external scripts

(cherry picked from commit a891ecb0db)
This commit is contained in:
MathieuG-P
2025-01-18 01:19:21 +01:00
parent 2c06184b65
commit 326cc1c79e
13 changed files with 551 additions and 24 deletions
@@ -11,6 +11,7 @@ import { CustomError } from "../../../shared/models/exceptions/custom-error.clas
import isElevated from "is-elevated";
import { UtilsService } from "../utils.service";
import { exec } from "child_process";
import { app } from "electron";
export class SteamLauncherService extends AbstractLauncherService implements StoreLauncherInterface{
@@ -106,11 +107,20 @@ export class SteamLauncherService extends AbstractLauncherService implements Sto
obs.next({type: BSLaunchEvent.BS_LAUNCHING});
const env = {
...process.env,
"SteamAppId": BS_APP_ID,
"SteamOverlayGameId": BS_APP_ID,
"SteamGameId": BS_APP_ID,
};
const spawnOpts = { env, cwd: bsFolderPath };
const launchPromise = !launchOptions.admin ? (
this.launchBs(exePath, launchArgs, { env: {...process.env, "SteamAppId": BS_APP_ID} }).exit
) : (
new Promise<number>(resolve => {
const adminProcess = exec(`"${this.getStartBsAsAdminExePath()}" "${exePath}" ${launchArgs.join(" ")}`, { env: {...process.env, "SteamAppId": BS_APP_ID} });
const adminProcess = exec(`"${this.getStartBsAsAdminExePath()}" "${exePath}" ${launchArgs.join(" ")} --log-path "${path.join(app.getPath("logs"), "bs-admin-start.log")}"`, spawnOpts);
adminProcess.on("error", err => {
log.error("Error while starting BS as Admin", err);
resolve(-1)
+2 -2
View File
@@ -3,7 +3,7 @@ import { pathExist, resolveGUIDPath } from "../helpers/fs.helpers";
import log from "electron-log";
import { lstat } from "fs-extra";
import { tryit } from "../../shared/helpers/error.helpers";
import { shell } from "electron";
import { app, shell } from "electron";
import { taskRunning } from "../helpers/os.helpers";
import { sToMs } from "../../shared/helpers/time.helpers";
import { execOnOs } from "../helpers/env.helpers";
@@ -169,7 +169,7 @@ export class OculusService {
return new Promise((resolve, reject) => {
log.info("Enabling sideloaded apps");
const process = exec(exePath);
const process = exec(`"${exePath}" --log-path "${path.join(app.getPath("logs"), "oculus-allow-dev-sideloaded.log")}"`);
process.on("exit", code => {
if(code === 0){
resolve();