Example #1
0
	function listenForUpdates() {
		autoUpdater.on('update-available', (updateInfo) => {
			if (!settings.get('autoUpdate')) {
				return;
			}
			showNotification('A new update is ready to download', 
				`Version ${updateInfo.version} is can be downloaded, click to start download`, () => {
					autoUpdater.downloadUpdate();
					setProgress(1);
					autoUpdater.signals.progress((info) => {
						setProgress(info.percent);
					});

					autoUpdater.signals.updateDownloaded((info) => {
						removeProgressBar();

						showNotification('Done downloading update', 
							'Click here to install and relaunch now', () => {
								app.relaunch();
								autoUpdater.quitAndInstall();
							});
					});
				});
		});
	}
Example #2
0
	export async function checkForUpdates() {
		showNotification('Checking for updates...');
		if (!listening) {
			setFeed();
		}
		autoUpdater.checkForUpdates();
	}
Example #3
0
ipcMain.on('app-ui-ready', () => {
  // Check for updates after the UI is loaded; otherwise the UI may miss the
  //'update-downloaded' event.
  if (!debugMode) {
    autoUpdater.checkForUpdates();
  }
});
Example #4
0
function checkForUpdates() {
  try {
    autoUpdater.checkForUpdates();
  } catch (e) {
    console.error(`Failed to check for updates`, e);
  }
}
Example #5
0
	function setFeed() {
		autoUpdater.setFeedURL({
			provider: 'github',
			repo: 'media-app',
			owner: 'SanderRonde'
		} as GithubOptions);
	}
Example #6
0
export function initAutoUpdater() {
  if (process.env.NTERACT_DESKTOP_DISABLE_AUTO_UPDATE !== "1") {
    const log = require("electron-log");
    log.transports.file.level = "info";
    autoUpdater.logger = log;
    autoUpdater.checkForUpdatesAndNotify();
  }
}
Example #7
0
export const runAutoUpdaterService = (window: BrowserWindow) => {
  autoUpdater.on('update-downloaded', ({ version }) => {
    window.webContents.send(UPDATE_AVAILABLE, version);
  });

  ipcMain.on(UPDATE_RESTART_AND_INSTALL, () => {
    autoUpdater.quitAndInstall();
  });

  ipcMain.on(UPDATE_CHECK, () => {
    if (process.env.ENV !== 'dev') {
      autoUpdater.checkForUpdates();
    }
  });
};
Example #8
0
				`Version ${updateInfo.version} is can be downloaded, click to start download`, () => {
					autoUpdater.downloadUpdate();
					setProgress(1);
					autoUpdater.signals.progress((info) => {
						setProgress(info.percent);
					});

					autoUpdater.signals.updateDownloaded((info) => {
						removeProgressBar();

						showNotification('Done downloading update', 
							'Click here to install and relaunch now', () => {
								app.relaunch();
								autoUpdater.quitAndInstall();
							});
					});
				});
Example #9
0
app.on('ready', () => {
  // TODO: Run this periodically, e.g. every 4-6 hours.
  autoUpdater.checkForUpdates();

  if (debugMode) {
    Menu.setApplicationMenu(Menu.buildFromTemplate([{
      label: 'Developer',
      submenu: [{role: 'reload'}, {role: 'forcereload'}, {role: 'toggledevtools'}]
    }]));
  }

  // Set the app to launch at startup to reset the system proxy configuration
  // in case of a showdown while proxying.
  app.setLoginItemSettings({openAtLogin: true, args: [Options.AUTOSTART]});

  if (process.argv.includes(Options.AUTOSTART)) {
    app.quit();  // Quitting the app will reset the system proxy configuration before exiting.
  } else {
    createWindow();
  }
});
 private constructor() {
     autoUpdater.on('checking-for-update', () => {
         console.log('Checking for update...');
     })
     autoUpdater.on('update-available', (info) => {
         console.log('Update available.');
     })
     autoUpdater.on('update-not-available', (info) => {
         console.log('Update not available.');
     })
     autoUpdater.on('error', (err) => {
         console.log('Error in auto-updater. ' + err);
     })
     autoUpdater.on('download-progress', (progressObj) => {
         let log_message = "Download speed: " + progressObj.bytesPerSecond;
         log_message = log_message + ' - Downloaded ' + progressObj.percent + '%';
         log_message = log_message + ' (' + progressObj.transferred + "/" + progressObj.total + ')';
         console.log(log_message);
     })
     autoUpdater.on('update-downloaded', (info) => {
         console.log('Update downloaded');
     });
 }