Make it possible to "auto-downgrade" the application on channel change
See original GitHub issue- electron-builder: 11.5.0
- electron-auto-updater: 1.0.0
- Target: win32
We have separate release channels based on the configuration of the user (beta|stable). Lets say these are the current versions:
- beta: 1.2.0-beta.4
- stable: 1.1.0
Behavior we would like to achieve:
When a user from the beta
channel wants to go back to the stable
channel the application should auto-update (downgrade) to the latest stable
version.
Possible solutions:
- Always update on channel change (check the current application channel with the requested channel)
GenericProvider.ts
async shouldForceUpdate(): Promise<boolean> {
const latestChannel = this.channel
// currentChannel how to get this?
return latestChannel != currentChannel
}
AppUpdater.ts
const forceUpdate = await client.shouldForceUpdate()
if (!forceUpdate && !isVersionGreaterThan(latestVersion, currentVersion)) {
this.updateAvailable = false
if (this.logger != null) {
this.logger.info(`Update for version ${versionInfo.version} is not available`)
}
this.emit("update-not-available")
return {
versionInfo: versionInfo,
}
}
and small updates on all the other Providers + interface Provider
- Add a configuration option like
updateOnVersionChange
orcanDowngrade
(better name suggestions are welcome) that will auto-update the application iflatestVersion
!=currentVersion
.
AppUpdater.ts
if ((updateOnVersionChange && latestVersion == currentVersion) || (!updateOnVersionChange && !isVersionGreaterThan(latestVersion, currentVersion))) {
this.updateAvailable = false
if (this.logger != null) {
this.logger.info(`Update for version ${versionInfo.version} is not available`)
}
this.emit("update-not-available")
return {
versionInfo: versionInfo,
}
}
Let me know if we could integrate any of these solutions with a pull request or if you have an even better proposal to achieve this “downgrade” on channel change behavior.
Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How to downgrade Android Auto and rollback to a ... - YouTube
Apps like CarStream, Fermata Auto and AA Mirror may not work with the latest version of Android Auto. To fix the issue you...
Read more >How To Downgrade Any App On Android! (2020) - YouTube
MY MUSIC: https://soundcloud.com/SimpleAlpacaGET SUPER CHEAP PHONES HERE: https://goo.gl/XDvaQrSUB TO MY SECOND CHANNEL !
Read more >Change the Microsoft 365 Apps update channel for devices in ...
This article gives step-by-step instructions for changing the update channel for Microsoft 365 Apps.
Read more >Android: How to Downgrade an App - Technipages
Fortunately, there is a way to downgrade an app if you need to. From the Home screen, select “Settings” > “Apps“. Choose the...
Read more >On-device upgrade and downgrade - Roku Developer
To downgrade a plan, channels similalry check the expiration date of the current plan being and then mark it for cancellation. A new...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
allowDowngrade
option is added. Defaults totrue
if application version contains prerelease components (e.g.0.12.1-alpha.1
, herealpha
is a prerelease component), otherwisefalse
. So, if version are not equal — we just update to versions in the update info. If you set channel or somehow else set lower version in the update info — it is your developer decision 😃 No need to implement at little bit complex channel check.It would only be for GenericProvider and we could compare the (current application) channel inside
resources/app-update.yml
with the channel that is set insideautoUpdater.setFeedURL
.So for example we have this inside
app-update.yml
:And we update the
autoUpdater
like this:This would be a solution that only affects the GenericProvider.
The other solution would be to add a configuration option like
updateOnVersionChange
orcanDowngrade
(see above).