mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-13 03:32:13 +00:00
feat: remove old vbs file
This commit is contained in:
parent
d481164bf3
commit
29b64237ed
1 changed files with 15 additions and 0 deletions
|
@ -1,6 +1,17 @@
|
||||||
import { registerEvent } from "../register-event";
|
import { registerEvent } from "../register-event";
|
||||||
import AutoLaunch from "auto-launch";
|
import AutoLaunch from "auto-launch";
|
||||||
import { app } from "electron";
|
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 (
|
const autoLaunch = async (
|
||||||
_event: Electron.IpcMainInvokeEvent,
|
_event: Electron.IpcMainInvokeEvent,
|
||||||
|
@ -15,6 +26,10 @@ const autoLaunch = async (
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
appLauncher.enable().catch(() => {});
|
appLauncher.enable().catch(() => {});
|
||||||
} else {
|
} else {
|
||||||
|
if (process.platform == "win32") {
|
||||||
|
fs.rm(path.join(windowsStartupPath, "Hydra.vbs"), () => {});
|
||||||
|
}
|
||||||
|
|
||||||
appLauncher.disable().catch(() => {});
|
appLauncher.disable().catch(() => {});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue