fix: autoUpdater

This commit is contained in:
Artemy 2023-06-21 15:07:51 +03:00
parent 4b332b8aa2
commit 9738b6349a

View file

@ -17,6 +17,32 @@ import { app, shell, BrowserWindow } from 'electron'
import { join } from 'path' import { join } from 'path'
import { electronApp, optimizer, is } from '@electron-toolkit/utils' import { electronApp, optimizer, is } from '@electron-toolkit/utils'
import icon from '../../resources/icon.png?asset' 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() { function createWindow() {
// Create the browser window. // Create the browser window.