Add enableAutoUpdater to buildConfig
This commit is contained in:
@@ -24,6 +24,7 @@ const buildConfig = {
|
|||||||
],
|
],
|
||||||
helpLink: 'https://about.mattermost.com/default-desktop-app-documentation/',
|
helpLink: 'https://about.mattermost.com/default-desktop-app-documentation/',
|
||||||
enableServerManagement: true,
|
enableServerManagement: true,
|
||||||
|
enableAutoUpdater: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default buildConfig;
|
export default buildConfig;
|
||||||
|
@@ -26,6 +26,7 @@ import {protocols} from '../electron-builder.json';
|
|||||||
|
|
||||||
import CriticalErrorHandler from './main/CriticalErrorHandler';
|
import CriticalErrorHandler from './main/CriticalErrorHandler';
|
||||||
import {upgradeAutoLaunch} from './main/autoLaunch';
|
import {upgradeAutoLaunch} from './main/autoLaunch';
|
||||||
|
import buildConfig from './common/config/buildConfig';
|
||||||
|
|
||||||
const criticalErrorHandler = new CriticalErrorHandler();
|
const criticalErrorHandler = new CriticalErrorHandler();
|
||||||
|
|
||||||
@@ -636,6 +637,7 @@ app.on('ready', () => {
|
|||||||
permissionManager = new PermissionManager(permissionFile, trustedURLs);
|
permissionManager = new PermissionManager(permissionFile, trustedURLs);
|
||||||
session.defaultSession.setPermissionRequestHandler(permissionRequestHandler(mainWindow, permissionManager));
|
session.defaultSession.setPermissionRequestHandler(permissionRequestHandler(mainWindow, permissionManager));
|
||||||
|
|
||||||
|
if (buildConfig.enableAutoUpdater) {
|
||||||
const updaterConfig = autoUpdater.loadConfig(path.resolve(app.getAppPath(), '../app-updater-config.json'));
|
const updaterConfig = autoUpdater.loadConfig(path.resolve(app.getAppPath(), '../app-updater-config.json'));
|
||||||
autoUpdater.initialize(appState, mainWindow, updaterConfig.isNotifyOnly());
|
autoUpdater.initialize(appState, mainWindow, updaterConfig.isNotifyOnly());
|
||||||
ipcMain.on('check-for-updates', autoUpdater.checkForUpdates);
|
ipcMain.on('check-for-updates', autoUpdater.checkForUpdates);
|
||||||
@@ -648,6 +650,7 @@ app.on('ready', () => {
|
|||||||
}, autoUpdater.INTERVAL_48_HOURS_IN_MS);
|
}, autoUpdater.INTERVAL_48_HOURS_IN_MS);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Open the DevTools.
|
// Open the DevTools.
|
||||||
// mainWindow.openDevTools();
|
// mainWindow.openDevTools();
|
||||||
|
@@ -230,12 +230,15 @@ function createTemplate(mainWindow, config, isDev) {
|
|||||||
submenu.push({
|
submenu.push({
|
||||||
label: `Version ${app.getVersion()}`,
|
label: `Version ${app.getVersion()}`,
|
||||||
enabled: false,
|
enabled: false,
|
||||||
}, {
|
});
|
||||||
|
if (buildConfig.enableAutoUpdater) {
|
||||||
|
submenu.push({
|
||||||
label: 'Check for Updates...',
|
label: 'Check for Updates...',
|
||||||
click() {
|
click() {
|
||||||
ipcMain.emit('check-for-updates', true);
|
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