Skip to content

Commit 8366a1d

Browse files
Merge pull request #62 from oracle/disable-auto-updates
disabling auto updates on Linux is not running from the AppImage
2 parents df56eaa + 00b5ab6 commit 8366a1d

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

electron/app/js/appUpdater.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ const i18n = require('./i18next.config');
1111
const { getLogger } = require('./wktLogging');
1212
const errorUtils = require('./errorUtils');
1313
const { sendToWindow } = require('./windowUtils');
14+
const osUtils = require('./osUtils');
1415

1516
let _isDevMode;
17+
let _supportsAutoUpdate;
1618
let _downloadWindow;
1719
let _installType;
1820

21+
/* global process */
1922
function initializeAutoUpdater(logger, isDevMode) {
2023
_isDevMode = isDevMode;
24+
_supportsAutoUpdate = !(osUtils.isLinux() && !process.env.APPIMAGE);
2125
autoUpdater.logger = logger;
2226
autoUpdater.autoDownload = false;
2327
autoUpdater.autoInstallOnAppQuit = true;
@@ -44,7 +48,7 @@ function registerAutoUpdateListeners() {
4448
// if the application is current with the latest version, or an error occurs, the Promise resolves to null.
4549
// if notifyOnFailures is true, dialogs are displayed when no result is provided.
4650
async function getUpdateInformation(notifyOnFailures) {
47-
if (!_isDevMode) {
51+
if (!_isDevMode && _supportsAutoUpdate) {
4852
try {
4953
const checkResult = await autoUpdater.checkForUpdates();
5054
const releaseName = checkResult.updateInfo.releaseName;
@@ -79,8 +83,13 @@ async function getUpdateInformation(notifyOnFailures) {
7983
// Only show the prompt if the user used the menu to trigger checkForUpdates()
8084
// If triggered on startup, no need to display...
8185
//
82-
dialog.showErrorBox(i18n.t('auto-updater-disabled-dev-mode-title'),
83-
i18n.t('auto-updater-disabled-dev-mode-message'));
86+
if (_isDevMode) {
87+
dialog.showErrorBox(i18n.t('auto-updater-disabled-dev-mode-title'),
88+
i18n.t('auto-updater-disabled-dev-mode-message'));
89+
} else {
90+
dialog.showErrorBox(i18n.t('auto-updater-disabled-unsupported-title'),
91+
i18n.t('auto-updater-disabled-unsupported-message'));
92+
}
8493
}
8594

8695
return null;

electron/app/locales/en/electron.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@
104104
"auto-updater-install-question": "Update the application now or on exit?",
105105
"auto-updater-disabled-dev-mode-title": "Auto-Updater Disabled",
106106
"auto-updater-disabled-dev-mode-message": "Auto-Updater is disabled when running in development mode.",
107+
"auto-updater-disabled-unsupported-title": "Auto-Updater Not Supported",
108+
"auto-updater-disabled-unsupported-message": "Auto-Updater is not supported on Linux when not running from the AppImage executable.",
107109

108110
"dialog-chooseArchiveFile": "Select an Archive File",
109111
"dialog-chooseModelFile": "Select a Model File",

0 commit comments

Comments
 (0)