-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
Option to clone smaller instances with junction points (Windows) or symbolic links (Unix) #4129
Conversation
Hey @ProgrammerFailure, this is the pull request for cloning with symlinks. You can click the Checks tab, then the Artifacts dropdown, to download a test build with the "Share stock files" checkbox in the cloning window: I've only tested it on Linux so far, so it needs to go for a test drive on Windows before merge. If you have a chance, please try it out and let us know if you see any issues. Thanks! |
Hey, this didn't actually create the symlinks for me. As expected, stock files weren't copied, but symlinks also weren't created. Tested with three preexisting CKAN instances, one mod-free, one dev install, and one heavily modded game. No symlinks for Squad were created. I used the CKAN you provided, clicked share stock files, and cloned an instance to no effect. I also had to disable the windows batac warning. |
Windows 11, if that helps |
This comment was marked as resolved.
This comment was marked as resolved.
No problem, still looking forward to it. |
This comment was marked as resolved.
This comment was marked as resolved.
I can confirm it works with asroot. CKAN could request admin or just make a bat file and tell the user to run it? |
This comment was marked as resolved.
This comment was marked as resolved.
For what its worth, I'm fine with granting CKAN admin once per clone operation, and considering it saves 5-6 GB, I imagine others will be too. |
This comment was marked as resolved.
This comment was marked as resolved.
True. Plus, I suppose there are still people without admin access to their system? What do you mean by discoverability? |
CKAN actually tries very hard to make sure that it’s NOT running as admin. This causes countless problems with users who run elevated all the time. No one understands this stuff. There’s gotta be a way you can request UAC elevation? I’m kinda surprised that CKAN wouldn’t have that permission level considering that it just created the directories, right? Maybe there’s some option for setting the permission when creating. Or can the clone be created elsewhere and then moved into position? |
Oh interesting, you have to start a new process: https://stackoverflow.com/a/573150 Maybe just run console ckan with all the parameters and —as root? |
This comment was marked as resolved.
This comment was marked as resolved.
No, I am not. Should I test with it enabled? The article mentions developing with VS. I am doing this, but it's just a plugin, not an app. |
This comment was marked as resolved.
This comment was marked as resolved.
9ac3782
to
e9327cb
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
e9327cb
to
dfc3718
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
dfc3718
to
f41e41d
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Just realized something: I never actually use symlinks on windows when setting up references; I use junctions ( https://stackoverflow.com/questions/3615129/how-to-create-a-junction-point-using-winapi |
@JonnyOThan, thanks for the idea! That does indeed look like the better approach on Windows. We're only making symlinks to the absolute paths of directories, so the only difference for us would be the security stuff. |
This comment was marked as resolved.
This comment was marked as resolved.
I'm like 90% sure they can...I recall doing that at a previous job. |
@HebaruSan yes they do. It's how I used to point some games on a different drive when stream didn't support install locations. I've probably still got the PowerShell script for the task somewhere. |
This comment was marked as resolved.
This comment was marked as resolved.
2e17c1c
to
b59f983
Compare
I think the problems I was having were caused by thinking that
Should be a lot more useful now that all that security craziness is gone. I'll probably merge this version unless I or anyone else finds an issue shortly. |
adcc369
to
2912a21
Compare
2912a21
to
6c1ceff
Compare
6c1ceff
to
46193fe
Compare
46193fe
to
87e5efa
Compare
I wanted to download this but it says that these artifacts have expired. Is there any way to access it without building CKAN myself? |
@ProgrammerFailure yes, you can try the dev build here: |
Thanks! Will that link always go to the current dev build? |
Yup, it gets built and replaced every time we merge something to the master branch. |
On trying to make a symlinked instance, I get this error:
And it doesn't make the instance. Did I mess up something? Reputation based protection is disabled. |
Nope, an unrelated bug caused by a later change is causing the "copy from" instance's path to not fill in to this box: I just pushed a fix for this, which our GitHub workflows will process and eventually generate a new dev build, which the previous dev build should prompt you to install when you launch once it's ready. Thanks for catching that! |
I'm now getting this error:
|
Latest dev version, and the box does get autofilled |
Thanks again, found and fixed another recent issue with that popup. |
Background
It's common for users to make extra copies of KSP1 so they can install different mod lists in each one. CKAN supports this by tracking multiple instances and providing a clone operation, which copies an existing instance to a new folder and adds it to CKAN.
Motivation
Changes
ckan instance clone --share-stock
or a new "Share stock files" checkbox in GUI:which is done by making junction points (Windows) or symbolic links (Unix) for the following directories instead of copying them:
KSP_x64_Data
(the main stock game contents folder)KSP_Data
(same but on Linux)GameData/Squad
GameData/SquadExpansion
CKAN/history
(old mod lists)CKAN/downloads
(deprecated but might still contain files in very old instances)saves
Screenshots
thumbs
Missions
Logs
This will allow the creation of game instances that are much smaller but still playable (a thin clone of my Steam instance shrinks from 7 GiB to 81 MiB, or about 1% of its original size, and is very quick to generate).
Note that the CKAN registry and the currently installed mods will still be copied across, so users will still be able to set up some mods in one instance and then clone them elsewhere as a starting point for a different mod list.
Fixes #4087.