autoupdate
Some checks failed
Build / increment-version (push) Successful in 11s
Build / build-linux (push) Successful in 2m5s
Build / build-windows (push) Failing after 4m44s
Build / create-release (push) Successful in 44s

This commit is contained in:
2026-05-13 04:15:20 +10:00
parent 1d7a48c57e
commit 51b13e0fcd
3 changed files with 0 additions and 62 deletions

View File

@@ -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();