diff --git a/electron.ts b/electron.ts index 4c5066b8b..5c112d56d 100644 --- a/electron.ts +++ b/electron.ts @@ -9,7 +9,7 @@ import windowService from "./src/services/window.js"; import tray from "./src/services/tray.js"; // Prevent Trilium starting twice on first install and on uninstall for the Windows installer. -if (require('electron-squirrel-startup')) { +if (await import('electron-squirrel-startup')) { process.exit(0); } diff --git a/package-lock.json b/package-lock.json index 6c40d5b52..287e648f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@braintree/sanitize-url": "^7.1.0", "@electron/remote": "2.1.2", "@excalidraw/excalidraw": "^0.17.6", + "@types/electron-squirrel-startup": "^1.0.2", "archiver": "^7.0.1", "async-mutex": "^0.5.0", "axios": "^1.7.2", @@ -2245,6 +2246,11 @@ "integrity": "sha512-nv+GSx77ZtXiJzwKdsASqi+YQ5Z7vwHsTP0JY2SiQgjGckkBRKZnk8nIM+7oUZ1VCtuTz0+By4qVR7fqzp/Dfg==", "dev": true }, + "node_modules/@types/electron-squirrel-startup": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/electron-squirrel-startup/-/electron-squirrel-startup-1.0.2.tgz", + "integrity": "sha512-AzxnvBzNh8K/0SmxMmZtpJf1/IWoGXLP+pQDuUaVkPyotI8ryvAtBSqgxR/qOSvxWHYWrxkeNsJ+Ca5xOuUxJQ==" + }, "node_modules/@types/escape-html": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@types/escape-html/-/escape-html-1.0.4.tgz", diff --git a/package.json b/package.json index cf2ab726b..ff467e582 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "@braintree/sanitize-url": "^7.1.0", "@electron/remote": "2.1.2", "@excalidraw/excalidraw": "^0.17.6", + "@types/electron-squirrel-startup": "^1.0.2", "archiver": "^7.0.1", "async-mutex": "^0.5.0", "axios": "^1.7.2",