Installer icon indicating copy to clipboard operation
Installer copied to clipboard

Linux Love and Care: Major rewrite which adds support for Linux Native, Flatpaks, Snaps and refactors most of the code

Open Arcitec opened this issue 3 years ago • 22 comments

Hello Everyone! :cat2:

Here's a little "love and care" package for Linux users.

The commit descriptions explain all of the changes in detail.

You can also thank @TayouVR for asking me nicely if I could update the installer. I had a little bit of time left over and thought "ehh, why not?". It wouldn't have happened if they hadn't asked. But BetterDiscord is a great project, so I'm happy to help! :stuck_out_tongue_winking_eye:

 

Works Action Version
Install Linux Native: Discord
Install Linux Native: Canary
Install Linux Flatpak: Discord
Install Linux Flatpak: Canary
Install Linux Snap: Discord
Install Linux Snap: Canary
Repair Linux Native: Discord
Repair Linux Native: Canary
Repair Linux Flatpak: Discord
Repair Linux Flatpak: Canary
Repair Linux Snap: Discord
Repair Linux Snap: Canary
Uninstall Linux Native: Discord
Uninstall Linux Native: Canary
Uninstall Linux Flatpak: Discord
Uninstall Linux Flatpak: Canary
Uninstall Linux Snap: Discord
Uninstall Linux Snap: Canary
Browse Linux Native: Discord
Browse Linux Native: Canary
Browse Linux Flatpak: Discord
Browse Linux Flatpak: Canary
Browse Linux Snap: Discord
Browse Linux Snap: Canary
Kill/Restart Linux Native: Discord
Kill/Restart Linux Native: Canary
Kill/Restart Linux Flatpak: Discord
Kill/Restart Linux Flatpak: Canary
Kill/Restart Linux Snap: Discord
Kill/Restart Linux Snap: Canary

