Jump to content

[WIN] KSP Directory Junction Creator


Recommended Posts

KSP Directory Junction Creator

KSP DJC is a Windows tool (.NET 4.5) for easily creating directory junctions to a common craft file repository.

What is a Directory Junction?

A Directory Junction is like a link in your operating system's file structure.  By accessing the Directory Junction, you are redirected and accessing a folder at an alternate location instead.

Why Use Directory Junctions with KSP?

In KSP we have craft and subassembly files stored on a per-game basis.  That means that only that game can access the files unless you make multiple copies, which gets very messy.  With Directory Junctions you can store all your craft in one location and access them from any game at any time.  You can create a craft in a sandbox game and immediately load it into your career game without any file manipulation.

Can I Create Directory Junctions without this tool?

Yes, however it is significantly more difficult as Windows does not have a graphical method of doing this without external tools.  It must be done from a command shell, which means a lot of typing.

Why Does DJC require an elevated permission?

This is required so that DJC can create junctions in protected locations (such as Program Files).  If you are security conscious, I completely understand.  You may download the source and attempt to compile it yourself if you wish.  Beyond that, all I can do is assure you it is not attempting anything malicious.

Do I need to keep this on my computer?

Nope.  It uses Windows functions to create the junction.  Once you are done with it, you don't need it unless you create a new game and/or new install that you want to link.

Instructions

  1. DJC will not delete or overwrite any existing folder structure or existing directory junctions for your protection.  Preparation must be done manually.  Browse to your KSP installation folder and open the 'saves' subfolder.  You will need to open each of the save game folders you wish to junction and remove the 'Subassemblies', 'Ships\VAB' and 'Ships\SPH' folder (do not remove the 'Ships' folder).  You may delete them if they contain nothing of value, otherwise it would be best to simply relocate them temporarily.
  2. Launch DJC and select the KSP installation folder by clicking the folder icon.  DJC will attempt to find this automatically from common locations (Steam and Non-Steam versions) but if you have moved it elsewhere you may have to do this manually.
  3. Choose the location you wish to store the craft files.  Locations with existing files are permitted, DJC will not destroy them.
  4. Click the Link icon next to each of the craft type you wish to junction.

PgKrDAO.png

At this point DJC will parse through each of the save game files (scenarios and training will be ignored) and create a junction for any missing locations.  At any time you create a new game you may repeat the process (only on the new save game) to have immediate access to your craft. 

Download from Github
Source Code

License
 -Application & Source: MIT
 -Icons & Images: Free for Non-Commercial Use.  Recommend obtaining them from IconArchive.com rather than this program.

Edited by Alshain
Link to comment
Share on other sites

Thanks - I had been doing this manually!  I also do the same for the CKAN downloads - otherwise its duplicated in every install directory. 

I keep multiple installs - I always have my current career with which I use a script (and git) to track my main career save file and all the .cfg files in case I break it, a "experimental" (a clean install to try out new addons or bug check), and "testing" (to test addons with my current set of addons, and career save, to make sure they don't break each other) and "upgrade" when there is a new release.  So right now, I have 1.2.2 in my career, 1.2.2 in my experimental, and 1.2.2 in my testing, and 1.3.0 in my upgraded.  Once I am satisfied that I have enough of the addons working where I am happy with things, my "career" directory is renamed  "old" (currently 1.2.1), my upgrade becomes "testing", "experimental" is scratch reinstalled, and I do a clean reinstall to my "career" game (and scratch reinstalling all my addons, then restoring saves, crafts, mod configs and mod data files from backup).   I have scripts that handle all that, so if I want my old 0.90 with its saves and addons, I can actually restore it from backups.

The only problem you may run into are mods that install "example" craft in the SPH/VAB - that kills CKAN with a conflict due to overwriting those ships.  I'm going to work up a bug report/feature request with CKAN to fix that.

Link to comment
Share on other sites

@Murdabenne I'm glad you like it.  I hadn't originally considered multiple installs, just multiple save games... but I think if I were to support multiple installs fully I could add a junction to the thumbs folder and a symlink to the subassemblies custom groups file. Maybe screenshots might be nice too.

I'm don't use CKAN myself but I'm not sure mods are in the same scenario in that case, since multiple installs are often different versions.  Or the mods themselves are the reason to have multiple installs.  You seem to have a very specific setup there.

Link to comment
Share on other sites

  • 1 month later...
  • 2 years later...

Okay, this is great. Not sure how well it would play with Game Data Switcher (since it does directory renames). I'll see what it can do.

Also, I'd apologize for the necro, but with KSP there are often months or years of lag between engagements, and 2017 is basically "last month" :)

Edited by Beetlecat
Link to comment
Share on other sites

I have been using a simple right click utility (s.i.c.)

 

On 8/4/2019 at 9:37 PM, zer0Kerbal said:

@Beetlecat

found a nice little mklink gui here ( Last Updated July 26 2019, Version 3.9.2.5 )

also - should be using /j (junction) instead of /d

it has been updated to Last Updated January 26 2020, Version 3.9.3.3

Edited by zer0Kerbal
Link to comment
Share on other sites

  • 2 years later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...