atlanticaccent / starsector-mod-manager-rust

A mod manager for Starsector, a space fleet-battle and economics simulator. This time written in Rust.
https://atlanticaccent.github.io/starsector-mod-manager-rust/
MIT License
33 stars 1 forks source link

[macOS] Freezes while browsing for Starsector install directory, and when setting (wrong?) directory manually #70

Closed Zuthal closed 3 years ago

Zuthal commented 3 years ago

The macOS version of the mod manager launches correctly on macOS 10.14.6. However, when I go into Settings and click on Browse... to select the Starsector install directory, it opens up the Finder window, but then freezes, with the spinning beach ball of death. It does generate a crashlog with the system popup of whether you want to report after force-quitting, which I have attached in the hope it will be useful. It also froze when I set the install path manually to my users/username/applications directory, which is where Starsector is installed, with the following error message:

Alert: Failed to parse mods folder. Mod list has not been populated.

Now it freezes with that error every time I open it - I presumably set the wrong directory. It would be useful to also in the setting's screen put which directory should be given - the one that Starsector is in, the Starsector.app itself, or the Mods folder.

Crash 1.txt is the log for the first case, Crash 2.txt for the second case. Crash 2.txt

Crash 1.txt

atlanticaccent commented 3 years ago

Oof, but kind of better than I expected (I wasn't sure it would launch at all). The errors you're describing suggest I've done something wrong regarding file system path handling that's macOS specific - I'm not aware of anything about macOS filesystems that I overlooked, but it's Apple so who knows.

A workaround for the constant crashing would be to delete the "config.json" file that exists alongside the application itself - though it'd be great if you could post the contents of that before you do delete it, as it might help me diagnose the issue.

Good point on the informativeness (or lack thereof) of the settings pane. The intended directory your first suggestion - that is, the directory the app and mods folder are located in. I'll hopefully get that improved and included in a later update/patch.

atlanticaccent commented 3 years ago

Would you also be able to tell me if there's anything out of the ordinary about the path you were trying to select/how your computer is set up? Does it contain any characters with accents or umlauts, or chinese characters for example?

I'm wondering if this might be some kind of encoding issue.

Zuthal commented 3 years ago

There is nothing unusual about the path. The contents of the config.json are

{
  "install_dir": "/users/username/applications"
}

(username changed because it is my IRL name, but it also only contains ascii characters).

Though you definitely have overlooked some things about macOS file systems I feel - the .zip unpacks to simply a raw unix executable, rather than a folder I would expect, and it seems to always place the config.json in the /users/username/ directory, at least if the mod manager file is in some subdirectory of that - expected behaviour would be to place the config.json into the same directory that the mod manager file is in.

Also, the app and mods folder are different paths - the path to the app is /users/username/applications/Starsector.app in my case, while the path to the mods folder is /users/username/applications/Starsector.app/mods. But I assume setting it to /users/username/applications was then the intended thing to do?

atlanticaccent commented 3 years ago

Yeah, seems I've forgotten most of what it's like to develop for macOS - for a start, "apps" are really just fancy folders, so on macOS the directory you want to supply is the path of the app, thus "/users/username/applications/Starsector.app". It also means that the vmparams editor will choke, because the path on that is platform specific too. I'm gonna keep looking into it, though I am on holiday for the next two weeks so my internet may be a bit spotty