-1
I’m using Electron
+ VueJS
, and would like to know how to implement the auto updater
, I did a little research, but I didn’t get anything, to be honest, I didn’t understand how it works, where it downloads the update, these things.
-1
I’m using Electron
+ VueJS
, and would like to know how to implement the auto updater
, I did a little research, but I didn’t get anything, to be honest, I didn’t understand how it works, where it downloads the update, these things.
0
Implemented in an Angular project, but can help you.
I used the Electron-winstaller, after the procedure, three files are generated:
The RELEASES file automatically controls the summers to be updated. If you update the system and perform the winstaller procedure, a new nupkg will be included and added in the final RELEASES file.
In main.js insert the following code:
const { autoUpdater } = require('electron');
autoUpdater.on('update-availabe', () => { });
autoUpdater.on('checking-for-update', () => { });
autoUpdater.on('update-not-available', () => { });
autoUpdater.on('update-downloaded', () => {
autoUpdater.quitAndInstall();
});
autoUpdater.setFeedURL(__IP_DO_SERVIDOR__);
.
.
app.on('ready', () => {
createBrowserWindow();
try {
autoUpdater.checkForUpdates();
} catch (err) { }
});
The server only needs to contain the *.nupkg and RELEASE files generated in the build. I opened a server using the http-server. The autoUpdate module of Electron when opening the application, makes the requests to check if there is update, download, install and update automatically, for this, the server just be accessible.
Remembering that the application should be installed by the setup created by Electron.
0
I recommend using the electron-builder
for this, it has a documentation of publishing and configuration of the autoUpdater along with the build.
Publishing options:
Auto Update: https://www.electron.build/auto-update
Publishing: https://www.electron.build/configuration/publish
Browser other questions tagged javascript vue.js electron
You are not signed in. Login or sign up in order to post.