From e0f0ff86338e48a97fed152eca20d9497730e9d4 Mon Sep 17 00:00:00 2001 From: B Date: Wed, 1 Jun 2022 13:38:12 -0600 Subject: added origin check --- src/utils.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src') diff --git a/src/utils.js b/src/utils.js index b69a9a2..d67792a 100644 --- a/src/utils.js +++ b/src/utils.js @@ -101,6 +101,28 @@ async function isGameRunning() { }); } +async function isOriginRunning() { + return new Promise(resolve => { + let procs = ["origin.exe"]; //check this, probably not right + let cmd = (() => { + switch (process.platform) { + case "linux": return "ps -A"; + case "win32": return "tasklist"; + } + })(); + + exec(cmd, (err, stdout) => { + procs.forEach( proc => { + if (stdout.includes(proc)) { + resolve(true); + return; + } + resolve(false); + }); + }); + }); +} + // Handles auto updating Northstar. // // It uses isGameRunning() to ensure it doesn't run while the game is -- cgit v1.2.3