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.exe picks Steam directory over current directory #1628

Closed
pjf opened this issue Mar 13, 2016 · 1 comment
Closed

ckan.exe picks Steam directory over current directory #1628

pjf opened this issue Mar 13, 2016 · 1 comment
Labels
Support Issues that are support requests

Comments

@pjf
Copy link
Member

pjf commented Mar 13, 2016

Reported in this forum post , using CKAN v1.16.0.

I haven't verified this myself, but it seems plausible. We should be checking same directory as ckan.exe first, then everything else from there.

@pjf pjf changed the title ckane.exe picks Steam directory gets picked over current directory ckan.exe picks Steam directory gets picked over current directory Jun 19, 2016
@pjf pjf changed the title ckan.exe picks Steam directory gets picked over current directory ckan.exe picks Steam directory over current directory Jun 19, 2016
pjf added a commit that referenced this issue Jun 19, 2016
* reavertm/master:
  Quote path to executable in URL handler .desktop file, likely fixes issue #1628.
@ayan4m1 ayan4m1 added the Support Issues that are support requests label Aug 3, 2016
@HebaruSan
Copy link
Member

I think this was a false alarm. The code is pretty clear that PortableDir (ckan.exe's folder) is checked first, and FindAndRegisterDefaultInstance (Steam) is last:

CKAN/Core/KSPManager.cs

Lines 70 to 105 in e825bde

internal KSP _GetPreferredInstance()
{
// First check if we're part of a portable install
// Note that this *does not* register in the registry.
string path = KSP.PortableDir();
if (path != null)
{
KSP portableInst = new KSP(path, "portable", User);
if (portableInst.Valid)
{
return portableInst;
}
}
// If we only know of a single instance, return that.
if (instances.Count == 1 && instances.First().Value.Valid)
{
return instances.First().Value;
}
// Return the autostart, if we can find it.
// We check both null and "" as we can't write NULL to the registry, so we write an empty string instead
// This is necessary so we can indicate that the user wants to reset the current AutoStartInstance without clearing the windows registry keys!
if (!string.IsNullOrEmpty(AutoStartInstance)
&& HasInstance(AutoStartInstance)
&& instances[AutoStartInstance].Valid)
{
return instances[AutoStartInstance];
}
// If we know of no instances, try to find one.
// Otherwise, we know of too many instances!
// We don't know which one to pick, so we return null.
return !instances.Any() ? FindAndRegisterDefaultInstance() : null;
}

A few ways the problem report could have been mistaken:

  • Installing ckan.exe into GameData instead of game root
  • Running a different copy of ckan.exe via a shortcut
  • Symbolic links?

No details have been added in 2 years, so we're unlikely to see them now; closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Issues that are support requests
Projects
None yet
Development

No branches or pull requests

3 participants