The BetterDiscord installer doesn't support Flatpak or Snap. The first Linux distros start seemlessly integrating these types of packages in their software store and as their main method of installation.
Well, to be fair saying that the installer doesn't support snap isn't quite right either. Rather it explicitly blocks installing to snap even though it would otherwise be supported.
|
if (proposedPath.includes("/snap/")) { |
|
remote.dialog.showErrorBox("BetterDiscord Incompatible", "BetterDiscord is currently incompatible with Snap installs of Discord. Support for snap installs is coming soon!"); |
|
return ""; |
|
} |
Flatpak on the other hand actually needs some more work because of it's sandboxing by the looks of it. More specifically it can't read the
betterdiscord.asar from user's config directory, so it needs to be installed in the flatpak's config directory.
The snap installation has a related problem. because it's betterdiscord.asar is in the user config directory while the detected config directory is in the snap package's directory the autoupdate functionality of BD is expected to fail.
From a chat with @Tropix126 I could gather that it wasn't always compatible but changing it to injection method to inject the require statement in the discord_desktop_core/index.js module seems to have made it otherwise compatible. In fact betterdiscordctl's installation method is identical to the installer. The only relevant change for BD installation is changing the config directory detection depending on the detected.
betterdiscordctl's installation steps for comparison (warning: identical to the installer)
- Detect config directory
- Detect Discord folder in the config directory
- Detect version folder in the Discord config directory
- Detect the core module folder in the version directory
- download betterdiscord.asar from github releases (it looks like it may also be caching the asar though)
- create a betterdiscord and betterdiscord/data folder if they don't exist
- copy the asar in there
- inject require statement in index.js of the core module (only difference I can see is a newline more after the injection using betterdiscordctl)
The BetterDiscord installer doesn't support Flatpak or Snap. The first Linux distros start seemlessly integrating these types of packages in their software store and as their main method of installation.
Well, to be fair saying that the installer doesn't support snap isn't quite right either. Rather it explicitly blocks installing to snap even though it would otherwise be supported.
Installer/src/renderer/actions/paths.js
Lines 84 to 87 in 1bf733d
Flatpak on the other hand actually needs some more work because of it's sandboxing by the looks of it. More specifically it can't read the
betterdiscord.asarfrom user's config directory, so it needs to be installed in the flatpak's config directory.The snap installation has a related problem. because it's
betterdiscord.asaris in the user config directory while the detected config directory is in the snap package's directory the autoupdate functionality of BD is expected to fail.From a chat with @Tropix126 I could gather that it wasn't always compatible but changing it to injection method to inject the
requirestatement in thediscord_desktop_core/index.jsmodule seems to have made it otherwise compatible. In factbetterdiscordctl's installation method is identical to the installer. The only relevant change for BD installation is changing the config directory detection depending on the detected.betterdiscordctl's installation steps for comparison (warning: identical to the installer)
.toLowercase().replace(" ","")everywhereDiscord - SnapandDiscord - Flatpakplatform as needed,