RiskiVR/BSLegacyLauncher

Directory Junctions instead of symlinks, as they don't need admin privileges?

mrudat opened this issue · 3 comments

It is possible to create directory junction (a variant of symlink) as an unprivileged user... though you can't do it using the core .net libraries.

You can create a directory junction using the MKLINK command (explicitly cmd.exe, and not from powershell):

C:\>mklink /?
Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target

        /D      Creates a directory symbolic link.  Default is a file
                symbolic link.
        /H      Creates a hard link instead of a symbolic link.
        /J      Creates a Directory Junction.
        Link    Specifies the new symbolic link name.
        Target  Specifies the path (relative or absolute) that the new link
                refers to.

Or, perhaps more helpfully, someone's put together something for Manipulating NTFS Junction Points in NET.

As an example, before support was added for downloading multiple versions of Beat Saber from within BSLegacyLauncher, I ran an older version of this script to link custom content in my steam Beat Saber install into the various copies of BSLegacyLauncher, and copy latest plugins from the steam install to the most recently installed copy of Beat Saber.

I'm going to rewrite it to work with the new install locations, but notably, it does not need to run with administrator privileges. Never mind; that was easy.

Sounds great, I'll try it once I get to it

Added to v1.5.4