Jump to content

Tricks Using Symbolic Links


venkman781

Recommended Posts

Starting a thread for this, as it seems important enough to hijack other threads (thanks frihyland) ...

 

Let's talk about some of the uses of symbolic links in manipulating apps to do what you want rather without them being any the wiser!

 


Is there any way to get WB to install files/folders to the root Skyrim directory? I'm trying to install RCRN 2.1 using it, but can't seem to get the shaders folder and other files to install there.

Link to comment
Share on other sites

  • Replies 42
  • Created
  • Last Reply

Top Posters In This Topic

AFAIK, Wrye won't handle anything in the root directory. You could do it by using junction points to create a redirected folder in the data directory, but as RCRN is a bit of a special case anyway, I'm not sure it's worth the bother. This little app is quite handy for messing about with junctions, if you want to: https://www.rekenwonder.com/linkmagic.htm

 

The textures, I believe, are just some less reflective snow, and the esp I let BOSS order for me. If you want to keep things as clean as possible, you could just put the esp and textures in an archive for Wrye, and place the dll and shaders in the root by hand - it's easy to remove those manually if you don't like it.

 

EDIT: BTW - it's all gone batsh1t crazy over in the RCRN forum - a war of the shader programmers! I'm not going anywhere near it :lol:

Link to comment
Share on other sites

a great shell app for junctions, hardlinks and symbolic links is "Link Shell Extender"

 

It should be pretty simple to add py script to let WB install to skyrim/ (maybe a context-menu option?)

 

I wonder if that is not a feature that they plan on adding?? Maybe something to add to the dev wish list?

Link to comment
Share on other sites

I was able to assemble a simple archive out of the textures and the .esp, then dropped the other files into \skyrim by hand. Easy enough.

 

I'm really not sure what advantage a symbolic link has - I'm not really sure I understand what they are or what they do. My google results only confused me further!

Link to comment
Share on other sites

Symlinks and junctions are all similar ideas. They're a bit like wormholes - you can place folder in one sub directory, but it actually leads to a different place. You could make a junction folder in 'Data' called 'Root', that actually leads to the main skyrim game directory. In this way, you could trick Wrye in to managing those top level files too.

Link to comment
Share on other sites

@Bealdwine You should try asking in the Wrye Bash thread. I'm sure someone there would know. I would like to know the answer to that too.

 

Edit: Refer to the post above. Frihyland posted it the same time I posted this... weird.

 

About tricking Wrye to install in main skyrim game directory, will it work if you added /Data/Root to actually point into the main Skyrim game directory (as suggested by MontyMM), put a folder named 'Root' in a BAIN arhcive, put files that need installing in the main skyrim directory like RCRN inside it, tick has extra directories, then install?

 

I was unable to get this to work... something about recursive links..

Link to comment
Share on other sites

Rats. You're right. You can't create junctions from a subfolder to its parent. I think that's what it means by 'recursive links' - you'd be creating an infinite regression.

 

I've used junctions for redirecting installed apps I moved to my SSD, which works great, but the sub directory problem didn't occur to me. Time to think again...

Link to comment
Share on other sites

Junctions bad. Symbolic links good.

 

In all seriousness, Junctions should be avoided. They can cause more problems than you think they solve. In regards to what you are trying to do, they can still be created manually (LSE is doing a good job of preventing a very large problem), but especially in this case symbolic links are loads safer (though can still cause some issues in certain scenarios).

 

In this case, DO NOT USE A JUNCTION. You will get endless recursion.

 

To make a soft link, you will need to run 'cmd' as administrator, then cd into your Skyrim\Data\ folder. Then just do the following:

 

mklink /D root ..\..\Skyrim
Link to comment
Share on other sites

@s4n I don't get it. Symbolic links and junctions do the same thing. They would still create an infinite regression since you're still linking a sub-folder to a folder that contains it.

 

And what's wrong with an infinite regression? Of course that would happen since you're linking a sub-folder to a folder that contains that sub-folder. Only natural. Doesn't mean it shouldn't work. And aside from that, what other issues are you talking about?

Link to comment
Share on other sites

@jomelsontanco

Symbolic links and junctions are different. First, a description of links and junctions.

 

Symbolic Link - A file that contains a reference by name to the target directory or file. If you remove the target, the link remains, but no longer references anything. Restore the target and the link works again. Being it's own file, it also has it's own properties and does not reveal the properties of the target (file size, permissions, etc.). Since the reference is by name, symbolic links can point to any file that is accessible, local or remote.

 

