element-hq / element-desktop

A glossy Matrix collaboration client for desktop.
https://element.io
GNU Affero General Public License v3.0
1.13k stars 260 forks source link

Add auto-update configuration options #764

Open vertigo220 opened 1 year ago

vertigo220 commented 1 year ago

Your use case

What would you like to do?

Control/disable automatic downloads of updates.

Why would you like to do it?

I don't like when software automatically downloads stuff without my permission in any circumstances, but especially given that I'm currently on a slow and somewhat metered connection, it's an especially big problem. I just saw that it had an update available and debated whether I wanted to download another >100MB file after I just downloaded it to install it the other day. I decided to go ahead just so I could be sure to be using the latest version before submitting some feature requests and bug reports I have planned, and was surprised to find it updated instantly, meaning it had already downloaded it. This means it's using data I don't necessarily want used, downloading data to my computer without my knowledge or permission, and slowing down my other online activities due to using my limited bandwidth behind the scenes.

How would you like to achieve it?

There should be an option in the settings like with Windows updates that allows the user to choose how to handle updates:

Have you considered any alternatives?

No response

Additional context

No response

t3chguy commented 1 year ago

Element Web doesn't "download" updates pre-emptively, but given it is a webapp, the next time you refresh/close & reopen your browser - your browser will fetch the latest app instead of relying on its cached copy.

Do you mean specifically Element Desktop?

vertigo220 commented 1 year ago

Yes, Desktop. Sorry, I guess I assumed that would be clear, but should have probably specified.

t3chguy commented 1 year ago

Squirrel.Windows & Squirrel.Mac (at least via Electron's autoUpdater) don't allow you to enable the autoUpdater without it automatically downloading when checking for an update - https://www.electronjs.org/docs/latest/api/auto-updater

Note: If an update is available it will be downloaded automatically.

This would make your suggestion of having notify & download be separate interactions not possible

So I suggest opening this suggestion upstream

vertigo220 commented 1 year ago

Trying to figure out where to create an issue. This issue in the electron repo says "This is how Squirrel works and unfortunately there is nothing you can do to change this behavior. It is how Squirrel was designed to work (silent, no user hassle updates)" so I guess it would be under Squirrel.Windows.

In the meantime, since it's not currently possible to control the behavior of the auto-update, maybe there could be an option to simply disable it completely or to control how often it checks.

t3chguy commented 1 year ago

You can disable it in config.json at this time, it also lets you choose which update server to use

vertigo220 commented 1 year ago

Thanks, I'll look into that. I wonder if that will have to be changed every update.

I created a discussion about this on Squirrel's repo. Not sure if this issue should be closed or left open in case they make a change and to help others find it easier. I leave it to an admin to decide which is best. Thanks for the help!

t3chguy commented 1 year ago

I wonder if that will have to be changed every update.

Nope, your config.json gets merged atop the one that ships inside the build https://github.com/vector-im/element-desktop/#user-specified-configjson

vertigo220 commented 1 year ago

I don't have a config.json there, only electron-config.json, and it doesn't have anything in it about updates. Do I need to create a config.json and, if so, what do I need to put in it?

t3chguy commented 1 year ago

Create it, https://github.com/vector-im/element-desktop/blob/develop/element.io/release/config.json is the default one that is included, yours gets applied atop so all fields are optional. https://github.com/vector-im/element-web/blob/develop/docs/config.md

vertigo220 commented 1 year ago

Thanks. I've checked both links and elsewhere and don't see any option for disabling auto updates. The only thing I see is "update_base_url." Do I just set that to blank?

t3chguy commented 1 year ago

Blank or null should work yes

vertigo220 commented 1 year ago

Ok, so I created "%appdata%\Element\config.json" containing the following:

{
    "update_base_url": ""
}
vertigo220 commented 1 year ago

Per Squirrel in the linked discussion: "This is incorrect. Update policy is 100% decided by the application for Squirrel applications." I'm assuming that means it's up to Electron, as it's their implementation of Squirrel that needs to be modified to allow this?

t3chguy commented 1 year ago

Per Squirrel in the linked discussion: "This is incorrect. Update policy is 100% decided by the application for Squirrel applications." I'm assuming that means it's up to Electron, as it's their implementation of Squirrel that needs to be modified to allow this?

I linked you to the Electron autoUpdater docs, there the note says the update will be automatically downloaded.

vertigo220 commented 1 year ago

Per Squirrel in the linked discussion: "This is incorrect. Update policy is 100% decided by the application for Squirrel applications." I'm assuming that means it's up to Electron, as it's their implementation of Squirrel that needs to be modified to allow this?

I linked you to the Electron autoUpdater docs, there the note says the update will be automatically downloaded.

Right, but in my above comment, I linked an issue there where they claimed it was due to how Squirrel works, and there's nothing they can do. So apparently everyone along the chain is denying responsibility and saying the problem is further up or downstream. Makes it hard to get any resolution.