Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Installer can't seem to find snap version of Discord #1

Closed
YamiYukiSenpai opened this issue Feb 11, 2018 · 13 comments
Closed

Installer can't seem to find snap version of Discord #1

YamiYukiSenpai opened this issue Feb 11, 2018 · 13 comments
Labels
enhancement:feature New feature or request enhancement:implemented Enhancement that has been implemented good-first-issue Good for newcomers

Comments

@YamiYukiSenpai
Copy link

YamiYukiSenpai commented Feb 11, 2018

I tried installing on /snap & /snap/discord/52/usr/share, but the installer can't seem to find it.
ls /snap/discord/
38 41 52 current
$ ls /snap/discord/current/usr/share/
alsa avahi dbus-1 doc-base gconf icons libthai mime sgml X11 applications bash-completion discord fonts glib-2.0 libdrm lintian pixmaps themes apport bug doc GConf gtk-engines libsensors4 man pkgconfig upstart
$ ls /snap/discord/current/usr/share/discord
blink_image_resources_200_percent.pak discord.png natives_blob.bin ui_resources_200_percent.pak content_resources_200_percent.pak icudtl.dat pdf_viewer_resources.pak views_resources_200_percent.pak content_shell.pak libffmpeg.so postinst.sh Discord libnode.so resources discord.desktop locales snapshot_blob.bin

@ObserverOfTime
Copy link
Collaborator

ObserverOfTime commented Feb 11, 2018

Looks like snap is a bit tricky.
It worked by manually setting the paths and using the -c flag to copy the BetterDiscord files instead of symlinking. When symlinking, snap Discord seems to fail to follow the link and can't find betterdiscord.js.
This is what you need:
betterdiscordctl install -v -c -d "/snap/discord/current/usr/share/discord" -m "$HOME/snap/discord/current/.config/discord/0.0.4/modules"

Note that when Discord updates and the version number is changed, you will need to use the new version number.

The BetterDiscord settings will be located in "$HOME/snap/discord/current/.config/BetterDiscord".

@ObserverOfTime
Copy link
Collaborator

ObserverOfTime commented Feb 11, 2018

Update: I have added snap support to my fork. You can use that if you want.
betterdiscordctl install -v -s /snap/discord/current/usr/share --snap

@bb010g
Copy link
Owner

bb010g commented Feb 12, 2018

That's really curious that symlinking fails with Snap.

@ObserverOfTime
Copy link
Collaborator

ObserverOfTime commented Feb 12, 2018

After some more testing, it seems that snap installations don't have access to files outside their parent directory. That's why the symlink can't be followed. The snap docs confirm this.

@bb010g
Copy link
Owner

bb010g commented Feb 13, 2018

Could you see if it's fixed now that #2 is merged?

@YamiYukiSenpai
Copy link
Author

$ sudo ./betterdiscordctl --snap install
WARN: Config directory not found for (/snap/discord/current/usr/share/discord, /root/snap/discord/52/.config/discord).
ERROR: Discord installation not found.

@bb010g
Copy link
Owner

bb010g commented Feb 13, 2018

Could you try running that without sudo?

@YamiYukiSenpai
Copy link
Author

YamiYukiSenpai commented Feb 13, 2018

$ ./betterdiscordctl --snap install
./betterdiscordctl: line 418: pushd: /home/yamiyukisenpai/.local/share/betterdiscordctl/asar: No such file or directory
Updating asar...
./betterdiscordctl: line 420: npm: command not found
./betterdiscordctl: line 422: popd: directory stack empty
./betterdiscordctl: line 423: /home/yamiyukisenpai/.local/share/betterdiscordctl/asar/node_modules/asar/bin/asar.js: No such file or directory
sed: can't read /home/yamiyukisenpai/snap/discord/52/.config/discord/0.0.4/modules/discord_desktop_core/core/app/mainScreen.js: No such file or directory
Cloning https://github.com/rauenzi/BetterDiscordApp...
./betterdiscordctl: line 461: /home/yamiyukisenpai/.local/share/betterdiscordctl/bd_map: Permission denied
fatal: could not create leading directories of '/home/yamiyukisenpai/.local/share/betterdiscordctl/bd/0': Permission denied
cp: cannot stat '/home/yamiyukisenpai/.local/share/betterdiscordctl/bd/0': No such file or directory
Installed. (Restart Discord if necessary.)

