diff options
| author | haoyuren <13851610112@163.com> | 2026-08-18 20:30:17 +0800 |
|---|---|---|
| committer | haoyuren <13851610112@163.com> | 2026-08-18 20:30:17 +0800 |
| commit | 1251d9208caadce626fd0706dfd34ba3e022fb2a (patch) | |
| tree | f8833a14bf299684778cce8e91a16347223bc559 /src/preload/index.ts | |
| parent | ec8214a4d111d92ce7c44de29d1706f241aa9514 (diff) | |
Add in-app update check with one-click installer downloadv0.6.1
On launch the home page checks the latest GitHub release; when a newer
version exists a bottom-right card offers Download (streams the right
installer for the platform into ~/Downloads and opens it), Later, or
Skip this version (remembered). Unsigned app rules out silent
auto-update on macOS, so installation stays a manual replace.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'src/preload/index.ts')
| -rw-r--r-- | src/preload/index.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/preload/index.ts b/src/preload/index.ts index ee9fd9b..116e8e2 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -385,6 +385,21 @@ const api = { }, closeWindow: () => ipcRenderer.invoke('window:close') as Promise<void>, + // Update check (GitHub Releases) + updateCheck: () => + ipcRenderer.invoke('update:check') as Promise<{ + available: boolean + current: string + version?: string + notes?: string + releaseUrl?: string + assetName?: string + assetUrl?: string + assetSize?: number + }>, + updateDownload: (url: string, name: string) => + ipcRenderer.invoke('update:download', url, name) as Promise<{ success: boolean; path?: string; message?: string }>, + // Shell openExternal: (url: string) => ipcRenderer.invoke('shell:openExternal', url), showInFinder: (path: string) => ipcRenderer.invoke('shell:showInFinder', path), |