Hard Link - Essentially a label in a volume TOC that points to the first data block of a file that contains information about the target file (can only be created on files). This allows the hard link to look like the target file in every way, including its properties. Edit a hard link or the target, and both see the change, and this includes permissions as well. When a hard link is created, a link counter is incremented in the data portion of the file descriptor. This allows you to delete the target file (which decrements the link counter), and the hard link still looks like the original file. When using hard links, the file descriptor is only released by the filesystem when the link counter reaches 0 (target and all hard links have been removed). Hard links can only be used on the same volume and can not span to other volumes or remote shares.

 

Junctions - This is a hybrid link, only usable on directories. On the surface they behave like a symbolic link, in that they can span volumes. In every other regard, they act like a hard link. This means you can create a junction from one volume to another, and you can also get the properties on the target directory like file size, permissions, etc. Although you can change permissions on the target and the junction will reflect it, due to its symbolic link nature, if you change the permissions on the junction, they are not reflected on the target. Junctions can only be used on the local system and can not span remote shares.

 

Why are Junctions more dangerous and symbolic links safer? Directory Enumeration. Although junctions act like a symbolic link, due to the hard link nature of them, they are enumerated as directories. A symbolic link is a file, and will be enumerated as a file. Junctions can cause all sorts of odd behavior with Indexing Service, Backups, any program that needs to do file system searches, and anything that needs to enumerate directories. Especially when creating a loop as in the case above, you have a very serious problem waiting to explode.

 

To get a handle on this visually, you can do the following:

1) Create a directory structure somewhere, I'll use e:\test\data as an example.

2) Create a Junction as e:\test\data\root that points to e:\test

3) Place some txt files wherever you want under e:\test

4) Do a search for .txt and Explorer will start repeating the list of txt files, continuously adding the 'root' directory to the end. Thanfully, Explorer will eventually give up.

5) Remove the junction and create a symbolic link instead e:\test\data\root -> e:\test

6) Do a search for .txt and Explorer will only return the txt files you created and stop.

 

If you switched from XP to Vista, ever notice that some directories that were available in XP were not accessible but still there? Through their constant changing of the profile area for users, they created Junctions so that legacy programs could still reference files and directories in the users profile directory if they hard coded the path. They also changed the permissions on the Junction themselves to deny List Folder/Read Data access to everyone so that the directory could not be enumerated.

 

Bottom line, symbolic links are much safer.

Link to comment
Share on other sites

Junctions bad. Symbolic links good.

 

In all seriousness, Junctions should be avoided. They can cause more problems than you think they solve. In regards to what you are trying to do, they can still be created manually (LSE is doing a good job of preventing a very large problem), but especially in this case symbolic links are loads safer (though can still cause some issues in certain scenarios).

 

In this case, DO NOT USE A JUNCTION. You will get endless recursion.

 

To make a soft link, you will need to run 'cmd' as administrator, then cd into your Skyrim\Data\ folder. Then just do the following:

 

mklink /D root ..\..\Skyrim

 

 

I knew how to do it in CMD, been doing it since Vista, but I figured if the GUI wouldn't do it...... So thanks for that.. Works BEAUTIFULLY.. I repackaged RCRN into subpackages and moved the files in that packaging a new directory called Root, re-packed, told WB it had additional directories and I was off to the races..!

Link to comment
Share on other sites

 

Junctions bad. Symbolic links good.

 

In all seriousness, Junctions should be avoided. They can cause more problems than you think they solve. In regards to what you are trying to do, they can still be created manually (LSE is doing a good job of preventing a very large problem), but especially in this case symbolic links are loads safer (though can still cause some issues in certain scenarios).

 

In this case, DO NOT USE A JUNCTION. You will get endless recursion.

 

To make a soft link, you will need to run 'cmd' as administrator, then cd into your Skyrim\Data\ folder. Then just do the following:

 

mklink /D root ..\..\Skyrim

 

 

I knew how to do it in CMD, been doing it since Vista, but I figured if the GUI wouldn't do it...... So thanks for that.. Works BEAUTIFULLY.. I repackaged RCRN into subpackages and moved the files in that packaging a new directory called Root, re-packed, told WB it had additional directories and I was off to the races..!

 

Back from the races :(

 

Bad idea.. bad... I restarted WB just a while ago and when it did it's scan, it was doing recursive scans through root.... over.. and.. over.. again. I stopped it when I noticed it and it had a path like root/data/root/data/root/data/root/data/root/data.... Bad bad idea..

Link to comment
Share on other sites

Back from the races :(

 

Bad idea.. bad... I restarted WB just a while ago and when it did it's scan, it was doing recursive scans through root.... over.. and.. over.. again. I stopped it when I noticed it and it had a path like root/data/root/data/root/data/root/data/root/data.... Bad bad idea..

 

I wonder how WB is scanning. Being that it's Python may have something to do with it since it's probably POSIX compliant.

 

EDIT: I messed up. Remove the "/D" option and you will be good to go.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines, Privacy Policy, and Terms of Use.