BTW, I restarted my laptop just in case that solves it.

@bb010g
Copy link
Owner

bb010g commented Feb 13, 2018

Ok, so you've got a couple of problems going on here. First thing is that you installed using sudo, so the data directory got set up with root permissions. You'll need to sudo rm -r ~/.local/share/betterdiscordctl first to let betterdiscordctl fix that. Next, install npm, as noted in the readme. Finally, you seem to have some weird permissions also for Discord. Could you run ls -l ~/snap/discord/52/.config/discord/0.0.4/modules/discord_desktop_core/{,core/{,app/}}?

@YamiYukiSenpai
Copy link
Author

Whoops. Thought I had npm.

$ ls -l ~/snap/discord/52/.config/discord/0.0.4/modules/discord_desktop_core/{,core/{,app/}}
ls: cannot access '/home/yamiyukisenpai/snap/discord/52/.config/discord/0.0.4/modules/discord_desktop_core/core/': No such file or directory
ls: cannot access '/home/yamiyukisenpai/snap/discord/52/.config/discord/0.0.4/modules/discord_desktop_core/core/app/': No such file or directory
/home/yamiyukisenpai/snap/discord/52/.config/discord/0.0.4/modules/discord_desktop_core/:
total 6564
-rw-rw-r-- 1 yamiyukisenpai yamiyukisenpai 6711726 Jan  9 12:57 core.asar
-rw-rw-r-- 1 yamiyukisenpai yamiyukisenpai      35 Feb 13 14:44 index.js
-rw-rw-r-- 1 yamiyukisenpai yamiyukisenpai      84 Jan  9 12:57 package.json

@bb010g
Copy link
Owner

bb010g commented Feb 13, 2018

Derp, yeah, that makes sense. Those are generated by the asar unpacking. :)

@YamiYukiSenpai
Copy link
Author

Hey, I think deleting ~/.local/share/betterdiscordctl worked! Thanks for the help!
And maybe installing npm, too (I swear I thought I had it in my laptop already)

$ ./betterdiscordctl --snap install             Installing asar...
/home/yamiyukisenpai/.local/share/betterdiscordctl/asar
└─┬ asar@0.14.2 
  ├── chromium-pickle-js@0.2.0 
  ├── commander@2.14.1 
  ├── cuint@0.2.2 
  ├─┬ glob@6.0.4 
  │ ├─┬ inflight@1.0.6 
  │ │ └── wrappy@1.0.2 
  │ ├── inherits@2.0.3 
  │ ├── once@1.4.0 
  │ └── path-is-absolute@1.0.1 
  ├─┬ minimatch@3.0.4 
  │ └─┬ brace-expansion@1.1.11 
  │   ├── balanced-match@1.0.0 
  │   └── concat-map@0.0.1 
  ├─┬ mkdirp@0.5.1 
  │ └── minimist@0.0.8 
  ├─┬ mksnapshot@0.3.1 
  │ ├─┬ decompress-zip@0.3.0 
  │ │ ├─┬ binary@0.3.0 
  │ │ │ ├── buffers@0.1.1 
  │ │ │ └─┬ chainsaw@0.1.0 
  │ │ │   └── traverse@0.3.9 
  │ │ ├── graceful-fs@4.1.11 
  │ │ ├── mkpath@0.1.0 
  │ │ ├─┬ nopt@3.0.6 
  │ │ │ └── abbrev@1.1.1 
  │ │ ├── q@1.5.1 
  │ │ ├─┬ readable-stream@1.1.14 
  │ │ │ ├── core-util-is@1.0.2 
  │ │ │ ├── isarray@0.0.1 
  │ │ │ └── string_decoder@0.10.31 
  │ │ └─┬ touch@0.0.3 
  │ │   └── nopt@1.0.10 
  │ ├─┬ fs-extra@0.26.7 
  │ │ ├── jsonfile@2.4.0 
  │ │ ├── klaw@1.3.1 
  │ │ └─┬ rimraf@2.6.2 
  │ │   └─┬ glob@7.1.2 
  │ │     └── fs.realpath@1.0.0 
  │ └─┬ request@2.83.0 
  │   ├── aws-sign2@0.7.0 
  │   ├── aws4@1.6.0 
  │   ├── caseless@0.12.0 
  │   ├─┬ combined-stream@1.0.6 
  │   │ └── delayed-stream@1.0.0 
  │   ├── extend@3.0.1 
  │   ├── forever-agent@0.6.1 
  │   ├─┬ form-data@2.3.1 
  │   │ └── asynckit@0.4.0 
  │   ├─┬ har-validator@5.0.3 
  │   │ ├─┬ ajv@5.5.2 
  │   │ │ ├── co@4.6.0 
  │   │ │ ├── fast-deep-equal@1.0.0 
  │   │ │ ├── fast-json-stable-stringify@2.0.0 
  │   │ │ └── json-schema-traverse@0.3.1 
  │   │ └── har-schema@2.0.0 
  │   ├─┬ hawk@6.0.2 
  │   │ ├── boom@4.3.1 
  │   │ ├─┬ cryptiles@3.1.2 
  │   │ │ └── boom@5.2.0 
  │   │ ├── hoek@4.2.0 
  │   │ └── sntp@2.1.0 
  │   ├─┬ http-signature@1.2.0 
  │   │ ├── assert-plus@1.0.0 
  │   │ ├─┬ jsprim@1.4.1 
  │   │ │ ├── extsprintf@1.3.0 
  │   │ │ ├── json-schema@0.2.3 
  │   │ │ └── verror@1.10.0 
  │   │ └─┬ sshpk@1.13.1 
  │   │   ├── asn1@0.2.3 
  │   │   ├── bcrypt-pbkdf@1.0.1 
  │   │   ├── dashdash@1.14.1 
  │   │   ├── ecc-jsbn@0.1.1 
  │   │   ├── getpass@0.1.7 
  │   │   ├── jsbn@0.1.1 
  │   │   └── tweetnacl@0.14.5 
  │   ├── is-typedarray@1.0.0 
  │   ├── isstream@0.1.2 
  │   ├── json-stringify-safe@5.0.1 
  │   ├─┬ mime-types@2.1.17 
  │   │ └── mime-db@1.30.0 
  │   ├── oauth-sign@0.8.2 
  │   ├── performance-now@2.1.0 
  │   ├── qs@6.5.1 
  │   ├── safe-buffer@5.1.1 
  │   ├── stringstream@0.0.5 
  │   ├─┬ tough-cookie@2.3.3 
  │   │ └── punycode@1.4.1 
  │   ├── tunnel-agent@0.6.0 
  │   └── uuid@3.2.1 
  └─┬ tmp@0.0.28 
    └── os-tmpdir@1.0.2 

npm WARN asar No description
npm WARN asar No repository field.
npm WARN asar No license field.
Cloning https://github.com/rauenzi/BetterDiscordApp...
Cloning into '/home/yamiyukisenpai/.local/share/betterdiscordctl/bd/0'...
remote: Counting objects: 6667, done.
remote: Total 6667 (delta 0), reused 0 (delta 0), pack-reused 6666
Receiving objects: 100% (6667/6667), 20.02 MiB | 2.17 MiB/s, done.
Resolving deltas: 100% (4244/4244), done.
Installed. (Restart Discord if necessary.)

@bb010g
Copy link
Owner

bb010g commented Feb 13, 2018

Awesome! I'll close this, then. Again, thanks a bunch @ObserverOfTime for actually implementing and testing Snap stuff.

@bb010g bb010g closed this as completed Feb 13, 2018
@ObserverOfTime ObserverOfTime added the good-first-issue Good for newcomers label Feb 16, 2018
@ObserverOfTime ObserverOfTime added enhancement:feature New feature or request enhancement:implemented Enhancement that has been implemented labels Oct 19, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement:feature New feature or request enhancement:implemented Enhancement that has been implemented good-first-issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants