diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 139ef09..463061a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -170,6 +170,7 @@ jobs: path: | apps/desktop/out/make/squirrel.windows/${{ matrix.arch }}/*.exe apps/desktop/out/make/squirrel.windows/${{ matrix.arch }}/*.nupkg + apps/desktop/out/make/squirrel.windows/${{ matrix.arch }}/RELEASES release: name: Create Release @@ -241,5 +242,6 @@ jobs: artifacts/macos-x64/zip/darwin/x64/*.zip artifacts/windows-x64/*.exe artifacts/windows-x64/*.nupkg + artifacts/windows-x64/RELEASES env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/apps/desktop/src/main/main.ts b/apps/desktop/src/main/main.ts index 2dd17c4..c96b367 100644 --- a/apps/desktop/src/main/main.ts +++ b/apps/desktop/src/main/main.ts @@ -6,11 +6,17 @@ import { app } from "electron"; import started from "electron-squirrel-startup"; import { AppManager } from "./core/app-manager"; import { updateElectronApp } from "update-electron-app"; +import { isWindows } from "../utils/platform"; if (started) { app.quit(); } +// Set App User Model ID for Windows (required for Squirrel.Windows) +if (isWindows()) { + app.setAppUserModelId("com.amical.desktop"); +} + // Enforce single instance const gotTheLock = app.requestSingleInstanceLock(); @@ -20,9 +26,19 @@ if (!gotTheLock) { } // Set up auto-updater for production builds -if (app.isPackaged) { +if (app.isPackaged && !isWindows()) { updateElectronApp(); } +if (app.isPackaged && isWindows()) { + // Check if running with --squirrel-firstrun (Windows only) + const isSquirrelFirstRun = process.argv.includes("--squirrel-firstrun"); + // Delay update check on Windows to avoid Squirrel file lock issues + if (isWindows() && !isSquirrelFirstRun) { + setTimeout(() => { + updateElectronApp(); + }, 60000); // 60 second delay + } +} const appManager = new AppManager();