From 9738b6349ac76d207121ddf7a1e36be0814837eb Mon Sep 17 00:00:00 2001 From: Artemy Date: Wed, 21 Jun 2023 15:07:51 +0300 Subject: [PATCH] fix: autoUpdater --- src/main/index.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/main/index.js b/src/main/index.js index 1bad0b2..d70e149 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -17,6 +17,32 @@ import { app, shell, BrowserWindow } from 'electron' import { join } from 'path' import { electronApp, optimizer, is } from '@electron-toolkit/utils' import icon from '../../resources/icon.png?asset' +import { autoUpdater } from 'electron-updater' + +autoUpdater.checkForUpdatesAndNotify() + +autoUpdater.on('checking-for-update', () => { + console.log('Checking for update...') +}) +autoUpdater.on('update-available', () => { + console.log('Update available.') +}) +autoUpdater.on('update-not-available', () => { + console.log('Update not available.') +}) +autoUpdater.on('error', () => { + console.log('Error in auto-updater.') +}) +autoUpdater.on('download-progress', () => { + console.log('Download progress...') +}) + +autoUpdater.on('update-downloaded', () => { + console.log('Update downloaded; will install in 5 seconds') + setTimeout(function () { + autoUpdater.quitAndInstall() + }, 5000) +}) function createWindow() { // Create the browser window.