Skip to content

Commit

Permalink
Merge pull request #412 from Zagrios/bugfix/regedit-rs-broke-linux-su…
Browse files Browse the repository at this point in the history
…pport/411

[bugfix-411] dynamically import regedit-rs depending on the os
  • Loading branch information
Zagrios authored Jan 27, 2024
2 parents 4fc5a87 + 536690d commit 344cce9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/services/liv/liv.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { execOnOs } from "../../helpers/env.helpers";
import { list, createKey, putValue, deleteKey, RegSzValue } from "regedit-rs";
import path from "path";
import { Log } from "../../decorators/log.decorator";

const { list, createKey, putValue, deleteKey, RegSzValue } = (execOnOs({ win32: () => require("regedit-rs") }, true) ?? {}) as typeof import("regedit-rs");

export class LivService {

private static instance: LivService;
Expand Down
4 changes: 3 additions & 1 deletion src/main/services/oculus.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { list } from "regedit-rs";
import path from "path";
import { pathExist, resolveGUIDPath } from "../helpers/fs.helpers";
import log from "electron-log";
Expand All @@ -7,6 +6,9 @@ import { tryit } from "../../shared/helpers/error.helpers";
import { shell } from "electron";
import { taskRunning } from "../helpers/os.helpers";
import { sToMs } from "../../shared/helpers/time.helpers";
import { execOnOs } from "../helpers/env.helpers";

const { list } = (execOnOs({ win32: () => require("regedit-rs") }, true) ?? {}) as typeof import("regedit-rs");

export class OculusService {
private static instance: OculusService;
Expand Down
5 changes: 4 additions & 1 deletion src/main/services/steam.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { list, RegDwordValue } from "regedit-rs"
import { RegDwordValue } from "regedit-rs"
import path from "path";
import { parse } from "@node-steam/vdf";
import { readFile } from "fs/promises";
Expand All @@ -7,6 +7,9 @@ import log from "electron-log";
import { app, shell } from "electron";
import { getProcessPid, taskRunning } from "../helpers/os.helpers";
import { isElevated } from "query-process";
import { execOnOs } from "../helpers/env.helpers";

const { list } = (execOnOs({ win32: () => require("regedit-rs") }, true) ?? {}) as typeof import("regedit-rs");

export class SteamService {

Expand Down

0 comments on commit 344cce9

Please sign in to comment.