feat: switch to electron-updater for auto-updates
Replaces the custom server-poll updater (which depended on a placeholder serverUrl 'https://your-server.com/api' and never fired in practice) with electron-updater. Now a banner appears automatically when a new release is published — auto-download in background, in-place install via quitAndInstall, delta updates via blockmap. Changes: - Add electron-updater dep, build.publish (provider: generic, placeholder URL) - Rewrite UpdaterManager around autoUpdater events (available/progress/ downloaded/error), forwarded to renderer via window.webContents.send - Drop hardcoded APP_VERSION constant; main uses app.getVersion(), renderer fetches via new GET_APP_VERSION IPC channel - IPC: drop DOWNLOAD_UPDATE (autoDownload handles it), add INSTALL_UPDATE + GET_APP_VERSION - VersionInfo reshaped (currentVersion field, no downloadUrl/mandatory); add UpdateProgress and UpdateCheckResult types - UpdateNotification: 3-phase UI (downloading with progress bar, ready with restart-and-install, hidden); App.tsx tracks phase state TODO before first real release: - Replace build.publish.url placeholder with the actual generic host - Bump version, run package:win, upload latest.yml + .exe + .blockmap to host Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -59,11 +59,21 @@ export interface ActiveTab {
|
||||
// Version Check Types
|
||||
export interface VersionInfo {
|
||||
latestVersion: string;
|
||||
updateAvailable: boolean;
|
||||
downloadUrl: string;
|
||||
changelog: string;
|
||||
currentVersion: string;
|
||||
releaseDate: string;
|
||||
mandatory: boolean;
|
||||
changelog: string;
|
||||
}
|
||||
|
||||
export interface UpdateProgress {
|
||||
percent: number;
|
||||
bytesPerSecond: number;
|
||||
transferred: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
export interface UpdateCheckResult {
|
||||
updateAvailable: boolean;
|
||||
latestVersion: string;
|
||||
}
|
||||
|
||||
// Proxy Types
|
||||
@@ -113,7 +123,8 @@ export enum IPC_CHANNELS {
|
||||
|
||||
// Version
|
||||
CHECK_VERSION = 'version:check',
|
||||
DOWNLOAD_UPDATE = 'version:download',
|
||||
INSTALL_UPDATE = 'version:install',
|
||||
GET_APP_VERSION = 'app:version',
|
||||
|
||||
// Settings
|
||||
GET_SETTINGS = 'settings:get',
|
||||
|
||||
Reference in New Issue
Block a user