Skip to content

Commit d673a43

Browse files
fix: disable electron-updater in dev mode to prevent app-update.yml error
Made-with: Cursor
1 parent 4d4c4be commit d673a43

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/main/updater.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,18 @@ autoUpdater.logger = log
66
autoUpdater.autoDownload = false
77
autoUpdater.autoInstallOnAppQuit = false
88

9+
const isDev = !!process.env['ELECTRON_RENDERER_URL']
10+
911
export function setupAutoUpdater(getWindow: () => BrowserWindow | null): void {
12+
// In dev mode, register no-op handlers — app-update.yml doesn't exist in dev
13+
if (isDev) {
14+
ipcMain.handle('updater:check', async () => ({ success: false, error: 'Not available in dev mode' }))
15+
ipcMain.handle('updater:download', async () => ({ success: false, error: 'Not available in dev mode' }))
16+
ipcMain.handle('updater:install', () => {})
17+
ipcMain.handle('updater:open-release', (_e, url: string) => { shell.openExternal(url) })
18+
return
19+
}
20+
1021
const send = (channel: string, ...args: unknown[]) => {
1122
getWindow()?.webContents.send(channel, ...args)
1223
}

tsconfig.node.tsbuildinfo

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)