Create a server for asar autoupdate


#1

Hi guys!
I was looking around the web trying to understand how an AutoUpdater server is done, but i cant figure it out.

I got my electron-asar-autoupdater (i need to pack all as asar) where i found this code:

var desktop_app_version = '1.0.0';
var desktop_app_URL = 'http://.../update.asar'

this.app.post('/update', function (req, res) {
  if(req.body.current != desktop_app_version){
    res.write(JSON.stringify( {"last": desktop_app_version, "source": desktop_app_URL} ).replace(/[\/]/g, '\\/') );
  }else{
    res.write(JSON.stringify( {"last": desktop_app_version} ).replace(/[\/]/g, '\\/') );
  }
  res.end();
});

How do i use it?
Is there a way better to manage my release?

Thank you for your patience :smiley:


#2

You may want to check out the electron-release-server project either as something you could use directly or as inspiration for how to implement your own.


#3

Thank you for your answer,
but i feel a litte dumb :confounded: i’ve downloaded the electron-release-server, but it uses postgresql database, and i can’t install it on my hosting.
i can use just sqlite, mysql or mssql…
do i have to change the config file to make it work? or i can use ONLY postgresql?
i’m so sorry for those stupid questions, but i feel like a newbie.
thanks again! :wink:


#4

To be honest, I’ve never used it myself, so I don’t have the answers to your question :frowning:


#5

Seem that i’ve to build a custom rest webservice to provide update…