Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 3.2 KB

update-windows.md

File metadata and controls

39 lines (29 loc) · 3.2 KB

Auto-updater on Windows

Electron Release Server provides a backend for the Squirrel.Windows auto-updater.

Refer to the Squirrel.Windows documentation on how to setup your application.

Electron Release Server will serve NuGet packages on the following endpoints:

http://download.myapp.com/update/win32/:version/RELEASES
http://download.myapp.com/update/win64/:version/RELEASES
http://download.myapp.com/update/win32/:version/:channel/RELEASES
http://download.myapp.com/update/win64/:version/:channel/RELEASES
http://download.myapp.com/update/flavor/:flavor/win32/:version/RELEASES
http://download.myapp.com/update/flavor/:flavor/win64/:version/RELEASES
http://download.myapp.com/update/flavor/:flavor/win32/:version/:channel/RELEASES
http://download.myapp.com/update/flavor/:flavor/win64/:version/:channel/RELEASES

If the channel is not specified, then stable will be used. If the flavor is not specified, then default will be used. If win64 is used but only a win32 asset is available, it will be used.

Note: If desired, you can use windows_32 instead of win32 and windows_64 instead of win64.

You'll just need to configure your Update.exe or Squirrel.Windows to use http://download.myapp.com/update/win32/:version/:channel as a feed URL without query parameters.

You'll just need to upload as release assets: -full.nupkg (files generated by electron-builder or Squirrel.Windows releaser).

The RELEASES file will be generated for you :)

NSIS differential updates

Electron Release Server can also be used to serve NSIS differential updates for electron-builder.

You should define the following endpoint as url: https://my.update.server/update/${os}${arch}/. Electron Release Server will auto-generate the .yml files for the corresponding channel (latest.yml, beta.yml, alpha.yml). Electron-builder will fetch the .yml for the correct channel, check if there is a newer version and fetch the .blockmap file of the new release. Based on the .blockmap file, it will download parts of the .exe file. The file name of the .blockmap should be the same as the .exe file but with the extra .blockmap extension. useMultipleRangeRequest is not supported by Electron Release Server, so it should be disabled.

To get differential updates for Windows NSIS:

  1. Point electron-builder to https://my.update.server/update/${os}${arch}/
  2. Set "useMultipleRangeRequest": false
  3. Upload the .exe and .blockmap files for the Windows (32-bit or 64-bit) build (and keep the .blockmap files available for all releases. Do not delete it!)
  4. Electron-builder will fetch the .yml files (https://my.update.server/update/win/latest.yml or https://my.update.server/update/win/beta.yml or https://my.update.server/update/win/alpha.yml) and download the updates based on the .blockmap.

Keep in mind that the counter for the .exe file will be incorrect because there will be multiple requests to the .exe file. However, the .blockmap counter should be accurate because this one is downloaded onces per update.