Auto-updates to Electron Auto-updates to Electron windows windows

Auto-updates to Electron


I am also new to Electron but I think there is no simple auto-update from electron-boilerplate (which I also use). Electron's auto-updater uses Squirrel.Windows installer which you also need to implement into your solution in order to use it.

I am currently trying to use this:

And more info can be found here:

EDIT: I just opened the project to try it for a while and it looks it works. Its pretty straightforward. These are pieces from my gulpfile.

In current configuration, I use electron-packager to create a package.

var packager = require('electron-packager')var createPackage = function () {    var deferred = Q.defer();    packager({        //OPTIONS    }, function done(err, appPath) {        if (err) {            gulpUtil.log(err);        }        deferred.resolve();    });    return deferred.promise;};

Then I create an installer with electron-installer-squirrel-windows.

var squirrelBuilder = require('electron-installer-squirrel-windows');var createInstaller = function () {    var deferred = Q.defer();squirrelBuilder({// OPTIONS}, function (err) {        if (err)            gulpUtil.log(err);        deferred.resolve();    });    return deferred.promise;}

Also you need to add some code for the Squirrel to your electron background/main code. I used a template electron-squirrel-startup.

if(require('electron-squirrel-startup')) return;

The whole thing is described on the electron-installer-squirrel-windows npm documentation mentioned above. Looks like the bit of documentation is enough to make it start. Now I am working on with electron branding through Squirrel and with creating appropriate gulp scripts for automation.


You could also use standard Electron's autoUpdater module on OS X and my simple port of it for Windows: https://www.npmjs.com/package/electron-windows-updater


I followed this tutorial and got it working with my electron app although it needs to be signed to work so you would need:

 certificateFile: './path/to/cert.pfx'

In the task config.

and:

"build": {  "win": {    "certificateFile": "./path/to/cert.pfx",    "certificatePassword": "password"  }},

In the package.json