You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have setup my electron release server and it works for Windows. However, on Mac, I am seeing the below error with autoUpdater.checkForUpdates() in main.js.
"electron": "^21.2.0"
System configuration: Mac M1 Pro and macOS Ventura 13.1
Node version: 18.13.0
Error:
[2023-04-24 09:49:41.837] [info] Checking for update: https://<serverurl>/update/darwin_arm64/1.0.0/stable
[2023-04-24 09:49:41.839] [info] Error: Error: The command is disabled and cannot be executed
at Timeout._onTimeout (/Applications/xyz.app/Contents/Resources/app/main.js:163:17)
at listOnTimeout (node:internal/timers:559:17)
at process.processTimers (node:internal/timers:502:7)
Here's my main.js code:-
const { app, BrowserWindow, ipcMain, dialog, screen, Tray ,session, autoUpdater } = require('electron')
const os = require('node:os');
const log = require('electron-log');
log.info('Log from the main process');
autoUpdater.logger = log
autoUpdater.logger.transports.file.level = 'debug'
if (require('electron-squirrel-startup')) app.quit()
const macUrl = `${server}/update/${os_platform)_${os.arch()}/${app.getVersion()}/stable`
autoUpdater.setFeedURL({
provider: 'squirrel',
url: macUrl,
});
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
setInterval(() => {
log.info('Checking for update: ' + macUrl);
autoUpdater.checkForUpdates()
}, 30000)
})
autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
log.info('Update downloaded');
const dialogOpts = {
type: 'info',
buttons: ['Restart', 'Later'],
title: 'Application Update',
detail:
'A new version has been downloaded. Restart the application to apply the updates.',
}
dialog.showMessageBox(dialogOpts).then((returnValue) => {
if (returnValue.response === 0) {
setTimeout(() => {
autoUpdater.quitAndInstall();
}, 500);
}
})
})
The text was updated successfully, but these errors were encountered:
I have setup my electron release server and it works for Windows. However, on Mac, I am seeing the below error with autoUpdater.checkForUpdates() in main.js.
"electron": "^21.2.0"
System configuration: Mac M1 Pro and macOS Ventura 13.1
Node version: 18.13.0
Here's my main.js code:-
The text was updated successfully, but these errors were encountered: