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

CKAN.NotKSPDirKraken: Could not find KSP version in buildID.txt or readme.txt #2504

Closed
Drakkith opened this issue Aug 18, 2018 · 11 comments
Closed

Comments

@Drakkith
Copy link

Background

CKAN Version:
1.25.2

KSP Version:
1.3.1

Operating System:
Windows 10

Have you made any manual changes to your GameData folder (i.e., not via CKAN)?
Yes. I've installed and deleted several mods manually.

Problem

CKAN encounters an unhandled exception when opening and will not open. I've already deleted every all CKAN references in my registry and I can't find anything related to CKAN when I use a registry cleaner.

What steps did you take in CKAN?
I "forgot" an install of KSP, which may have been the trigger for the issue.

CKAN error codes (if applicable):

Unhandled exception:
CKAN.NotKSPDirKraken: Could not find KSP version in buildID.txt or readme.txt
at CKAN.KSP.CkanDir()
at CKAN.Main..ctor(String[] cmdlineArgs, KSPManager mgr, GUIUser user, Boolean showConsole)
at CKAN.GUI.Main_(String[] args, KSPManager manager, Boolean showConsole)
at CKAN.CmdLine.MainClass.Main(String[] args)

@HebaruSan
Copy link
Member

So is there a default instance currently? Does it have those two files that the error mentions (buildID.txt or readme.txt)?

@Drakkith
Copy link
Author

What's a 'default instance'? I just have the .exe file that you download. Everything else that it installs has been deleted as far as I can tell.

@HebaruSan
Copy link
Member

Instance of the game, the thing you said you "forgot". Does CKAN know of a copy of KSP on your system?

@Drakkith
Copy link
Author

I'm not certain. I think it still had the copy of KSP in my steam folder remembered. It was my RO/RSS version that I told it to forget. But I went ahead and deleted the CKAN folder from my steam copy as well in an attempt to fix it, but no joy.

@HebaruSan
Copy link
Member

OK, is buildID.txt or readme.txt present in your Steam copy of KSP?

@Drakkith
Copy link
Author

I'll have to check my desktop when I get back home (currently out of town until tomorrow), but I'm nearly certain I finally just deleted KSP entirely from both locations (steam and non-steam). Not just an uninstall, but a complete deletion of the folder once the uninstall was complete, so there shouldn't be any ckan files left.

However, I was having the same problem on both my desktop and my laptop and it looks like grabbing a registry cleaner fixed my laptop's problem with ckan. But having to mess with your registry to fix the problem is obviously undesirable.

@HebaruSan
Copy link
Member

Hi @twotone48166, that's a different unrelated issue, see #2483. I'm going to go ahead and prune your comment to prevent confusion on this issue.

@KSP-CKAN KSP-CKAN deleted a comment from MikeEberhart Aug 19, 2018
@HebaruSan HebaruSan changed the title Unhandled Exception at Startup CKAN.NotKSPDirKraken: Could not find KSP version in buildID.txt or readme.txt Aug 19, 2018
@Drakkith
Copy link
Author

Uh oh, looks like things weren't fixed on my laptop after all. Just had this exception occur while CKAN was updating the registry after installing some mods:

System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\Drakkith\AppData\Local\Temp\CdFileMgr\c87286f1-c6be-41.json'.

I can't even find the AppData folder that's supposed to be there unless it's hidden or something.

@HebaruSan
Copy link
Member

That's #2342, being fixed in #2492. Your OS is deleting that CdFileMgr folder while we're still trying to use it.

Back to the original issue, of the several places that catch NotKSPDirKraken, the only ones in GUI are in the choose KSP install window. So if your default game folder becomes invalid (i.e., you delete it and/or its files), that exception will be thrown and not caught. I think we can avoid that by checking CurrentInstance.Valid here...

CKAN/GUI/Main.cs

Lines 187 to 190 in 37c8477

// We want to check if our current instance is null first,
// as it may have already been set by a command-line option.
if (CurrentInstance == null && manager.GetPreferredInstance() == null)
{

@Drakkith
Copy link
Author

Roger. Glad to know that #2342 is being fixed.
In the meantime, is there anything else you need from me about the original issue?

@HebaruSan
Copy link
Member

Hmm, digging a little deeper, we are already checking CurrentInstance.Valid, in KSPManager.GetPreferredInstance. So an invalid instance shouldn't be getting returned, and it should already be prompting you to select a valid game folder.

Ahh, I think it's because your Steam folder exists and is invalid. If you have no known game folders, it'll automatically check the Steam folder first, and that logic is missing some of the newer validation checks (it looks for GameData but not the versioning info), so an invalid Steam folder can slip through. I think I see a good spot to fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants