How to prevent an Electron app from updating to a version that would fail to run due to Electron's breaking changes?

102 Views Asked by At

Electron (or rather Chromium) frequently drops support for specific versions of operating systems (for example Electron 23 dropped support for Windows 7 and 8, or recently Electron 27 dropped support for macOS High Sierra and Mojave). However, the auto-update mechanism does not check for compatibility before downloading and crucially before installing an update. I'd like to prevent this behaviour and just prevent the update in the first place, ideally with a warning presented to the user.

Is there an idiomatic way to handle this situation?

Is there any way to specify in the different latest.yml files used by electron-updater to require being in some version before installing the latest version? I was unable to find something like this. Like for example:

version: 4.0.0
minVersion: 3.2.5
...

Which would tell any app version prior to 3.2.5 to first install 3.2.5 before being able to install 4.0.0?

The only way I found to deal with this, that somewhat does what I described is the following: Whenever a breaking change is introduced, we release a last version without that breaking change and create a completely new repository for future releases with that breaking change. This last version will then point to the new repository and will have specific code checking if the update can be done.

However, this seems to be extremely hacky and only covers the cases where we're fully aware that something breaks on some platform ahead of time.

0

There are 0 best solutions below