diff --git a/apps/desktop/electron/preload.ts b/apps/desktop/electron/preload.ts index 17ed4b6..55da108 100644 --- a/apps/desktop/electron/preload.ts +++ b/apps/desktop/electron/preload.ts @@ -28,6 +28,13 @@ import { type UpdateCheckResult, type UpdateProgress, } from './ipc-types'; +// Static import of the desktop package.json so the bundler inlines the +// version string at build time. The previous `process.env.npm_package_- +// version` approach worked in dev (pnpm sets it as a script env var) but +// fell back to '0.0.0' in packaged builds — every installed user got +// flagged as "Update verfügbar" against their own actually-current +// version. resolveJsonModule + esModuleInterop are on in tsconfig.node. +import pkg from '../package.json'; type Unsubscribe = () => void; @@ -40,7 +47,7 @@ function on(channel: string, cb: (payload: T) => void): Unsubscribe { const api = { platform: ELECTRON_RUNTIME_MARKER, osPlatform: process.platform as NodeJS.Platform, - appVersion: process.env.npm_package_version ?? '0.0.0', + appVersion: pkg.version, // Screen sources --------------------------------------------------------- getScreenSources: (): Promise => ipcRenderer.invoke(CHANNELS.SCREEN_GET_SOURCES),