add button to lunch steam when steam is not running

This commit is contained in:
MathieuG-P
2022-12-28 20:30:10 +01:00
parent a8ca0b26b3
commit 06622c4088
6 changed files with 63 additions and 1 deletions
+10
View File
@@ -3,6 +3,7 @@ import regedit from 'regedit'
import path from "path";
import { parse } from "@node-steam/vdf";
import { readFile } from "fs/promises";
import { spawn } from "child_process";
export class SteamService{
@@ -62,4 +63,13 @@ export class SteamService{
return null;
}
public openSteam(): Promise<boolean>{
const process = spawn("start", ["steam://open/games"], {shell: true});
return new Promise(resolve => {
process.on("exit", () => resolve(true));
process.on("error", () => resolve(false));
});
}
}