fsavje / math-with-slack

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

Allow windows installer to run when slack installation has a space in windows user directory #41

Closed amelialouise closed 5 years ago

amelialouise commented 5 years ago

I ran the windows batch file as

math-with-slack.bat "C:\Users\User Name\AppData\Local\slack\app-3.3.1\resources\app.asar.unpacked\src\static\"

I got the following message in the command prompt:

Cannot find Slack file: C:\Users\User Name\AppData\Local\slack\app-3.3.1\resources\app.asar.unpacked\src\static\ssb-interop.js Press any key to continue . . .

There was a ssb-interop.js.mwsbak file in C:\...\static\ so I deleted "mwsbak" from that file. I ran the batch file a second time using the same line above and got the following message in the command prompt:

The system cannot find the file: C:\Users\User.

I uninstalled slack completely and reinstalled it directly to C:\ (using the MSI for machine-wide installation package). I then ran the the batch file as

math-with-slack.bat "C:\slack\resources\app.asar.unpacked\src\static"

Et voila, the math-with-slack installation worked.

fsavje commented 5 years ago

Thank you @amelialouise for the report. I'm glad you got the script to work in the end. I don't, however, quite understand what you're reporting. Could you perhaps explain?

From your description it seems you had an outdated or corrupt installation of Slack, and the reinstallation fixed that.

amelialouise commented 5 years ago

Hello @fsavje, sure I can further explain. No, Slack was neither outdated nor corrupt. I uninstalled and reinstalled Slack twice with the same message from math-with-slack each time saying "The system cannot find the file..." I did not mention doing that in the above report, but that may help to know. The reason I uninstalled Slack was a workaround; I wanted to reinstall it directly to C:\.

More detail: Based on the error messages from math-with-slack.bat, I guessed that the issue it was having was due to my windows user name having a space in it; note that the directory structure for Slack looks like C:\Users\User Name\AppData\Local\slack , where User Name is defined by the windows user and may or may not have a space in it. Mine does.

To test out this guess, I installed Slack to C:\ so that the directory structure looked like C:\slack\ instead (no spaces in any of the directories). When I did this, math-with-slack ran without issue. So this suggested to me that the script probably needs some extra character handling somewhere when it goes to find the slack directory for its installation.

I hope that helps explain things a bit more. & thank you for writing this script!!

fsavje commented 5 years ago

Thank you @amelialouise! I understand the report now; sorry for the confusion.

I don't have access to a windows machine at the moment, but the new development version of the batch script should work with spaces in the username. If you get a chance to test it, please let me know.

DaveLanday commented 5 years ago

I ran the windows batch file as

math-with-slack.bat "C:\Users\User Name\AppData\Local\slack\app-3.3.1\resources\app.asar.unpacked\src\static\"

I got the following message in the command prompt:

Cannot find Slack file: C:\Users\User Name\AppData\Local\slack\app-3.3.1\resources\app.asar.unpacked\src\static\ssb-interop.js Press any key to continue . . .

There was a ssb-interop.js.mwsbak file in C:\...\static\ so I deleted "mwsbak" from that file. I ran the batch file a second time using the same line above and got the following message in the command prompt:

The system cannot find the file: C:\Users\User.

I uninstalled slack completely and reinstalled it directly to C:\ (using the MSI for machine-wide installation package). I then ran the the batch file as

math-with-slack.bat "C:\slack\resources\app.asar.unpacked\src\static"

Et voila, the math-with-slack installation worked.

This worked for me too! Thank you for your detailed solution.