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.