From 85192f13afc232d6c46d162550b3986bc8a7db0d Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Tue, 15 Apr 2025 15:48:58 +0100 Subject: [PATCH] feat: adding box shadow --- src/main/services/aria2.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/main/services/aria2.ts diff --git a/src/main/services/aria2.ts b/src/main/services/aria2.ts new file mode 100644 index 00000000..e0001b82 --- /dev/null +++ b/src/main/services/aria2.ts @@ -0,0 +1,28 @@ +import path from "node:path"; +import cp from "node:child_process"; +import { app } from "electron"; + +export class Aria2 { + private static process: cp.ChildProcess | null = null; + + public static spawn() { + const binaryPath = app.isPackaged + ? path.join(process.resourcesPath, "aria2", "aria2c") + : path.join(__dirname, "..", "..", "aria2", "aria2c"); + + this.process = cp.spawn( + binaryPath, + [ + "--enable-rpc", + "--rpc-listen-all", + "--file-allocation=none", + "--allow-overwrite=true", + ], + { stdio: "inherit", windowsHide: true } + ); + } + + public static kill() { + this.process?.kill(); + } +}