ByzantineFailure / BPM-for-Discord

BPM for Discord's Desktop App. Includes one-click installers, update notifications, and custom script support.
GNU Affero General Public License v3.0
17 stars 8 forks source link

BPM fails to install on Discord Canary 0.0.34 on Linux #96

Closed Jibodeah closed 6 years ago

Jibodeah commented 6 years ago

Error log from installer:

fs.js:549
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open '../resources/bpm_extract/index.js'
    at Error (native)
    at Object.fs.openSync (fs.js:549:18)
    at Object.fs.readFileSync (fs.js:397:15)
    at injectBpm (/home/jibodeah/Programs/DiscordCanary/BPM-For-Discord/lib/integration.js:85:24)
    at Object.modifyDiscord (/home/jibodeah/Programs/DiscordCanary/BPM-For-Discord/lib/integration.js:22:5)
    at Object.<anonymous> (/home/jibodeah/Programs/DiscordCanary/BPM-For-Discord/index.js:39:13)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)

Update: Another Canary update (0.0.35), also affected.

ByzantineFailure commented 6 years ago

This will fail on Canary on Windows and other platforms as well.

So it looks like Discord's core code organization has changed. We now need to inject into the discord_desktop_core module which is zipped inside:

resources/bootstrap/discord_desktop_core.zip

If this continues we should no longer actually require asar extraction for this path. Neat.

Either way, I have some work on my plate.

ByzantineFailure commented 6 years ago

Actual file to inject into now:

discord_desktop_core/app/mainScreen.js

ByzantineFailure commented 6 years ago

Initial fixes: 929b2512eb41b225b02843e22f228ec34b405896

Still need to be tested:

Mac, Linux functionality. I'm almost 100% certain the mac stuff is broken for canary.

Still needs to be written:

Mac canary installer.

Linux installer should work as of this commit given that you just pass a flag, --canary in.

ByzantineFailure commented 6 years ago

Updates on what's what:

So it looks like you actually don't need to mess with the .zip files. I need to play with an actual fresh canary install to confirm, BUT:

After the initial run of the canary client, it extracts all the module .zip files into some cache location (%APPDATA%/discordcanary/VERSION/modules/ on Windows), then runs them from there. We need to modify those files. We should throw an error if that doesn't exist.

Jibodeah commented 6 years ago

A fresh Canary update today (0.0.36) and BPM installs again. It seems whatever changes they've made have been rolled back.

...But I guess they might come back again so best keep tabs on things. I'll keep you updated anyway.

ByzantineFailure commented 6 years ago

Hm. Okay. Well, either way, I've got code laid out to at least establish the foundation of what will be needed when this goes more-significantly live. Did it all to be seamlessly reverse-compatible so hopefully it should be fine either way.

Thanks for the report, by the way; this is something that can destroy the addon. Will keep this issue open as I suspect this is a temp. rollback after some issues were found and they'll roll it out again soon.

Jibodeah commented 6 years ago

Canary 0.0.38, it's back!

ByzantineFailure commented 6 years ago

Aye aye, will take a look when I get the chance, or at least pull down this version of the canary.

On Dec 18, 2017 17:00, "Jibodeah" notifications@github.com wrote:

Canary 0.0.38, it's back!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ByzantineFailure/BPM-for-Discord/issues/96#issuecomment-352606604, or mute the thread https://github.com/notifications/unsubscribe-auth/AEwr6U4spkKHxkvBBpvxZC6IV3b1MGDeks5tBwqwgaJpZM4RBOCk .

1byte2bytes commented 6 years ago

I'm willing to provide testing for macOS, and I can install Windows and/or a Linux distro on a VM if additional verification or testing is wanted. Looks like we've got both of those covered though.

ByzantineFailure commented 6 years ago

Sounds good.

I do have a commit in to fix the install on Windows, but unfortunately I've started a new job in the last month and am working out all the fun legalities of who owns what when I commit code in my free time. I'll post here with some builds for testing when I get that figured out, hopefully by the end of next week. (This is probably the only time in my life I've been grateful that a codebase is AGPL/GPL rather than an MIT-like)

IF IT SO HAPPENS THAT THE CURRENT CANARY VERSION DROPS DURING THIS PERIOD I would absolutely love it if someone would take on finishing up the Linux and Mac variants.

Basically we'd need to get the path to the unpacked modules for install on those OS's.

1byte2bytes commented 6 years ago

Yeah, from what I've read in this issue so far the change was rolled back. The only mention of discord_desktop_core I can find is at /Users/sydneyerickson/Library/Application\ Support/discordcanary/0.0.184/modules/discord_desktop_core/ and contains just core.asar, index.js, and package.json. The actual Discord Canary.app is void of anything resembling a Discord install, besides a app.asar file.

ByzantineFailure commented 6 years ago

core is an asar? ... I'm gonna check what it is on Windows now.

1byte2bytes commented 6 years ago

screen shot 2018-01-05 at 6 52 21 pm

ByzantineFailure commented 6 years ago

Cool, that matches what I find in the extract on windows. Means I can still used a unified strategy for doing this across all OS's. Thank god.

Okay, cool, just means I have to unpack and repack the asar :)

ByzantineFailure commented 6 years ago

Also, thanks a ton for the path. Will work with that! ...once I get a few things worked out with some lawyers -.-