SpacingBat3 / WebCord

A Discord and SpaceBar :electron:-based client implemented without Discord API.
MIT License
1.88k stars 93 forks source link

Auto Update Feature #491

Open oxmc opened 9 months ago

oxmc commented 9 months ago

Description

I think having webcord auto update like the offical discord app does would be nice instead of having to download a new version each time, i'd be more than happy to help with this idea.

Suggestions

No response

Alternatives

No response

Additional Context

No response

SpacingBat3 commented 9 months ago

I mean, Discord kinda doesn't trully auto-update as well (at least on Linux), only a modules that it installs during update but the client stays intact.

As of Windows and macOS, Electron supports auto-updating these, but I guess in case of Windows my hate over Squirrel format won't make it happen (I'm not sure if NSIS supports auto-updates over Electron) and AFAIK macOS has also required the binary signing for auto-updates to be supported, so yeah… this is kinda problematic right now.

Also as of Linux, I thought of setting up the OBS (OpenSuse Build Service) in order to have some kind of CI to automatically build the binaries for multiple Linux distros. But right now I have no clue how to set it up, so it is still uncertain when and if that'll happen.

oxmc commented 9 months ago

I have this inplace for my own app: image

I could modify it for your purpose and have it handle appimages and other stuff, and it can be contained in the update.ts file for the main logic.

SpacingBat3 commented 9 months ago

I could modify it for your purpose and have it handle appimages and other stuff, and it can be contained in the update.ts file for the main logic.

This logic is too simple for WebCord; with many platforms being available for the same platform or even distro, it is quite hard to handle updates like this, especially on Linux. Moreover, using sudo is a bad idea for GUI apps, I would preffer using Polkit for that and eventually fall back to other sollutions, maybe make a GUI to pass password to CLI, although I'm not sure about the security implications about storing passwords in JavaScript memory (given it is really hard to enforce a cleanup and zeroing of such data).

And as of Windows (Squirrel instalations), I don't really want to invest any time around implementing auto-updates, I'll drop Squirrel as soon as I start working on NSIS installers for Forge.

SpacingBat3 commented 9 months ago

Also, I believe the support for auto-updates could be implemented in the AppImage maker directly, as AppImages are designed to hold an update information and official toolkit is also able to generate delta images based on old and new version of the package, allowing for updates without need of redownloading same data if it is similar between the binaries of different version.

oxmc commented 9 months ago

Was not aware appimages could do that