[MM-18551] Remove (auto)updater from v4.3 (#1035)

* remove (auto)updater from v4.3
This commit is contained in:
Dean Whillier
2019-09-16 13:08:45 -04:00
committed by GitHub
parent 576bea19bd
commit 99fae82514
2 changed files with 3 additions and 50 deletions

View File

@@ -16,7 +16,7 @@ import {protocols} from '../electron-builder.json';
import AutoLauncher from './main/AutoLauncher';
import CriticalErrorHandler from './main/CriticalErrorHandler';
import upgradeAutoLaunch from './main/autoLaunch';
import autoUpdater from './main/autoUpdater';
import RegistryConfig from './common/config/RegistryConfig';
import Config from './common/config';
import CertificateStore from './main/certificateStore';
@@ -193,19 +193,12 @@ function initializeInterCommunicationEventListeners() {
if (shouldShowTrayIcon()) {
ipcMain.on('update-unread', handleUpdateUnreadEvent);
}
if (!isDev && config.enableAutoUpdater) {
ipcMain.on('check-for-updates', autoUpdater.checkForUpdates);
}
}
function initializeMainWindowListeners() {
mainWindow.on('closed', handleMainWindowClosed);
mainWindow.on('unresponsive', criticalErrorHandler.windowUnresponsiveHandler.bind(criticalErrorHandler));
mainWindow.webContents.on('crashed', handleMainWindowWebContentsCrashed);
mainWindow.on('ready-to-show', handleMainWindowReadyToShow);
if (!isDev && config.enableAutoUpdater) {
mainWindow.once('show', handleMainWindowShow);
}
}
//
@@ -514,21 +507,6 @@ function initializeAfterAppReady() {
const trustedURLs = config.teams.map((team) => team.url);
permissionManager = new PermissionManager(permissionFile, trustedURLs);
session.defaultSession.setPermissionRequestHandler(permissionRequestHandler(mainWindow, permissionManager));
if (!isDev && config.enableAutoUpdater) {
const updaterConfig = autoUpdater.loadConfig();
autoUpdater.initialize(appState, mainWindow, updaterConfig.isNotifyOnly());
ipcMain.on('check-for-updates', autoUpdater.checkForUpdates);
mainWindow.once('show', () => {
if (autoUpdater.shouldCheckForUpdatesOnStart(appState.updateCheckedDate)) {
ipcMain.emit('check-for-updates');
} else {
setTimeout(() => {
ipcMain.emit('check-for-updates');
}, autoUpdater.UPDATER_INTERVAL_IN_MS);
}
});
}
}
//
@@ -692,24 +670,6 @@ function handleMainWindowWebContentsCrashed() {
throw new Error('webContents \'crashed\' event has been emitted');
}
function handleMainWindowReadyToShow() {
if (!isDev) {
autoUpdater.checkForUpdates();
}
}
function handleMainWindowShow() {
if (!isDev) {
if (autoUpdater.shouldCheckForUpdatesOnStart(appState.updateCheckedDate)) {
ipcMain.emit('check-for-updates');
} else {
setTimeout(() => {
ipcMain.emit('check-for-updates');
}, autoUpdater.UPDATER_INTERVAL_IN_MS);
}
}
}
//
// helper functions
//

View File

@@ -3,7 +3,7 @@
// See LICENSE.txt for license information.
'use strict';
import {app, dialog, ipcMain, Menu, shell} from 'electron';
import {app, dialog, Menu, shell} from 'electron';
function createTemplate(mainWindow, config, isDev) {
const settingsURL = isDev ? 'http://localhost:8080/browser/settings.html' : `file://${app.getAppPath()}/browser/settings.html`;
@@ -236,14 +236,7 @@ function createTemplate(mainWindow, config, isDev) {
label: `Version ${app.getVersion()}`,
enabled: false,
});
if (config.enableAutoUpdater) {
submenu.push({
label: 'Check for Updates...',
click() {
ipcMain.emit('check-for-updates', true);
},
});
}
template.push({label: '&Help', submenu});
return template;
}