kiwix-js-pwa icon indicating copy to clipboard operation
kiwix-js-pwa copied to clipboard

Provide different update channels for packaged apps with electron-builder

Open Jaifroid opened this issue 2 years ago • 1 comments

I am having trouble keeping the updates separate amongst the three apps: Kiwix JS Electron, WikiMed by Kiwix, Wikivoyage by Kiwix. Because they are released on the same repository (this one), the electron-updater appears to confuse the releases, and it is looking for the latest.yml without differentiating the app ID (which is different for each app).

Documentation is very obscure, but this issue seems to suggest a way to change "latest" to a different channel: https://github.com/electron-userland/electron-builder/issues/6466 .

Jaifroid avatar Mar 15 '22 10:03 Jaifroid

Recent versions of Electron Builder now seem to respect channels, i.e. they check if the version number has an extension with a hyphen, like -E in v2.0.8-E or -WikiMed in v2.0.4-WikiMed.

However, I have decided not to provide auto-updates for WikiMed or Wikivoyage, because the downloads are too big to be done silently in the background, and would take too long to download and install for many users, leading to failed updates and potential update loops. Instead, v2.0.8 now provides a simple update check, which optionally checks the GitHub REST API for any updates and informs the user if there are any. This works with "channels".

There is now an issue with the vanilla app Electron auto-updates. Because the channel is now being respected, the Electron app cannot find the generic update tag (v2.0.8), because it is looking only for the Electron channel (v2.0.8-E). For now I provide the workaround of releasing the updated Electron files in their own tagged release alongside the main release.

For a more sustainable solution, I need to look into the possibility of forcing Electron Builder to download a specific package.

Jaifroid avatar Jun 12 '22 08:06 Jaifroid

Unless I rewrite the updater myself rather than using Electron's version, it doesn't seem this is possible... Closing.

Jaifroid avatar Nov 20 '22 15:11 Jaifroid