Prevent auto download of upgrade

This commit is contained in:
Yuya Ochiai
2017-12-14 00:37:31 +09:00
parent fbcb08fa6e
commit ca97a819f9

View File

@@ -79,10 +79,7 @@ function downloadAndInstall() {
} }
function initialize(appState, mainWindow, notifyOnly = false) { function initialize(appState, mainWindow, notifyOnly = false) {
autoUpdater.notifyOnly = notifyOnly; autoUpdater.autoDownload = false; // To prevent upgrading on quit
if (notifyOnly) {
autoUpdater.autoDownload = false;
}
const assetsDir = path.resolve(app.getAppPath(), 'assets'); const assetsDir = path.resolve(app.getAppPath(), 'assets');
autoUpdater.on('error', (err) => { autoUpdater.on('error', (err) => {
console.error('Error in autoUpdater:', err.message); console.error('Error in autoUpdater:', err.message);
@@ -90,7 +87,7 @@ function initialize(appState, mainWindow, notifyOnly = false) {
if (isUpdateApplicable(new Date(), appState.skippedVersion, info)) { if (isUpdateApplicable(new Date(), appState.skippedVersion, info)) {
updaterModal = createUpdaterModal(mainWindow, { updaterModal = createUpdaterModal(mainWindow, {
linuxAppIcon: path.join(assetsDir, 'appicon.png'), linuxAppIcon: path.join(assetsDir, 'appicon.png'),
notifyOnly: autoUpdater.notifyOnly notifyOnly
}); });
updaterModal.on('closed', () => { updaterModal.on('closed', () => {
updaterModal = null; updaterModal = null;