初始化

This commit is contained in:
2025-10-10 19:41:11 +08:00
commit 096ea34568
501 changed files with 12161 additions and 0 deletions

13
preload.js Normal file
View File

@@ -0,0 +1,13 @@
// preload.js
const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('electronAPI', {
// 主动触发检查
checkForUpdates: () => ipcRenderer.send('updater:check'),
// 安装更新
installNow: () => ipcRenderer.send('updater:install-now'),
// 订阅状态
onUpdateStatus: (cb) => ipcRenderer.on('update:status', (_e, payload) => cb(payload)),
// 订阅进度
onUpdateProgress: (cb) => ipcRenderer.on('update:progress', (_e, payload) => cb(payload)),
});