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

[Bug]: Copying an install which had the stock files shared results in error when trying to run #4296

Closed
1 task done
linuxgurugamer opened this issue Feb 6, 2025 · 3 comments · Fixed by #4297
Closed
1 task done
Labels
Support Issues that are support requests Windows Issues specific for Windows

Comments

@linuxgurugamer
Copy link
Contributor

Is there an existing issue for this?

  • I have checked the existing issues for an existing issue. I even actually looked at the ones that are pinned to the top!

Operating System

Windows 10

CKAN Version

v1.35.2.24280

Games

KSP 1

Game Version

1.12.5

Did you make any manual changes to your game folder (i.e., not via CKAN)?

No response

Describe the bug

I cloned an install which had been previously cloned. The new clone had an invalid KSP_x64_Data directory

Image

Looking at the directory in Explorer gets the following error:

Image

Steps to reproduce

Clone an install which was already a clone, using the option to share stock files
Try to run the game.
Try to look in the directory

Relevant log output

No response

@linuxgurugamer linuxgurugamer added the Bug Something is not working as intended label Feb 6, 2025
@HebaruSan
Copy link
Member

What are the full paths of the three folders?

@HebaruSan HebaruSan added Support Issues that are support requests Windows Issues specific for Windows and removed Bug Something is not working as intended labels Feb 6, 2025
@linuxgurugamer
Copy link
Contributor Author

linuxgurugamer commented Feb 6, 2025

Original folder is: r:\KSP_1.12.5_Eye_Ear_Candy-2\KSP_x64_Data
First copy is: R:\KSP_1.12.5_Candy-Career\KSP_x64_Data
Second copy is: R:\KSP_1.12.5_Candy-Career-techno\KSP_x64_Data

I used the following command to examine the entries. The first copy looks like this:

R:\KSP_1.12.5_Candy-Career>fsutil reparsepoint query KSP_x64_Data
Reparse Tag Value : 0xa0000003
Tag value: Microsoft
Tag value: Name Surrogate
Tag value: Mount Point
Substitue Name offset: 0
Substitue Name length: 92
Print Name offset:     94
Print Name Length:     0
Substitute Name:       \??\r:\KSP_1.12.5_Eye_Ear_Candy-2\KSP_x64_Data

The second copy looks like this:

R:\KSP_1.12.5_Candy-Career-techno>fsutil reparsepoint query KSP_x64_Data
Reparse Tag Value : 0xa0000003
Tag value: Microsoft
Tag value: Name Surrogate
Tag value: Mount Point
Substitue Name offset: 0
Substitue Name length: 100
Print Name offset:     102
Print Name Length:     0
Substitute Name:       \??\\??\r:\KSP_1.12.5_Eye_Ear_Candy-2\KSP_x64_Data

It looks like the program is making a symlink of a symlink, and Windows doesn't seem to like that (see the Substitute Name for the second copy)

@HebaruSan
Copy link
Member

Thanks! So the part that tries to re-use the same original shared folder is working, but Windows is doing some weird stuff with the paths. We already have some parsing to remove \\?\ at the start:

target = junctionInfo.PathBuffer.TrimStart("\\\\?\\");

but apparently it can also be \??\ instead? Sorry, but sometimes I just have to laugh at the embarrassing joke that is Windows.

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 Windows Issues specific for Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants