diff --git a/apps/stage-tamagotchi/src/main/services/electron/auto-updater.ts b/apps/stage-tamagotchi/src/main/services/electron/auto-updater.ts index 5c1cd2e6b..182788c98 100644 --- a/apps/stage-tamagotchi/src/main/services/electron/auto-updater.ts +++ b/apps/stage-tamagotchi/src/main/services/electron/auto-updater.ts @@ -4,6 +4,8 @@ import type { UpdateInfo } from 'electron-updater' import type { AutoUpdaterState } from '../../../shared/eventa' +import { arch } from 'node:process' + import electronUpdater from 'electron-updater' import { is } from '@electron-toolkit/utils' @@ -21,6 +23,7 @@ import { import { MockAutoUpdater } from './mock-auto-updater' export interface AppUpdaterLike { + channel?: string on: (event: string, listener: (...args: any[]) => void) => any checkForUpdates: () => Promise downloadUpdate: () => Promise @@ -59,6 +62,10 @@ export function setupAutoUpdater(): AutoUpdater { let state: AutoUpdaterState = { status: 'idle' } const hooks = new Set<(state: AutoUpdaterState) => void>() + // Fix: explicitly map base channel to architecture to resolve 404 targets. + // electron-updater natively appends OS suffixes (-mac.yml, -linux.yml) automatically. + autoUpdater.channel = arch === 'arm64' ? 'latest-arm64' : 'latest-x64' + function broadcast(next: AutoUpdaterState) { state = next