Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- autoUpdater.on('checking-for-update', () => {
- //log.info('Checking for update');
- })
- autoUpdater.on('update-available', (info) => {
- //log.info('Update available.');
- autoUpdater.downloadUpdate();
- })
- autoUpdater.on('update-not-available', (info) => {
- log.info('Update not available.');
- const notif = new Notification({
- title: 'Update not available',
- body: 'You are using the latest version of Chisel CMS.'
- });
- notif.show();
- notif.addListener('click', notif.close);
- })
- autoUpdater.on('error', (err) => {
- log.warn('Error in auto-updater. ' + err);
- })
- autoUpdater.on('download-progress', (progressObj) => {
- let logMessage = "Download speed: " + progressObj.bytesPerSecond;
- logMessage = logMessage + ' - Downloaded ' + progressObj.percent + '%';
- logMessage = logMessage + ' (' + progressObj.transferred + "/" + progressObj.total + ')';
- log.info(logMessage);
- })
- autoUpdater.on('update-downloaded', (info) => {
- log.info('update downloaded');
- const notif = new Notification({
- title: 'Update was downloaded',
- body: 'Restart Chisel CMS app to install update.',
- actions: [{
- type: 'button',
- text: 'Restart'
- }]
- });
- notif.show();
- notif.addListener('action', autoUpdater.quitAndInstall)
- });
RAW Paste Data