feat: implement auto-update functionality with GitHub integration

- Added AutoUpdater class to manage update checks and downloads.
- Integrated auto-updater in the main process after the main window is created.
- Enhanced preload script to expose update-related IPC channels.
- Created UpdateDialog component to handle user interactions for updates.
- Implemented state management for update status using Pinia store.
- Added localization support for update messages in multiple languages.
- Documented auto-update configuration steps for private GitHub repositories.
- Created .env.example for GitHub token configuration.
This commit is contained in:
zhanggy committed 2025-10-28 22:53:26 +08:00
1 parent ac5488a21d
commit 0eb2dcf8c2
22 files changed
+882 -92

No files matched your search

+7
View File
@@ -3,9 +3,11 @@ import Constants from './utils/Constants'
import { createErrorWindow, createMainWindow } from './MainRunner'
import log from 'electron-log/main'
import { join } from 'path'
import { AutoUpdater } from './AutoUpdater'
let mainWindow
let errorWindow
let autoUpdater: AutoUpdater | null = null
const initializeMainLogger = () => {
log.initialize({
@@ -52,6 +54,11 @@ app.on('ready', async () => {
initializeMainLogger()
mainWindow = await createMainWindow()
// Initialize auto updater after main window is created
if (!Constants.IS_DEV_ENV) {
autoUpdater = new AutoUpdater(mainWindow)
}
})
app.on('activate', async () => {