mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-27 21:01:02 +00:00
Merge branch 'main' into hyd-228-investigate-why-users-are-being-logged-out-when-updating
# Conflicts: # src/main/events/user-preferences/auto-launch.ts
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
import { windowsStartupPath } from "@main/constants";
|
||||
import { registerEvent } from "../register-event";
|
||||
import AutoLaunch from "auto-launch";
|
||||
import { app } from "electron";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
const autoLaunch = async (
|
||||
_event: Electron.IpcMainInvokeEvent,
|
||||
@@ -15,23 +12,10 @@ const autoLaunch = async (
|
||||
name: app.getName(),
|
||||
});
|
||||
|
||||
if (process.platform == "win32") {
|
||||
const destination = path.join(windowsStartupPath, "Hydra.vbs");
|
||||
|
||||
if (enabled) {
|
||||
const scriptPath = path.join(process.resourcesPath, "hydralauncher.vbs");
|
||||
|
||||
fs.copyFileSync(scriptPath, destination);
|
||||
} else {
|
||||
appLauncher.disable().catch(() => {});
|
||||
fs.rmSync(destination);
|
||||
}
|
||||
if (enabled) {
|
||||
appLauncher.enable().catch(() => {});
|
||||
} else {
|
||||
if (enabled) {
|
||||
appLauncher.enable().catch(() => {});
|
||||
} else {
|
||||
appLauncher.disable().catch(() => {});
|
||||
}
|
||||
appLauncher.disable().catch(() => {});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user