1

I'd like to add Windows support to a language version manager I use.

In its current macOS-and-Linux-only form, the manager downloads a few key language binaries/executables (compiler, linter, etc) to its own folder, with a subfolder for each version (manager/1.1/, manager/1.2/, and so on). When you run manager use 1.1 or manager use 1.2, it symlinks /usr/local/bin/language to the relevant folder.

Windows doesn't let you symlink without administrator privileges. Fair enough, I figure, I'll just copy the binaries directly. And that's where I'm at now: I'd like to copy these binaries into some equivalent of /usr/local/bin, somewhere user-accessible on the PATH. But my knowledge of Windows isn't deep enough to know whether this is possible and my googling hasn't turned up anything either. The PATH variable sharing a name with a fundamental filesystem feature kind of muddies searches up.

Big thanks to anyone who can offer me a tip here.

1 Answer 1

3

There are several ways to set the PATH on Windows. The easiest ones are explained in this SO answer.

  • Add the path to My Computer->Properties->Advanced->Environment Variables->Path
  • Use set PATH="%PATH%;C:\NewPath" setting the PATH for this session
  • Use setx PATH "%PATH%;C:\NewPath" setting the PATH for all sessions of this user in the future
  • Use setx /M PATH "%PATH%;C:\NewPath" setting the PATH for all sessions of all users machine-wide in the future
  • Modifiy the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path and add C:\NewPath
  • Use the Environment.SetEnvironmentVariable .NET Windows Method to modify the registry key
  • Use PowerShell to modify it permanently

Disclaimer: I haven't tested which of these approaches require admin priviledges.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .