Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Update Linux support to 0.0.13 #288

Merged
merged 5 commits into from
Feb 10, 2017
Merged

Update Linux support to 0.0.13 #288

merged 5 commits into from
Feb 10, 2017

Conversation

sarnex
Copy link
Contributor

@sarnex sarnex commented Apr 21, 2016

Code heavily based on @Francesco149's original PR, with line numbers updated.

Signed-off-by: Nick Sarnie [email protected]

His original instructions are below, with slight modification:
Make sure you have at least node v5



cd
mkdir discord
cd discord

# Install discord in /opt/
wget https://discordapp.com/api/download/canary?platform=linux&format=tar.gz
tar -xzvf discord-canary-0.0.3.tar.gz
sudo cp -r DiscordCanary /opt/
sudo ln -s /opt/DiscordCanary/DiscordCanary /usr/bin/discord

# Install BetterDiscord
git clone https://github.com/sarnex/BetterDiscordApp.git
mv BetterDiscordApp BetterDiscord
cp BetterDiscord/Installers/Node/* .
cp BetterDiscord/splice .
npm install asar wrench
sudo ./install.sh

_functionCallSplice = 507;
_functionSplice = 580;
_discordPath = "/opt/DiscordCanary/resources";
// not sure where the .deb install, and most people are going to
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK *.deb file installs in /usr/share/discord-canary

Copy link
Contributor Author

@sarnex sarnex Apr 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original required the user to install in /opt, and not everyone is on Debian or Ubuntu, so I'm inclined to leave that for now. I don't want to look like I'm taking responsibility for this code, I just updated the line numbers for 0.0.3.

@brawaru
Copy link

brawaru commented Apr 22, 2016

Some fixes for script :)

cd

# Move dir if exists
oldTime=$(date +"%H-%M-%S.%d-%m-%y")
mv discord "discord.${oldTime}.old"

# And.. Create new!
mkdir discord
cd discord

# Install discord in /opt/
wget "https://discordapp.com/api/download/canary?platform=linux&format=tar.gz" -O discord-canary.tar.gz
tar -xzvf discord-canary.tar.gz
sudo cp -r DiscordCanary /opt/
sudo ln -s /opt/DiscordCanary/DiscordCanary /usr/bin/discord

# Install BetterDiscord
git clone https://github.com/sarnex/BetterDiscordApp.git
mv BetterDiscordApp BetterDiscord
cp BetterDiscord/NodeInstaller/* .
cp BetterDiscord/splice .
npm install asar wrench
sudo ./install.sh

cd

To uninstall Discord:

sudo rm -f $(which discord)
sudo rm -rf /opt/DiscordCanary/

@Francesco149
Copy link

ah thanks for updating my pull request, was too busy to work on it

@mkody
Copy link
Contributor

mkody commented Apr 24, 2016

Works fine for me!

I needed to change the _discordPath in the NodeInstaller/index.js file since the AUR package for Discord-Canary uses /opt/discord-canary/.
But it looks like this path is not consistent between distributions. But for Arch, someone might just add a patch during installation if they make a AUR package, if needed 👍

@sarnex
Copy link
Contributor Author

sarnex commented Apr 26, 2016

Still works with no changes on version 0.4 and 0.5

@sarnex sarnex changed the title Update Linux support to 0.0.3 Update Linux support to 0.0.4 Apr 26, 2016
@sarnex sarnex changed the title Update Linux support to 0.0.4 Update Linux support to 0.0.5 Apr 29, 2016
@brawaru
Copy link

brawaru commented May 3, 2016

Not works on newest 0.0.6 version :(

@sarnex
Copy link
Contributor Author

sarnex commented May 3, 2016

@DaFri-Nochiterov should be fixed now

I've also cleaned up the PR a good bit.

@sarnex sarnex changed the title Update Linux support to 0.0.5 Update Linux support to 0.0.6 May 3, 2016
@sarnex sarnex force-pushed the master branch 3 times, most recently from 890e9f5 to 03e5f06 Compare May 3, 2016 22:58
@brawaru
Copy link

brawaru commented May 4, 2016

@sarnex, yes, this works. Thanks.

@brawaru
Copy link

brawaru commented May 4, 2016

Again. Not works on 0.0.7 version.

Now with Exception:

Uncaught Exception:
SyntaxError: Unexpected token ;
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Object.<anonymous> (/opt/DiscordCanary/resources/electron.asar/browser/init.js:184:8)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)

@sarnex sarnex changed the title Update Linux support to 0.0.6 Update Linux support to 0.0.7 May 4, 2016
@sarnex
Copy link
Contributor Author

sarnex commented May 4, 2016

@DaFri-Nochiterov fixed again, hopefully they leave index.js alone in the future. If it happens again, I'll look for a better solution than hardcoding line numbers which is done in the official installer.

@sarnex sarnex force-pushed the master branch 2 times, most recently from 1f82c32 to 18fb5c2 Compare May 4, 2016 23:17
@mkody
Copy link
Contributor

mkody commented May 6, 2016

@sarnex You should definitely look for a better solution, because I'm pretty sure the index.js will change a lot in the near future.

@sarnex sarnex force-pushed the master branch 2 times, most recently from 04ee627 to 79d00fd Compare May 8, 2016 01:29
@sarnex
Copy link
Contributor Author

sarnex commented May 8, 2016

I've rewritten the linux installer to not use hardcoded line numbers. It should not break now unless they remove the two lines I'm searching for, which I don't expect.

@mkody
Copy link
Contributor

mkody commented May 10, 2016

And it works fine on just-released 0.0.8! 👍

@sarnex sarnex changed the title Update Linux support to 0.0.7 Update Linux support to 0.0.8 May 10, 2016
@brawaru
Copy link

brawaru commented May 14, 2016

Emoticons no longer works in this version

@mkody
Copy link
Contributor

mkody commented Jan 11, 2017

Yup, it is still needed. #436 should fix it.

@simoniz0r
Copy link

Any chance of all of that getting merged into this PR? I'd rather not go through all of that every time I install BetterDiscord.

@sarnex
Copy link
Contributor Author

sarnex commented Jan 11, 2017 via email

@simoniz0r
Copy link

Thank you so much!

@magiruuvelvet
Copy link

Still works with canary 0.0.14 👍
I didn't tested the Linux PTB and Stable client. I prefer Canary 😄

@mkody
Copy link
Contributor

mkody commented Jan 26, 2017

I guess we should change the path in js/main.js as well if we rebase on recent commits.

diff --git a/js/main.js b/js/main.js
index 4ee8bea..3f1a5d9 100644
--- a/js/main.js
+++ b/js/main.js
@@ -13,7 +13,7 @@
     let __fs = window.require("fs");
     let __process = window.require("process");
     let __platform = __process.platform;
-    let __dataPath = (__platform === 'win32' ? __process.env.APPDATA : __platform === 'darwin' ? __process.env.HOME + '/Library/Preferences' : '/var/local') + '/BetterDiscord/';
+    let __dataPath = (__platform === 'win32' ? __process.env.APPDATA : __platform === 'darwin' ? __process.env.HOME + '/Library/Preferences' : process.env.HOME + '/.config') + '/BetterDiscord/';
 
 
     let __data = {};

@simoniz0r
Copy link

Could you also please merge #435 into this PR? I had to create a script that deletes /home/user/.config/bdstorage.json before launching BetterDiscord otherwise it complains that /home/user/.config/BetterDiscord//bdStorage.json doesn't exist, and gives me a javascript error that locks up the whole app.

Javascript error

@sarnex
Copy link
Contributor Author

sarnex commented Jan 26, 2017 via email

@magiruuvelvet
Copy link

And another update. Still works with 0.0.15 👍

@dddlr
Copy link

dddlr commented Jan 27, 2017

@magiruuvelvet I hope you’re not going to keep this up every day, considering the new update schedule. 😜

Change linux path to use the $HOME/.config folder
@Arzte
Copy link

Arzte commented Jan 30, 2017

Canary it set to build on each new push to the master branch, just as an FYI.

@simoniz0r
Copy link

I don't know if you've seen this, but Ckath made a script that can install BetterDiscord to any directory... might be of some use to you.
https://github.com/Ckath/Discord-stuff/blob/master/scripts/tape.sh

@sarnex
Copy link
Contributor Author

sarnex commented Feb 4, 2017 via email

@simoniz0r
Copy link

simoniz0r commented Feb 4, 2017

I would think the fact that it allows any directory to be used is enough, but shrug

@sarnex
Copy link
Contributor Author

sarnex commented Feb 4, 2017 via email

@simoniz0r
Copy link

Sure, but that's not ideal. That is not the default install location for the .deb package. Also, with PTB and Stable being released on Linux, tape.sh makes installing BetterDiscord to those Discord versions possible without having to move them to /opt/DiscordCanary/ first.

@Jiiks Jiiks merged commit 11190a8 into Jiiks:master Feb 10, 2017
@Jiiks
Copy link
Owner

Jiiks commented Feb 10, 2017

Maybe it's time to merge this o-o

@mkody
Copy link
Contributor

mkody commented Feb 10, 2017

Woo!
You should keep an eye on the fact that we're not using /var/local anymore, but ~/.config.
This includes (at least) in v2/lib/core.js: installPath and dataPath, and injs/main.js: __dataPath

@sarnex
Copy link
Contributor Author

sarnex commented Feb 10, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet