thisiscam / math-with-slack

Rendered math (MathJax) with Slack's desktop client
MIT License
306 stars 28 forks source link

After installing and uninstalling on MacOS: `The application "Slack" can't be opened.` #35

Closed MaxGhenis closed 2 years ago

MaxGhenis commented 2 years ago

Steps:

(base) maxghenis@Maxs-MacBook-Pro Downloads % sudo python math-with-slack.py 
Password:
Using Slack installation at: /Applications/Slack.app/Contents/Resources/app-x64.asar
Downloading MathJax...100%, 4.5 MB / 4.5 MB, 18366.7 KB/s, 0.3 sec
Caveat!!!
You are on MacOS but have not enabled code signing. Math-with-slack is likely functional; however, you might experience log-offs if you quit Slack. See github.com/thisiscam/math-with-slack/issues/30 for more info.
If you don't understand the above, you should stop reading and use the script as-is, or uninstall the script with `--uninstall`.
If you know what this is about and know what you are doing: you may re-run this script with `--macos-codesign` to enable code signing. 
Install successful. Please restart Slack.

I then tried to open Slack, but it said there was an error due to signing. I decided to uninstall rather than try the --macos-codesign:

(base) maxghenis@Maxs-MacBook-Pro Downloads % sudo python math-with-slack.py --uninstall
Using Slack installation at: /Applications/Slack.app/Contents/Resources/app-x64.asar
Uninstall successful. Please restart Slack.

But I still couldn't open Slack. Clicking on the application didn't do anything. About a minute later, my computer spontaneously restarted, and now when I try to open Slack I get a dialog saying The application "Slack" can't be opened.

Uninstalling and reinstalling Slack resolved the issue.

thisiscam commented 2 years ago

Have you opened Slack at least once before running the script?

MaxGhenis commented 2 years ago

Have you opened Slack at least once before running the script?

Yes

thisiscam commented 2 years ago

Just checking, which macOS and Slack version are you on?

thisiscam commented 2 years ago

FWIW, you can temporarily fix/reinstall Slack by downloading from their website (if you haven't already, that is). This is pretty safe and shouldn't lost you any data, AFAIK.

thisiscam commented 2 years ago

About a minute later, my computer spontaneously restarted

Wait, I didn't see this. That sounds super weird. This script definitely should not do anything like this, especially if you didn't use the --macos-codesign option.

MaxGhenis commented 2 years ago

I'm on MacOS Monterey 12.1 and Slack 4.23.0

thisiscam commented 2 years ago

And you downloaded Slack from website, not App store?

MaxGhenis commented 2 years ago

No, I downloaded Slack from the App Store

thisiscam commented 2 years ago

That's the culprit. For now, you can try the Slack website version. I will do a patch to disable attempts to modify the App store version

MaxGhenis commented 2 years ago

Uninstalling the App Store version and reinstalling from the Slack website produced the same message:

(base) maxghenis@Maxs-MacBook-Pro Downloads % sudo python math-with-slack.py 
Password:
Using Slack installation at: /Applications/Slack.app/Contents/Resources/app-x64.asar
Downloading MathJax...100%, 4.5 MB / 4.5 MB, 15892.2 KB/s, 0.3 sec
Caveat!!!
You are on MacOS but have not enabled code signing. Math-with-slack is likely functional; however, you might experience log-offs if you quit Slack. See github.com/thisiscam/math-with-slack/issues/30 for more info.
If you don't understand the above, you should stop reading and use the script as-is, or uninstall the script with `--uninstall`.
If you know what this is about and know what you are doing: you may re-run this script with `--macos-codesign` to enable code signing. 
Install successful. Please restart Slack.

At this point I had to sign in to all my workspaces again, and TeX didn't render (I tried $x = y$).

I uninstalled again to make sure it wasn't pointing to an old App Store installation, which it looks like it wasn't:

(base) maxghenis@Maxs-MacBook-Pro Downloads % sudo python math-with-slack.py
Password:
Could not find Slack's app.asar file under ['/Applications/Slack.app/Contents/Resources/']. Please manually provide path (see --help)

Doing it all again still showed TeX unrendered.

thisiscam commented 2 years ago

At this point I had to sign in to all my workspaces again

Yup this is expected when --macos-codesign is not present.

and TeX didn't render (I tried $x = y$).

I can't reproduce this (I'm using the same macOS and Slack version as you). I don't think this is the issue, but worth a shot: perhaps try the newest master? I just made some updates.

I uninstalled again

BTW, you don't need to "uninstall" Slack -- you should be able to reinstall Slack by using the .dmg installer and choosing "replace" when copying. This should also get rid of the plugin.