feat: Check for desktop update on launch
This commit is contained in:
2 files changed
+6
-3
No files matched your search
@@ -88,10 +88,9 @@ const downloadAndInstallUpdate = async (version) => {
|
||||
* Configure inbuilt app updater to use a custom config file
|
||||
* to download and install next available app version.
|
||||
* TODO: download progress in dialog
|
||||
* TODO: Read current version from app config
|
||||
**/
|
||||
module.exports = {
|
||||
run: async () => {
|
||||
run: async ({ suppressNoUpdatePrompt }) => {
|
||||
let latestVersion;
|
||||
if (debug) {
|
||||
latestVersion = process.env.APP_UPDATER_LATEST_VERSION_TAG;
|
||||
@@ -105,7 +104,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
// Update not available - do nothing
|
||||
if (semver.lte(latestVersion, currentVersion)) {
|
||||
if (!suppressNoUpdatePrompt && semver.lte(latestVersion, currentVersion)) {
|
||||
const dialogOpts = {
|
||||
type: 'info',
|
||||
icon: null,
|
||||
|
||||
@@ -19,6 +19,7 @@ const origin = require('./origin.js');
|
||||
const { generateCSPHeader } = require('./content-security-policy.js');
|
||||
|
||||
const menu = require('./menu.js');
|
||||
const appUpdater = require('./app-updater.js');
|
||||
const isDev = require('electron-is-dev');
|
||||
|
||||
// Register the custom file protocol
|
||||
@@ -138,6 +139,9 @@ app.on('ready', async () => {
|
||||
// Load the ember application
|
||||
mainWindow.loadURL(emberAppURL);
|
||||
|
||||
// Check for updates on launch
|
||||
appUpdater.run({ suppressNoUpdatePrompt: true });
|
||||
|
||||
// If a loading operation goes wrong, we'll send Electron back to
|
||||
// Ember App entry point
|
||||
mainWindow.webContents.on('did-fail-load', () => {
|
||||
|
||||
Reference in new issue
Block a user