Jump to content

Tricks Using Symbolic Links


venkman781

Recommended Posts

 

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.

 

Alright... I tried it and WB seems to be ok with that. Using the idea for RCRN, which puts files into the Skyrim directory. Repackaged with the Root/etc leaving Data as normal. Off to the races again!! Thanks Stop...

Link to comment
Share on other sites

  • Replies 42
  • Created
  • Last Reply

Top Posters In This Topic

When I do a fresh install and run through the WB guide, I'm going to set that up myself. Just made this .bat script and tested it out. Placed it in my Mopy directory, then made a shortcut of it and placed it in the Mopy\Apps directory and called it 'Toggle Softlink'. Set it to run as Administrator, now I have an application launcher in WB to toggle (remove or create) the softlink with a single click.

 

 

@echo on
setlocal ENABLEEXTENSIONS
set KEY_NAME=HKLM\Software\Wow6432Node\Bethesda Softworks\Skyrim
set VAL_NAME=Installed Path

for /F "tokens=3*" %%a in ('reg query "%KEY_NAME%" /v "%VAL_NAME%" 2^>nul ^| find "%VAL_NAME%"' ) do (
  set skyrimPath=%%b
)

if defined skyrimPath (
  @echo Skyrim Path = %skyrimPath%
) else (
  @echo Unable to determine Skyrim installation directory.
)

if EXIST %skyrimPath%\Data\root. (
del %skyrimPath%\Data\root
) else (
mklink %skyrimPath%\Data\root %skyrimPath%
)

 

Link to comment
Share on other sites

@s4n

 

So symbolic links are essentially shortcuts. But what happened to Faitmaker? He said that he is getting recursive scans through the .bat procedure you provided. You refer to it as a soft link but I assume that's the same as a symbolic link. But why is it causing recursive scans I thought only junctions do that?

Link to comment
Share on other sites

@jomelsontanco

Symbolic links in relation to files do appear to act like a shortcut, but they are still quite different. Symbolic links operate at the filesystem layer, and shortcuts operate at the application layer. Symbolic links do not have an actual file size. The file/directory they reference is in the data portion of the file descriptor. Consequently, shortcuts are a file that contain information about the target file/directory which takes up space and will eat up an entire block on disk. Shortcuts are also able to carry over icons from the target location, whereas symbolic links do not. In the case of directories, you are unable to change directories using a symbolic link, but you can use it to read/write/create files in the directory that it references. This is one thing that differs from how symbolic links work in UNIX/POSIX systems, where they can be just as troublesome as Junctions if used improperly.

 

In any case, I had messed up the command line by including the "/D" switch (which is equivalent to creating a Junction), which I later rectified. It should not be there for a true symbolic link, and it is now working for faitmaker.

Link to comment
Share on other sites

@jomelsontanco

In any case, I had messed up the command line by including the "/D" switch (which is equivalent to creating a Junction), which I later rectified. It should not be there for a true symbolic link, and it is now working for faitmaker.

 

And still working... like a champ.

 

I use the /d for any directory... Are you saying that I should drop it? I use SL most often for Dropbox.

Link to comment
Share on other sites

I created a softlink named root in my ..\common\skyrim folder and then packaged a small mod with a textures folder and a loose file (heythere.fx) as a 7z. The loose file ends up in the Data folder...how do I have to package it to get it into the Skyrim folder?? Do I need to put it into a folder named root or is there something I'm missing?

Link to comment
Share on other sites

 

@jomelsontanco

In any case, I had messed up the command line by including the "/D" switch (which is equivalent to creating a Junction), which I later rectified. It should not be there for a true symbolic link, and it is now working for faitmaker.

 

And still working... like a champ.

 

I use the /d for any directory... Are you saying that I should drop it? I use SL most often for Dropbox.

 

It's fine to use /D, just not in cases like the above where it creates a loop.
Link to comment
Share on other sites

I created a softlink named root in my ..\common\skyrim folder and then packaged a small mod with a textures folder and a loose file (heythere.fx) as a 7z. The loose file ends up in the Data folder...how do I have to package it to get it into the Skyrim folder?? Do I need to put it into a folder named root or is there something I'm missing?

 

The soft link needs to be in ..\common\skyrim\data pointing to the skyrim root folder. Then just create a root directory at the appropriate place in the archive containing the files you want installed in Skyrim root, i.e. alongside the textures\ folder in the archive.
Link to comment
Share on other sites

 

