mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
22 lines
No EOL
851 B
JavaScript
22 lines
No EOL
851 B
JavaScript
const { app, autoUpdater } = require('electron')
|
|
const server = "https://download.smartfridge.space"
|
|
const url = `${server}/update/${process.platform}/${app.getVersion()}`
|
|
|
|
autoUpdater.setFeedURL({ url })
|
|
autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
|
|
const dialogOpts = {
|
|
type: 'info',
|
|
buttons: ['Restart', 'Later'],
|
|
title: 'ArmCord Update',
|
|
message: process.platform === 'win32' ? releaseNotes : releaseName,
|
|
detail: 'A new version has been downloaded. Restart the application to apply the updates.'
|
|
}
|
|
|
|
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
|
if (returnValue.response === 0) autoUpdater.quitAndInstall()
|
|
})
|
|
})
|
|
autoUpdater.on('error', message => {
|
|
console.error('There was a problem updating the application')
|
|
console.error(message)
|
|
}) |