更新
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
// electron/main/updater.ts
|
||||
// 自动更新模块
|
||||
import { autoUpdater } from 'electron-updater'
|
||||
// electron-updater is CommonJS with a lazy getter for `autoUpdater`, so a named
|
||||
// ESM import fails at runtime under Node ESM (cjs-module-lexer can't detect it).
|
||||
// Use the default interop import and access the instance lazily inside initUpdater
|
||||
// (after app.whenReady), matching the original intended evaluation timing.
|
||||
import electronUpdater from 'electron-updater'
|
||||
import { BrowserWindow, ipcMain } from 'electron'
|
||||
|
||||
let mainWindow: BrowserWindow | null = null
|
||||
|
||||
export function initUpdater(win: BrowserWindow): void {
|
||||
mainWindow = win
|
||||
const autoUpdater = electronUpdater.autoUpdater
|
||||
|
||||
// 检查更新
|
||||
ipcMain.handle('updater:check', async () => {
|
||||
|
||||
Reference in New Issue
Block a user