@@ -11,13 +11,17 @@ const i18n = require('./i18next.config');
1111const { getLogger } = require ( './wktLogging' ) ;
1212const errorUtils = require ( './errorUtils' ) ;
1313const { sendToWindow } = require ( './windowUtils' ) ;
14+ const osUtils = require ( './osUtils' ) ;
1415
1516let _isDevMode ;
17+ let _supportsAutoUpdate ;
1618let _downloadWindow ;
1719let _installType ;
1820
21+ /* global process */
1922function 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.
4650async 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 ;
0 commit comments