Reputation: 65
I am implementing auto update
feature for my Electron
app. I am encountering an error:
[Error: Update check failed. The server sent an invalid response. Try again later.] {
code: 6,
domain: 'SQRLUpdaterErrorDomain'
}
This error is thrown from inside Electron
node module, specifically from Squirrel.framework
:
Binary file ./dist/Electron.app/Contents/Frameworks/Squirrel.framework/Versions/A/Squirrel
Part of my electron
main.js
code:
const { app, autoUpdater } = require('electron');
let version = app.getVersion();
let server = 'https://colube-deploy-pnjad1iun-wenwu.vercel.app';
//let url = `${server}/update/${process.platform}/${app.getVersion()}`;
let platform = process.platform + '_arm64';
let url = `${server}/update/${platform}/${version}`;
autoUpdater.setFeedURL({ url });
setInterval(() => {
autoUpdater.checkForUpdates();
}, 15 * 60 * 1000);
setTimeout(() => {
autoUpdater.checkForUpdates();
}, 3000);
autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
releaseName, releaseNotes);
const dialogOpts = {
type : 'info',
buttons : ['Restart', 'Later'],
title : 'Application Update',
message : process.platform === 'win32' ? releaseNotes : releaseName,
detail : 'A new version has been downloaded. Restart the application to apply the updates.',
}
dialog.showMessageBox(dialogOpts).then((returnValue) => {
if (returnValue.response === 0) autoUpdater.quitAndInstall();
})
});
autoUpdater.on('before-quit-for-update', () => {
});
autoUpdater.on('error', (message) => {
console.error('There was a problem updating the application.');
console.error(message);
});
Some background information:
M2-chip MacOS Monterey 12.4
. Electron
version is ^19.0.8
autoUpdater
from electron
modulegithub
repo.TOKEN
(my github personal token).url
argument passed to setFeedURL()
is https://colube-deploy-pnjad1iun-wenwu.vercel.app/update/darwin_arm64/0.9.13
autoUpdater.checkForUpdates()
is status code 200
with object
like:{
name: 'v0.9.17',
notes: '',
pub_date: '2022-07-31T13:47:34Z',
url: 'colube-deploy-pnjad1iun-wenwu.vercel.app/download/darwin_arm64?update=true'
}
colube-deploy-pnjad1iun-wenwu.vercel.app/download/darwin_arm64?update=true
to browser can successfully download the app.Upvotes: 1
Views: 2042