mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-23 19:01:02 +00:00
feat: setting external common redist
This commit is contained in:
@@ -39,7 +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 "./misc/install-common-redist";
|
||||
import "./torrenting/cancel-game-download";
|
||||
import "./torrenting/pause-game-download";
|
||||
import "./torrenting/resume-game-download";
|
||||
|
||||
10
src/main/events/misc/install-common-redist.ts
Normal file
10
src/main/events/misc/install-common-redist.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { registerEvent } from "../register-event";
|
||||
import { CommonRedistManager } from "@main/services/common-redist-manager";
|
||||
|
||||
const installCommonRedist = async (_event: Electron.IpcMainInvokeEvent) => {
|
||||
if (await CommonRedistManager.canInstallCommonRedist()) {
|
||||
CommonRedistManager.installCommonRedist();
|
||||
}
|
||||
};
|
||||
|
||||
registerEvent("installCommonRedist", installCommonRedist);
|
||||
@@ -1,26 +0,0 @@
|
||||
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