diff --git a/electron-builder.json5 b/electron-builder.json5 index 1766dc2..600e5b8 100644 --- a/electron-builder.json5 +++ b/electron-builder.json5 @@ -80,10 +80,6 @@ { "target": "nsis", "arch": ["x64"] - }, - { - "target": "squirrel", - "arch": ["x64"] } ], "icon": "icons/icon.ico", diff --git a/electron/main.js b/electron/main.js index 284b4af..7f79737 100644 --- a/electron/main.js +++ b/electron/main.js @@ -11,68 +11,11 @@ const http = require('http'); const AdmZip = require('adm-zip'); const { autoUpdater } = require('electron-updater'); -// Handle Squirrel events for Windows installer -if (require('electron-squirrel-startup')) { - app.quit(); -} - // Development mode detection - MUST be declared before any code that might use it const isDev = process.env.NODE_ENV === 'development' || !app.isPackaged; const VITE_DEV_SERVER = 'http://localhost:38347'; const PORT = 44548; -// Handle Squirrel.Windows installation/update events -if (process.platform === 'win32') { - const handleSquirrelEvent = () => { - if (process.argv.length === 1) { - return false; - } - - const squirrelEvent = process.argv[1]; - - switch (squirrelEvent) { - case '--squirrel-install': - case '--squirrel-updated': - // Install desktop and start menu shortcuts - const cp = require('child_process'); - const updateDotExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe'); - const target = path.basename(process.execPath); - const createShortcut = `${updateDotExe} --createShortcut=${target}`; - - cp.exec(createShortcut, () => { - app.quit(); - }); - return true; - - case '--squirrel-uninstall': - // Remove desktop and start menu shortcuts - const cpUninstall = require('child_process'); - const updateDotExeUninstall = path.resolve(path.dirname(process.execPath), '..', 'Update.exe'); - const targetUninstall = path.basename(process.execPath); - const removeShortcut = `${updateDotExeUninstall} --removeShortcut=${targetUninstall}`; - - cpUninstall.exec(removeShortcut, () => { - app.quit(); - }); - return true; - - case '--squirrel-obsolete': - // This is called on the outgoing version of your app before - // we update to the new version - it's the opposite of - // --squirrel-updated - app.quit(); - return true; - } - - return false; - }; - - if (handleSquirrelEvent()) { - // Squirrel event handled and app will exit in 1000ms, so don't do anything else - return; - } -} - const execAsync = promisify(exec); const store = new Store(); diff --git a/package.json b/package.json index ffdea9a..a3fbcee 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "adm-zip": "^0.5.16", "body-parser": "2.2.2", "cors": "2.8.6", - "electron-squirrel-startup": "^1.0.1", "electron-store": "^8.2.0", "electron-updater": "^6.3.9", "express": "5.2.1",