I created a softlink named root in my ..\common\skyrim folder and then packaged a small mod with a textures folder and a loose file (heythere.fx) as a 7z. The loose file ends up in the Data folder...how do I have to package it to get it into the Skyrim folder?? Do I need to put it into a folder named root or is there something I'm missing?

 

The soft link needs to be in ..\common\skyrim\data pointing to the skyrim root folder. Then just create a root directory at the appropriate place in the archive containing the files you want installed in Skyrim root, i.e. alongside the textures\ folder in the archive.

 

Huzzah! Thank you s4n! Nice 'n clean...

 

Edit - Spoke too soon. It seems that d3d9.dll with RCRN doesn't get recognized in the root folder of the package. Everything else worked as advertised.

Link to comment
Share on other sites

 

 

I created a softlink named root in my ..\common\skyrim folder and then packaged a small mod with a textures folder and a loose file (heythere.fx) as a 7z. The loose file ends up in the Data folder...how do I have to package it to get it into the Skyrim folder?? Do I need to put it into a folder named root or is there something I'm missing?

 

The soft link needs to be in ..\common\skyrim\data pointing to the skyrim root folder. Then just create a root directory at the appropriate place in the archive containing the files you want installed in Skyrim root, i.e. alongside the textures\ folder in the archive.

 

Huzzah! Thank you s4n! Nice 'n clean...

 

Edit - Spoke too soon. It seems that d3d9.dll with RCRN doesn't get recognized in the root folder of the package. Everything else worked as advertised.

 

 

That might be WB trying to keep you safe. I haven't tried this method yet. Hopefully faitmaker can report.
Link to comment
Share on other sites

  • 2 weeks later...

When I do a fresh install and run through the WB guide, I'm going to set that up myself. Just made this .bat script and tested it out. Placed it in my Mopy directory, then made a shortcut of it and placed it in the Mopy\Apps directory and called it 'Toggle Softlink'. Set it to run as Administrator, now I have an application launcher in WB to toggle (remove or create) the softlink with a single click.

 

 

@echo on
setlocal ENABLEEXTENSIONS
set KEY_NAME=HKLM\Software\Wow6432Node\Bethesda Softworks\Skyrim
set VAL_NAME=Installed Path

for /F "tokens=3*" %%a in ('reg query "%KEY_NAME%" /v "%VAL_NAME%" 2^>nul ^| find "%VAL_NAME%"' ) do (
  set skyrimPath=%%b
)

if defined skyrimPath (
  @echo Skyrim Path = %skyrimPath%
) else (
  @echo Unable to determine Skyrim installation directory.
)

if EXIST %skyrimPath%\Data\root. (
del %skyrimPath%\Data\root
) else (
mklink %skyrimPath%\Data\root %skyrimPath%
)

 

 

Bat does not work for me, as I have no reg key named "Skyrim" in the registry with "Install Path" value ... not anywhere.

 

Also, dll, dlx & asi logic in WB (Python version) is handled beginning @ line 7337 in bosh.py. I don't have the hours to spare sorting out the code though, but I hope that new releases allow installing these files when not located in SKSE\plugins or Data\Asi ... those are the only package locations that WB will recognize such files.

Link to comment
Share on other sites

What is going on with your computers? :P Second person to not have that key.

 

In any case, this will work. If it doesn't, your Steam installation is not correct.

 

softlink.bat:

 

 

@echo off
setlocal ENABLEEXTENSIONS
set STEAM32_KEY=HKLM\Software\Valve\Steam
set STEAM64_KEY=HKLM\Software\Wow6432Node\Valve\Steam
set VAL_NAME=InstallPath

for /F "tokens=2*" %%a in ('reg query "%STEAM32_KEY%" /v "%VAL_NAME%" 2^>nul ^| find "%VAL_NAME%"' ) do (
  set steamPath=%%b
)

if not defined steamPath (
  for /F "tokens=2*" %%a in ('reg query "%STEAM64_KEY%" /v "%VAL_NAME%" 2^>nul ^| find "%VAL_NAME%"' ) do (
	set steamPath=%%b
  )
)

if not defined steamPath (
  exit 1
) 

set skyrimPath=%steamPath%\steamapps\common\skyrim

if EXIST %skyrimPath%\Data\root. (
  del %skyrimPath%\Data\root
) else (
  mklink %skyrimPath%\Data\root %skyrimPath%
)

 

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.