[MM-18551] Remove (auto)updater from v4.3 (#1035)
* remove (auto)updater from v4.3
This commit is contained in:
42
src/main.js
42
src/main.js
@@ -16,7 +16,7 @@ import {protocols} from '../electron-builder.json';
|
|||||||
import AutoLauncher from './main/AutoLauncher';
|
import AutoLauncher from './main/AutoLauncher';
|
||||||
import CriticalErrorHandler from './main/CriticalErrorHandler';
|
import CriticalErrorHandler from './main/CriticalErrorHandler';
|
||||||
import upgradeAutoLaunch from './main/autoLaunch';
|
import upgradeAutoLaunch from './main/autoLaunch';
|
||||||
import autoUpdater from './main/autoUpdater';
|
|
||||||
import RegistryConfig from './common/config/RegistryConfig';
|
import RegistryConfig from './common/config/RegistryConfig';
|
||||||
import Config from './common/config';
|
import Config from './common/config';
|
||||||
import CertificateStore from './main/certificateStore';
|
import CertificateStore from './main/certificateStore';
|
||||||
@@ -193,19 +193,12 @@ function initializeInterCommunicationEventListeners() {
|
|||||||
if (shouldShowTrayIcon()) {
|
if (shouldShowTrayIcon()) {
|
||||||
ipcMain.on('update-unread', handleUpdateUnreadEvent);
|
ipcMain.on('update-unread', handleUpdateUnreadEvent);
|
||||||
}
|
}
|
||||||
if (!isDev && config.enableAutoUpdater) {
|
|
||||||
ipcMain.on('check-for-updates', autoUpdater.checkForUpdates);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeMainWindowListeners() {
|
function initializeMainWindowListeners() {
|
||||||
mainWindow.on('closed', handleMainWindowClosed);
|
mainWindow.on('closed', handleMainWindowClosed);
|
||||||
mainWindow.on('unresponsive', criticalErrorHandler.windowUnresponsiveHandler.bind(criticalErrorHandler));
|
mainWindow.on('unresponsive', criticalErrorHandler.windowUnresponsiveHandler.bind(criticalErrorHandler));
|
||||||
mainWindow.webContents.on('crashed', handleMainWindowWebContentsCrashed);
|
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);
|
const trustedURLs = config.teams.map((team) => team.url);
|
||||||
permissionManager = new PermissionManager(permissionFile, trustedURLs);
|
permissionManager = new PermissionManager(permissionFile, trustedURLs);
|
||||||
session.defaultSession.setPermissionRequestHandler(permissionRequestHandler(mainWindow, permissionManager));
|
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');
|
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
|
// helper functions
|
||||||
//
|
//
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import {app, dialog, ipcMain, Menu, shell} from 'electron';
|
import {app, dialog, Menu, shell} from 'electron';
|
||||||
|
|
||||||
function createTemplate(mainWindow, config, isDev) {
|
function createTemplate(mainWindow, config, isDev) {
|
||||||
const settingsURL = isDev ? 'http://localhost:8080/browser/settings.html' : `file://${app.getAppPath()}/browser/settings.html`;
|
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()}`,
|
label: `Version ${app.getVersion()}`,
|
||||||
enabled: false,
|
enabled: false,
|
||||||
});
|
});
|
||||||
if (config.enableAutoUpdater) {
|
|
||||||
submenu.push({
|
|
||||||
label: 'Check for Updates...',
|
|
||||||
click() {
|
|
||||||
ipcMain.emit('check-for-updates', true);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
template.push({label: '&Help', submenu});
|
template.push({label: '&Help', submenu});
|
||||||
return template;
|
return template;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user