Electron.net: How to use Auto updater ?

Created on 2 Nov 2019  路  12Comments  路  Source: ElectronNET/Electron.NET

I understand that this is not the place to ask questions, but i cannot understand how to configure Electron.NET to properly use the auto updater feature.
How to setup the remote repo where the update will be?
If you cannot answer here, please point to the right direction.. :)
Thanks!

question

Most helpful comment

OK, i figured it out so i though posting my answer in case someone else is interested..
So I wanted to see how to configure the updater for updating through a simple http server.
In electron.manifest.json i added this configuration inside build params:

"build": {
...,
"publish": {
"provider": "generic",
"url": "http://localhost:82",
"channel": "latest"
}
}

and i set up a local http server in iis on port 82 to serve files (need to include .yml in the mime types).
Inside the server path i put the files:

  • application.exe
  • application.exe.blockmap
  • latest.yml

Then when using eg. Electron.AutoUpdater.CheckForUpdatesAsync() it finds the files and tries to update.

All 12 comments

OK, i figured it out so i though posting my answer in case someone else is interested..
So I wanted to see how to configure the updater for updating through a simple http server.
In electron.manifest.json i added this configuration inside build params:

"build": {
...,
"publish": {
"provider": "generic",
"url": "http://localhost:82",
"channel": "latest"
}
}

and i set up a local http server in iis on port 82 to serve files (need to include .yml in the mime types).
Inside the server path i put the files:

  • application.exe
  • application.exe.blockmap
  • latest.yml

Then when using eg. Electron.AutoUpdater.CheckForUpdatesAsync() it finds the files and tries to update.

OK, i figured it out so i though posting my answer in case someone else is interested..
So I wanted to see how to configure the updater for updating through a simple http server.
In electron.manifest.json i added this configuration inside build params:

"build": {
...,
"publish": {
"provider": "generic",
"url": "http://localhost:82",
"channel": "latest"
}
}

and i set up a local http server in iis on port 82 to serve files (need to include .yml in the mime types).
Inside the server path i put the files:

  • application.exe
  • application.exe.blockmap
  • latest.yml

Then when using eg. Electron.AutoUpdater.CheckForUpdatesAsync() it finds the files and tries to update.

Hello

I tried this inside my build params of the electron.manifest.json file. It keeps looking at a local file in the obj\Host called dev_app_update.yml. It is not looking on the remote server I specified. I opened up Fiddler to see if it was making any http requests to the server. I am running the latest version of Electron.NET.

Regards,
Simon

Hi Simon,

Yes i forgor to mention that it does not work when running for debugging(electronize start..). You need to build for release (electronize build...)
Then under bin/Desktop will be the files you need to put in the http server and to see the updater working you either install the app and run it (i run it through cmd to see the logs) or run the exe under bin\Desktop\win-ia32-unpacked (this should work too i am not sure).
Under the folder bin\Desktop\win-ia32-unpacked\resources you should now see a app-update.yml file that should contain the info you have specified.

Do you prompt the user to download it if an update is found or do you automatically download it? Does that method prompt the user

If you use it without any other AutoUpdater configuration it will download the update too and install it

I see it is the base Electron.NET update information and not my application. Seems like this feature has not been implemented 100% yet...

where do you see that? i got it working the way i said above..

I rebuilt it once again and now I see my info. Thanks. Let me see where this goes ;)

Ok I see it is processing now. I added the YML file to the mime types. Do you then prompt the user to download or force it on them.

For that, it depends on what you want to do. I show a message that there is an update available and will be installed once the app quits and use QuitAndInstall method. You can see the available methods if you go inside AutoUpdater Class:
https://github.com/ElectronNET/Electron.NET/blob/master/ElectronNET.API/AutoUpdater.cs

OK, i figured it out so i though posting my answer in case someone else is interested..
So I wanted to see how to configure the updater for updating through a simple http server.
In electron.manifest.json i added this configuration inside build params:

"build": {
...,
"publish": {
"provider": "generic",
"url": "http://localhost:82",
"channel": "latest"
}
}

and i set up a local http server in iis on port 82 to serve files (need to include .yml in the mime types).
Inside the server path i put the files:

* application.exe

* application.exe.blockmap

* latest.yml

Then when using eg. Electron.AutoUpdater.CheckForUpdatesAsync() it finds the files and tries to update.

Kudo for that! And it works with an Azure blob storage.

Please have a look at electron-builder. You can find the configuration for this under the new electron.manifest.json file at "build".

https://www.electron.build/auto-update

We have an sample in our API Demo App too:
https://github.com/ElectronNET/electron.net-api-demos

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ernestotw85 picture ernestotw85  路  3Comments

iqmeta picture iqmeta  路  3Comments

litch0 picture litch0  路  4Comments

graylobo picture graylobo  路  5Comments

thnk2wn picture thnk2wn  路  4Comments