Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Throw a FATAL when the PWD is set to a different directory than "Origin" #9

Closed
Lisias opened this issue Feb 14, 2021 · 4 comments
Closed
Assignees
Labels
task Not a problem, but something I must do and should not forget about
Milestone

Comments

@Lisias
Copy link
Collaborator

Lisias commented Feb 14, 2021

KSP relies on the current directory in order to access some critical files (as KSP.log)

However, on some borderline situations the OS' launcher may set the working directory to somewhere else, and this is confusing KSP, leading it to bork.

Full report on Forum.

Interesting quotes:

You'll notice that my file manager has an integrated tree-style thing going on. That means I can open folders and then open files from inside those folders without having to actually navigate into them. I use this all the time.
Manjaro File System
That's what's causing the problem. When I launch the KSP executable nested inside several open folders like that, its working directory is not the directory the actual file is placed in, but the directory that is currently open in the file manager. In the screenshot's case, that is the folder where I keep all my KSP installs.

My diagnosis was:

This is when things went badly:

[LOG 21:37:08.937] [KSPe.IO.Path] Origin is /mnt/LinuxData/KSP/KSP1-11-1-BUGTEST/game/
[LOG 21:37:08.937] [KSPe.IO.Path] PWD    is /mnt/LinuxData/KSP/

And this is when things are fine:

[LOG 21:44:54.928] [KSPe.IO.Path] Origin is /mnt/LinuxData/KSP/KSP1-11-1-BUGTEST/game/
[LOG 21:44:54.928] [KSPe.IO.Path] PWD    is /mnt/LinuxData/KSP/KSP1-11-1-BUGTEST/game/

Well... Microsoft is innocent on this one (By The Krakens, I think this is the first time I say something like that... )

I find it hard to pinpoint KSP as the source of the fault either, as it's expected that the current directory is set to the directory where the executable is by default on launching applications (even Windows does that - damn, two in a day!).

However, there're situations where you want the current directory to be different - so I'm not really sure if this is a bug of the Manjaro's File Manager, or just am unusual feature biting your SAS.

From KSPe point of view, I can "fix" the problem by brute force my way out if the mess setting the PWD to the Origin internally - but that would not solve KSP's problem, as it will still be looking for files on unexpected places.

In a way or another, I need to cook a new FATAL on KSPe to halt the game loading when the PWD is different from the Origin, as this is an unacceptable situation without a possible work around.

Full set of logs

@Lisias
Copy link
Collaborator Author

Lisias commented Apr 7, 2021

Fixed on commit KSP-ModularManagement/KSPAPIExtension@b072e42

KSPe will redirect the user to https://github.com/net-lisias-ksp/KSPAPIExtensions/issues/12 for help when this happens.

@Lisias
Copy link
Collaborator Author

Lisias commented Apr 11, 2021

Reopening due this problem : https://github.com/net-lisias-ksp/KSPAPIExtensions/issues/12#issuecomment-817361780

(Windows uses case insensitive pathnames by default)

@Lisias Lisias reopened this Apr 11, 2021
@Lisias Lisias removed this from the 2.3.0.1 milestone Apr 11, 2021
@Lisias Lisias self-assigned this Apr 11, 2021
@Lisias Lisias added this to the 2.3.0.2 milestone Apr 11, 2021
@Lisias
Copy link
Collaborator Author

Lisias commented Apr 11, 2021

TL;DR of the problem:

[LOG 14:38:26.480] [KSPe] Fatal Error PwdIsNotOrigin was shown. pwd = c:\program files (x86)\steam\SteamApps\common\Kerbal Space Program\ ; origin = C:\Program Files (x86)\Steam\steamapps\c
ommon\Kerbal Space Program\ . Please visit https://github.com/net-lisias-ksp/KSPAPIExtensions/issues/12

@Lisias
Copy link
Collaborator Author

Lisias commented Apr 11, 2021

Reworked on commit KSP-ModularManagement/KSPAPIExtension@d5b78f5

@Lisias Lisias closed this as completed Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Not a problem, but something I must do and should not forget about
Projects
None yet
Development

No branches or pull requests

1 participant