feat: remove old vbs file

This commit is contained in:
Zamitto 2024-07-03 17:57:03 -03:00
parent d481164bf3
commit 29b64237ed

View file

@ -1,6 +1,17 @@
import { registerEvent } from "../register-event";
import AutoLaunch from "auto-launch";
import { app } from "electron";
import path from "path";
import fs from "node:fs";
const windowsStartupPath = path.join(
app.getPath("appData"),
"Microsoft",
"Windows",
"Start Menu",
"Programs",
"Startup"
);
const autoLaunch = async (
_event: Electron.IpcMainInvokeEvent,
@ -15,6 +26,10 @@ const autoLaunch = async (
if (enabled) {
appLauncher.enable().catch(() => {});
} else {
if (process.platform == "win32") {
fs.rm(path.join(windowsStartupPath, "Hydra.vbs"), () => {});
}
appLauncher.disable().catch(() => {});
}
};