(The "Browse" action means clicking on the installer's Browse button to manually choose the installation folder.)

 

Downloadable version while you wait:

Due to the extensive code rewrites, this pull request may take a long time to review.

People who are eager to get started can download the v1.2.0 Linux AppImage:

https://github.com/Bananaman/BetterDiscord-Installer/releases/tag/v1.2.0

That AppImage will be removed when it's officially merged.

 

Issues fixed by this pull request:

  • Closes https://github.com/BetterDiscord/Installer/issues/26
  • Closes https://github.com/BetterDiscord/Installer/issues/58
  • Closes https://github.com/BetterDiscord/Installer/issues/64
  • Closes https://github.com/BetterDiscord/Installer/issues/123
  • Closes https://github.com/BetterDiscord/Installer/issues/127
  • Closes https://github.com/BetterDiscord/Installer/issues/134
  • Closes https://github.com/BetterDiscord/Installer/issues/157
  • Closes https://github.com/BetterDiscord/Installer/issues/192
  • Closes https://github.com/BetterDiscord/Installer/issues/226
  • Closes https://github.com/BetterDiscord/Installer/issues/242
  • Closes https://github.com/BetterDiscord/Installer/issues/245
  • Closes https://github.com/BetterDiscord/Installer/issues/246
  • Closes https://github.com/BetterDiscord/Installer/issues/247
  • Closes https://github.com/BetterDiscord/Installer/issues/264
  • Closes https://github.com/BetterDiscord/Installer/issues/265
  • Closes https://github.com/BetterDiscord/Installer/issues/273
  • Closes https://github.com/BetterDiscord/Installer/issues/275
  • Closes https://github.com/BetterDiscord/BetterDiscord/issues/679
  • Closes https://github.com/BetterDiscord/BetterDiscord/issues/736
  • Closes https://github.com/BetterDiscord/BetterDiscord/issues/827
  • Closes https://github.com/BetterDiscord/BetterDiscord/issues/1061
  • Closes https://github.com/BetterDiscord/BetterDiscord/issues/1156
  • Closes https://github.com/BetterDiscord/BetterDiscord/issues/1235
  • Closes https://github.com/BetterDiscord/BetterDiscord/issues/1269
  • Closes https://github.com/BetterDiscord/BetterDiscord/issues/1284
  • Closes https://github.com/BetterDiscord/BetterDiscord/issues/1299
  • Closes https://github.com/BetterDiscord/BetterDiscord/issues/1305
  • Closes https://github.com/BetterDiscord/BetterDiscord/issues/1313
  • Closes https://github.com/BetterDiscord/BetterDiscord/issues/1319
  • Closes https://github.com/BetterDiscord/BetterDiscord/issues/1336
  • Closes https://github.com/BetterDiscord/BetterDiscord/issues/1341

(Sorry if I forgot to add any more related tickets. :rofl:)

Arcitec avatar Aug 23 '22 22:08 Arcitec

You just made a lot of people happy. Thanks Bananaman!

Technetium1 avatar Aug 23 '22 22:08 Technetium1

What's with the 100 issues that all say the same 5 or so things? Is there a reason for that? Also, there seem to be a lot of changes that are separate to what you have described. This will probably be questioned.

SmolAlli avatar Aug 23 '22 23:08 SmolAlli

@Technetium1

You just made a lot of people happy. Thanks Bananaman!

Thanks. I am happy to help restore this installer for Linux. A lot of people want an easy GUI installer.

@SmolAlli

What's with the 100 issues that all say the same 5 or so things? Is there a reason for that?

Yes. It is necessary for three reasons.

  1. It ensures that those issues are automatically closed by GitHub when this is merged.
  2. It notifies every person who has had those issues, that a fix is on the way.
  3. It creates a two-way link for people who read those tickets, so that they can see the link to this resolution.

Also, there seem to be a lot of changes that are separate to what you have described. This will probably be questioned.

Every change is mentioned in the commit messages.

Arcitec avatar Aug 23 '22 23:08 Arcitec

It ensures that those issues are automatically closed by GitHub when this is merged.

Most of them were closed already though. Why not just do the open ones?

SmolAlli avatar Aug 24 '22 00:08 SmolAlli

Most of them were closed already though. Why not just do the open ones?

It's just a courtesy to the people who had their tickets closed due to being "duplicates". It's a small amount of noise in the grand scheme of GitHub things, and it helps people who otherwise wouldn't have known about it. For example, if they've quit using BetterDiscord because their ticket was closed and they could never install it, and so on. If they've never interacted with the "main" ticket for each issue, then they would never know.

Arcitec avatar Aug 24 '22 00:08 Arcitec

If this works with the flatpak canary as it says I'm all for it. I've partially moved to flatpaks to help keep my system tree clean. So any support for that version helps ^_^

kaosine avatar Aug 25 '22 23:08 kaosine

As an update to my last comment, I noticed there was a build on their side and tested it. It now works with canary using flatpak. So that's a plus. Still need to test it more, but I'm pretty happy now that it works.

kaosine avatar Aug 27 '22 17:08 kaosine

As an update to my last comment, I noticed there was a build on their side and tested it. It now works with canary using flatpak. So that's a plus. Still need to test it more, but I'm pretty happy now that it works.

Yep, I have extensively tested it with all versions listed in the long "checkmark ✅ table" in the original post. But it's still great to hear your results too. I am happy to have helped! :)

I provided that build exactly since I expect it to take a long time to review all the code changes and merge them. So if anyone else wants the new Linux build, it's above in the original post (as you found out). ❤️

Arcitec avatar Aug 27 '22 19:08 Arcitec

Has this been tested with the current BetterDiscord asar? My understanding is that further changes are needed on that end to properly support snap (and other) installs due to configuration file locations.

zerebos avatar Aug 31 '22 15:08 zerebos

If you look at their chart it says it does. Whether or not that's true is another story. I just know it works with flatpak canary for me since I downloaded a build from their fork and used that to get it working on my end with flatpaks. Your mileage may very but they supposedly tested all versions so idk.

kaosine avatar Aug 31 '22 15:08 kaosine

@rauenzi Hi Zack, thank you for reviewing the code and providing feedback. I will reply to each of your comments now and will take care of the changes within a week or so. I am really occupied at the moment, being there for a 12 year old who lives in an abusive home where he gets beaten by both of his parents, starved by his mother, and stays up all night to avoid being awake at day where he would get beaten. I am helping him get a way out through the police and his older brother. So my mind is very far away from programming right now. I'll get back to this work as soon as I am able.

 

Update: Thanks again for your very detailed review! I provided some feedback on some of the questions. I'll also contact you on Discord so that we can chat after this situation has calmed down, but I wasn't able to find you in the channels. You can send me a friend request. When I am ready to resume the work and implement the changes, we can talk and figure out if there are any questions to solve, such as the idea about making BetterDiscord's config path more flexible.

 

Update: I just noticed the extra comments outside the review. I'll reply to them below:

Has this been tested with the current BetterDiscord asar? My understanding is that further changes are needed on that end to properly support snap (and other) installs due to configuration file locations.

It was tested with all versions in the compatibility table as of the date I opened the pull request, and works perfectly. I tested every function marked with a ✅. Has anything changed in BetterDiscord.asar after that date?

Edit: Tested everything one more time today (Sept 14th, 2022), but nope, nothing has changed in BetterDiscord. Snap, Flatpak and Native all work as perfectly today as the day I opened the pull request. I even tried installing custom CSS Themes in the Snap versions (since you hinted that Snap doesn't support BetterDiscord), but it works perfectly! The original compatibility table in the initial message is still correct. :)

 

By doing checks for process.platform === "linux" we are then explicitly not supporting BSD then?

Yes, BSD doesn't have Snaps, doesn't have Flatpaks, and doesn't have any native Discord client (only web/unofficial clients).

We should definitely do something such as verifying that process.platform is one of win32, darwin or linux, and showing an "Unsupported operating system" error if the user has something else. I'll work on that!

Edit: I have now created an "Unsupported Platform" page which shows up if the user attempts to run the installer on an unsupported OS. It whitelists Windows, macOS and Linux. Those are the only operating systems that Discord supports, and which BetterDiscord and its installer support. Anything else will now just show the user an explanation about unsupported platforms.

 

Could this all be handled a bit cleaner if there were changes in BetterDiscord itself? Feel free to reach out to me on Discord to discuss. I am open to changed in the BD client to add first-class support for snap/flatpak installs, especially if it makes this process easier.

I'll see if there are other areas where things could be improved through changes to BetterDiscord itself. But right now the only thing that comes to mind is the change mentioned in the review: Making BetterDiscord on Linux prefer to live in a path underneath the current Discord version's config directory, to avoid file corruption whenever a person runs multiple native Discord clients (Discord, Canary and PTB). Currently they will corrupt each other since they all write to the same ~/.config/BetterDiscord path. For Flatpak and Snap there is no such issue since they use sandboxed environments, with one sandbox per installation, so each of them have their own unique BetterDiscord config directories. :)

 

Anyway, thanks a lot for the detailed review. Nice to see such brilliant people work on BetterDiscord! :)

