From ed978af3ae6241b60eca457e6c1eb1c1dd15f801 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:16:33 -0300 Subject: [PATCH] feat: disable old windows auto launch --- src/main/events/user-preferences/auto-launch.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/events/user-preferences/auto-launch.ts b/src/main/events/user-preferences/auto-launch.ts index 37831db9..6b73d135 100644 --- a/src/main/events/user-preferences/auto-launch.ts +++ b/src/main/events/user-preferences/auto-launch.ts @@ -11,6 +11,10 @@ const autoLaunch = async ( ) => { if (!app.isPackaged) return; + const appLauncher = new AutoLaunch({ + name: app.getName(), + }); + if (process.platform == "win32") { const destination = path.join(windowsStartupPath, "hydralauncher.vbs"); @@ -19,12 +23,10 @@ const autoLaunch = async ( fs.copyFileSync(scriptPath, destination); } else { + appLauncher.disable().catch(); fs.rmSync(destination); } } else { - const appLauncher = new AutoLaunch({ - name: app.getName(), - }); if (enabled) { appLauncher.enable().catch(); } else {