mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-19 01:03:57 +00:00
feat: adding commonredist
This commit is contained in:
@@ -39,6 +39,7 @@ import "./misc/show-open-dialog";
|
||||
import "./misc/get-features";
|
||||
import "./misc/show-item-in-folder";
|
||||
import "./misc/get-badges";
|
||||
import "./misc/install-commonredist";
|
||||
import "./torrenting/cancel-game-download";
|
||||
import "./torrenting/pause-game-download";
|
||||
import "./torrenting/resume-game-download";
|
||||
|
||||
26
src/main/events/misc/install-commonredist.ts
Normal file
26
src/main/events/misc/install-commonredist.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { app } from "electron";
|
||||
import path from "node:path";
|
||||
import cp from "node:child_process";
|
||||
import { registerEvent } from "../register-event";
|
||||
import { logger } from "@main/services";
|
||||
|
||||
const installScriptPath = app.isPackaged
|
||||
? path.join(process.resourcesPath, "commonredist", "install.bat")
|
||||
: path.join(
|
||||
__dirname,
|
||||
"..",
|
||||
"..",
|
||||
"resources",
|
||||
"commonredist",
|
||||
"install.bat"
|
||||
);
|
||||
|
||||
const installCommonRedist = async (_event: Electron.IpcMainInvokeEvent) => {
|
||||
cp.execFile(installScriptPath, (error) => {
|
||||
if (error) {
|
||||
logger.error(error);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
registerEvent("installCommonRedist", installCommonRedist);
|
||||
Reference in New Issue
Block a user