-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
electron-updater: feature request - custom minimumSystemVersion
validation
#8682
Comments
Thoughts on a We'd probably want to set a file size limit (arbitrarily?) on the app-update.yml file though to prevent abuse of the |
hi @mmaietta! it's a good suggestion but unfortunately that would only work for a new release of our app onwards. the app has been in general release for quite some time and it wouldn't work for users who already have current and previous versions of the app installed, unless i'm missing something: already released versions in the wild will continue to look for if we change up our writing of if we leave our writing of the added catch is that to get existing installations in line with consuming new metadata, we need them to be able to auto update, which is the core issue 😅 |
If I'm understanding correctly, you want custom minimum system version validation on already-installed versions of your application? If so, that's not possible with electron-updater. Feature requests like this will only apply to new deployments, the currently installed applications use the electron-updater version it was bundled with. The only way out of this situation is to revert your non-backward-compatible changes (or create a separate release branch?) so you can update electron-updater (assuming we proceed with My apologies in advance if I missread/interpreted what you're saying |
hey @mmaietta thanks so much for keeping up with this!
ah no not quite, as you said that would clearly not be possible. we would like to able to customise how electron updater checks minimumSystemVersion here for new releases of our app should we update to the new version of electron-updater this would let us keep writing the version in our publisher yml as e.g. 12 for macOS Monterey and not the let me know if that makes more sense |
Hmmm Right now Regardless, it looks like we'll still run into the field conflicting due to var name. In order to have a platform-specific An alternative route would require one migration step in between for your users. What I envision:
I think that'd work? |
thanks again for all the discussion!
totally agree that renaming the variable in electron updater would not be the way to go, and that something like a i was thinking more along the lines of being able to assign a version check function in-app, so that a consumer of the library can do something like: import { autoUpdater } from "electron-updater";
autoUpdater.validateMinimumSystemVersion = (logger, minimumSystemVersion?: string): boolean => {
// ... some custom version check that returns false if invalid
} used in if (this.validateMinimumSystemVersion) {
if (this.validateMinimumSystemVersion(this._logger, updateInfo.minimumSystemVersion) === false) {
return false;
}
} else {
// ... perform current default system version check against os.release
} essentially the end user can decide if the version is valid for their setup. but i can understand if that might add maintenance overhead, not to mention requests for extending that for other attributes down the line the intermediary release plan you describe is something we've thought about as well - we can give that more thought on our end, though it might take a while for sufficient uptake. in that case, is it advisable to upgrade electron-builder to v25.x while keeping updater at v5.x? we'd like to keep builder at least up-to-date. we could also look at making use of the
|
Hmmm, I like where you're going with this! Perhaps we can expand the functionality to |
i think that's a great idea! i was hesistant to make it too generic to avoid breaking any other validation logic electron-updater relies on, but what you suggest makes a lot of sense |
@kavsingh , can you please try out this patch-package? It adds the hook Let me know how it works out and if it serves your needs. If so, then I'll merge in the PR
|
hi @mmaietta, just tried it out and it works well for our needs! thanks so much 🙇 |
Before
minimumSystemVersion
was read in-app byelectron-updater
- #8108 - we rolled our ownminimumSystemVersion
checks since we had a pressing need.When building our application, we write
minimumSystemVersion
to the update yaml as the "human readable" product version on macOS, e.g12.0.0
for Monterey (to matchmac.minimumSystemVersion
in our electron builder config). The changes in #8108 forceminimumSystemVersion
to be checked against againstos.release
. Whileos.release
is a sensible default, unfortunately we cannot switch up to use it in our publish yml files without major disruptions to our user base - app installs already in the wild can end up blocked from updating or erroneously updated.It would be great to have an option to use a custom validator for
minimumSystemVersion
, or to disable it and handleminimumSystemVersion
ourselves.Am happy to open a PR for this.
The text was updated successfully, but these errors were encountered: