electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.64k stars 1.74k forks source link

How do I add `minimumSystemVersion` to my app? #8569

Open ashwin-mittal opened 1 week ago

ashwin-mittal commented 1 week ago

I see that the updateInfo object in electron-updater contains a minimumSystemVersion entry, but I can't find any information on how to populate this. It was added in this feature: https://github.com/electron-userland/electron-builder/pull/8108.

I have already tried adding minimumSystemVersion to the releaseInfo object inside the build object, but I get an error saying the format is invalid because minimumSystemVersion is not allowed in that object.

I am doing manual releases to a Google Cloud bucket on both Windows and Mac. This is a great feature, but it's not useful unless I can add it to my app.

mmaietta commented 1 week ago

You add the value directly in the mac/mas/win/etc configuration blocks Example doc: https://www.electron.build/app-builder-lib.interface.macconfiguration#minimumsystemversion

ashwin-mittal commented 1 week ago

@mmaietta I am asking about electron-updater configuration here: https://www.electron.build/auto-update#minimumsystemversion.

mmaietta commented 1 week ago

@beyondkmp can you chime in here? How does one set the minimumSystemVersion for the latest.yml?

beyondkmp commented 1 week ago

example: latest-mac.yml

version: 1.1.0
path: TestApp 1.1.0.zip
sha512: Dj51I0q8aPQ3ioaz9LMqGYujAYRbDNblAQbodDRXAMxmY6hsHqEl3F6SvhfJj5oPhcqdX1ldsgEvfMNXGUXBIw==
stagingPercentage: 10
minimumSystemVersion: 23.1.0

latest-window.yml

version: 1.1.0
path: TestApp Setup 1.1.0.exe
sha512: Dj51I0q8aPQ3ioaz9LMqGYujAYRbDNblAQbodDRXAMxmY6hsHqEl3F6SvhfJj5oPhcqdX1ldsgEvfMNXGUXBIw==
stagingPercentage: 10
minimumSystemVersion: 10.0.22631

After downloading the latest.yml file, electron-updater first compares the current system version with the minimumSystemVersion. If the current version is greater than or equal to the minimumSystemVersion, it proceeds with the upgrade. If it's less than the minimumSystemVersion, it does not perform the upgrade.

ashwin-mittal commented 1 week ago

Is it possible to add the minimumSystemVersion through the electron-builder configuration, or do I need to manually include it in the latest.yml files? If it can be done through the configuration, could you please provide an example of how to set it up?

ashwin-mittal commented 1 week ago

@beyondkmp

beyondkmp commented 1 week ago

minimumSystemVersion

It needs to be manually added to the YAML file, as there's no configuration for it currently. I'll submit a PR later to support configurable options.

ashwin-mittal commented 6 days ago

Thanks for the clarification, @beyondkmp. Looking forward to the PR that will support configurable options for minimumSystemVersion.