A complete example of an auto-updating app demonstrating the delta updates. The app is built using electron-builder and @electron-delta/builder
Delta auto updates are handled by @electron-delta/updater
git clone [email protected]:electron-delta/electron-sample-app.git
cd electron-sample-app
npm install
Let's create the first version of the app.
- Open the
src/main.js
and set the hostURL tohttp://localhost:5000/
- Open .electron-delta.js and use the following
getPreviousReleases
method
const getPreviousReleases = async () => {
return [];
};
- Change the
version
to1.0.0
and create the distribution files.
npm version 1.0.0
npm run dist
- Now serve the dist files over port 5000.
npx serve -s dist -p 5000
- Open .electron-delta.js and use the following
getPreviousReleases
method
const getPreviousReleases = async () => {
return [
{
version: '1.0.0',
url: 'http://localhost:5000/electron-sample-app-1.0.0.exe',
}
];
};
- Change the
version
to1.0.1
and create the distribution files.
npm version 1.0.1
npm run dist
-
Notice that a new folder is created under
/dist/1.0.1-delta-installers
. Move all those files to/dist/
. Make this urlhttp://localhost:5000/delta.json
is working. -
Now install the
electron-sample-app-1.0.0.exe
app. Your app should be auto updated to 1.0.1 using delta updates.