Current Status of PR: Awaiting answers for the 4 open conversations above, before pushing the final version.

Arcitec avatar Sep 02 '22 18:09 Arcitec

when will this be merged?

NyllRE avatar Sep 18 '22 19:09 NyllRE

Hi @Bananaman I seem to have lost our Discord DMs, can you send me another message on there?

zerebos avatar Oct 28 '22 05:10 zerebos

Any updates on this? I know I could just pull from their side on this, but it would be great to see this in the official release.....

kaosine avatar Jan 08 '23 23:01 kaosine

Bump, somebody pls fix the random code styling issues and merge this juicy boy

Etaash-mathamsetty avatar Apr 29 '23 23:04 Etaash-mathamsetty

Hey any news there?

iMonZ avatar Oct 16 '23 16:10 iMonZ

And any info about Wayland support?

iMonZ avatar Oct 16 '23 16:10 iMonZ

this still hasnt been merged?

Hikiru avatar Feb 24 '24 02:02 Hikiru

Yes, I never received a followup DM and Bananaman seems to have gone inactive.

zerebos avatar Feb 24 '24 04:02 zerebos

ok now this is getting insane bro just solved a ton of issues and y'all left him on read for 2 years come on

NyllRE avatar Mar 21 '24 18:03 NyllRE

Yes, I never received a followup DM and Bananaman seems to have gone inactive.

Why do you need a follow up dm to merge it?

Hikiru avatar Mar 21 '24 18:03 Hikiru

Why do you need a follow up dm to merge it?

There are still issues to fix and changes to make. #348 has a higher chance of being merged at this point as Sam has gone through and fixed some issues and we've discussed some changes that need to be made to improve things from the client side as well.

zerebos avatar Mar 25 '24 11:03 zerebos