diff --git a/electron-builder.yml b/electron-builder.yml index 6be24595..e460b4b7 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -39,8 +39,9 @@ appImage: artifactName: ${name}-${version}.${ext} npmRebuild: false publish: - provider: generic - url: https://example.com/auto-updates + provider: github + repo: cherry-studio + owner: kangfenmao electronDownload: mirror: https://npmmirror.com/mirrors/electron/ afterSign: scripts/notarize.js diff --git a/src/main/index.ts b/src/main/index.ts index eceaa7f7..80d98e03 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -4,6 +4,7 @@ import windowStateKeeper from 'electron-window-state' import { join } from 'path' import icon from '../../resources/icon.png?asset' import installExtension, { REDUX_DEVTOOLS } from 'electron-devtools-installer' +import { autoUpdater } from 'electron-updater' function createWindow(): void { // Load the previous state with fallback to defaults @@ -102,5 +103,7 @@ app.on('window-all-closed', () => { } }) +autoUpdater.checkForUpdatesAndNotify() + // In this file you can include the rest of your app"s specific main process // code. You can also put them in separate files and require them here.