Skip to Content
upserve

Electron

Serve electron-updater generic feeds, original YAML and differential download assets.

This adapter supports electron-builder applications using electron-updater's generic provider. Electron's native autoUpdater uses protocols such as Squirrel and isn't interchangeable with electron-updater. Squirrel and Sparkle aren't supported by this adapter.

Keep your electron-builder artifacts

For each published release in owner/editor, upload electron-builder's original YAML and the files it references. Depending on your targets, those include:

PlatformFeed filenameTypical artifacts
Windowslatest.ymlNSIS installer and .blockmap
macOSlatest-mac.ymlZIP, DMG and generated blockmaps
Linuxlatest-linux.yml or latest-linux-ARCH.ymlTarget artifacts and generated metadata

Use a tag such as v1.2.0. The YAML version must equal 1.2.0. Each entry in files needs a SHA-512 base64 checksum and a positive file size matching the GitHub asset. File URLs must be relative basenames in the same release.

Upserve returns the YAML unchanged. It doesn't regenerate checksums, re-sign metadata or create differential patches. Preserve your existing platform signing and electron-updater verification.

Install and configure the server

npm install @neplex/upserve @neplex/upserve-github @neplex/upserve-electron @hono/node-server
server.ts
import { serve } from "@hono/node-server";
import { createUpserve } from "@neplex/upserve";
import { github } from "@neplex/upserve-github";
import { electron } from "@neplex/upserve-electron";

const updates = createUpserve({
  apps: {
    editor: {
      provider: github({ repository: "owner/editor" }),
      adapters: [electron()],
    },
  },
});

serve({ fetch: updates.fetch, port: 3000 });

Replace owner/editor with your repository.

Configure electron-updater

Install electron-updater in your Electron application if it isn't already installed. In electron-builder's configuration, set a generic feed:

electron-builder.yml (publish section)
publish:
  provider: generic
  url: https://updates.example.com/editor/stable/electron/
  useMultipleRangeRequest: false

Replace the example host. Keep the trailing slash. Continue calling autoUpdater.checkForUpdatesAndNotify() from electron-updater in your main process. This is a focused client snippet for an already configured Electron application:

import { autoUpdater } from "electron-updater";

autoUpdater.checkForUpdatesAndNotify();

If you configure the feed at runtime instead, pass the same provider, url and useMultipleRangeRequest to autoUpdater.setFeedURL().

Start and test the feed

npx tsx server.ts
curl -i http://localhost:3000/editor/stable/electron/latest.yml

Use latest-mac.yml or your Linux filename to test those targets. Expect 200 and the original YAML. Test the packaged app too; successful YAML retrieval alone doesn't prove signing, installation or differential download behavior on each operating system.

Differential downloads

Electron-updater can download only the parts of an installer that changed when you publish its existing blockmap data. Upserve makes the installer and blockmaps available and forwards the client's download requests. It doesn't generate those files.

GitHub delivery supports single byte ranges. Set useMultipleRangeRequest: false so the client doesn't request multipart ranges. Keep the old release's blockmaps in the repository because a client upgrading from that release may request them. A reverse proxy must forward Range and preserve 206 Partial Content responses. See asset delivery.

Prerelease feeds

For a beta YAML prefix on the default prerelease channel, configure electron({ channels: { prerelease: "beta" } }) and point your prerelease clients at /editor/prerelease/electron/. The channels option maps URL channel names to YAML filename prefixes; it doesn't select releases. Release channels controls selection.

Supported configurations and limits

NSIS installers, macOS ZIP/DMG feeds and Linux feeds with relative asset filenames are the intended configurations. Architecture-specific Linux YAML suffixes are accepted; every artifact referenced by a feed still needs to be in that release.

Web installers using a YAML packages field, absolute external file URLs and alternate signed feed envelopes aren't supported. A missing feed returns 404; malformed YAML, missing artifacts or mismatched checksums/sizes return 422 without a usable cached manifest. Upserve validates checksum format, not the binary's digest. Electron-updater must verify the actual download.

For client details, see the electron-builder auto-update guide and generic provider implementation.

On this page