Electron Release Server

repository·master·Indexed 25 days ago

https://github.com/areksredzki/electron-release-server

A Node.js web server for hosting and serving Electron desktop app releases. It is fully compatible with the Squirrel auto-updater and supports multiple app flavors, pre-release channels (alpha, beta), and asset storage on local disk or Amazon S3. Key features include an AngularJS release management interface, support for NSIS differential updates on Windows, Docker deployment, and a Metadata API for retrieving release information.

Tokens
8.2K
Snippets
25
Records
54
Agent score
80%

What's inside electron-release-server

  1. Overview of Electron Release Server

    master

    Electron Release Server is a Node.js web server designed to manage and serve releases for Electron applications. It is fully compatible with the Squirrel auto-updater (built into Electron) and can be used for any application that utilizes Squirrel.

    Key capabilities include:

    • A release management interface powered by AngularJS.
    • Support for multiple app flavors and pre-release channels (e.g., beta, alpha).
    • Asset storage on local disk or Amazon S3.
    • Support for NSIS differential updates on Windows.
    • Support for Docker deployment.
  2. Understand the Sails Grunt task automation

    master

    Sails uses a suite of Grunt tasks located in the tasks directory to manage front-end assets (stylesheets, scripts, and markup templates) and other development tasks like database migrations.

    Sails automatically triggers specific Grunt tasks based on the command you run:

    • sails lift: Runs the default task (tasks/register/default.js).
    • sails lift --prod: Runs the prod task (tasks/register/prod.js).
    • sails www: Runs the build task (tasks/register/build.js).
    • sails www --prod: Runs the buildProd task (tasks/register/buildProd.js).
  3. Understand Update endpoint behavior and 204 responses

    master

    Update endpoints (detailed in OS-specific guides) return a 204 response when no update is available. This occurs in the following scenarios:

    1. The version requested is newer than or equal to the latest version available on the server.
    2. The required file type for the Squirrel updater is missing (e.g., .zip for Squirrel.Mac or .nupkg for Squirrel.Windows).
  4. Configure NSIS differential updates for electron-builder

    master

    You can use Electron Release Server to serve NSIS differential updates for electron-builder. The server automatically generates .yml files (e.g., latest.yml, beta.yml, alpha.yml) for the corresponding channels.

    Setup Steps

    1. Set Update URL: Point electron-builder to https://my.update.server/update/${os}${arch}/.
    2. Disable Multiple Range Requests: You must set "useMultipleRangeRequest": false in your electron-builder configuration, as this feature is not supported.
    3. Upload Assets: Upload the .exe and the .blockmap files for your Windows (32-bit or 64-bit) builds.
      • Important: Do not delete .blockmap files; they must remain available for all releases to allow differential updates.
      • The .blockmap file name must match the .exe file name with a .blockmap extension.

    How it works

    electron-builder fetches the appropriate .yml file, checks for a newer version, and then uses the .blockmap file to download only the necessary parts of the new .exe file.

    Note: The download counter for the .exe file may appear incorrect due to multiple partial requests, but the .blockmap counter will remain accurate as it is downloaded only once per update.

    {
      "useMultipleRangeRequest": false
    }
  5. Configure Squirrel.Windows auto-updater

    master

    Electron Release Server acts as a backend for Squirrel.Windows. To use it, configure your Update.exe or Squirrel.Windows instance to use the following feed URL format (without query parameters):

    http://download.myapp.com/update/win32/:version/:channel

    URL Patterns and Defaults

    The server serves NuGet packages via several endpoint patterns. If parameters are omitted, the following defaults apply:

    • Channel: If not specified, stable is used.
    • Flavor: If not specified, default is used.
    • Architecture: If win64 is requested but only win32 assets exist, the win32 assets will be served.

    Available Endpoint Patterns:

    • 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

    Note: You can use windows_32 instead of win32 and windows_64 instead of win64 if desired.

    Required Assets

    You must upload the -full.nupkg files (generated by electron-builder or Squirrel.Windows releaser) as release assets. The server will automatically generate the RELEASES file for you.

    http://download.myapp.com/update/win32/:version/:channel
  6. Configure release file uploads by platform

    master

    Electron Release Server uses explicit file compatibility naming. While there is no strict policy, you should upload files corresponding to the target platform:

    • Windows: .exe, .nupkg, etc.
    • Linux: .deb, .tar.gz, etc.
    • OS X: .dmg, etc.

    Note: 32-bit releases are served to all clients, but 64-bit files are only served to compatible clients if they are available.