1

On linux, it's very common that during the installation of some application, it is created a symbolic link to it's executables in /usr/bin so they would be in the system's PATH variable.

On the other hand, on Windows, most applications will concatenate it's own installation path to the PATH environment variable during it's installation, which lead to a few problems which are not part of this question's scope.

I see the folder C:\Windows\System32 to have a somewhat similar role to /usr/bin, as both are part of the standard PATH variable in both systems, so why isn't it a common practice to symlink executables to C:\Windows\System32?

2

2 Answers 2

5

Because the PATH environment variable predates the symbolic link feature by two decades. The equivalent of symbolic links as you see in Linux was introduced in 2006 with Windows Vista. The PATH variable has existed since 1986.

To turn away from a 20-years-old approach towards a new one, developers need one hell of a good reason that outweighs the disadvantages of creating symbolic links in System32:

  • Doing so needs administrative privileges.
  • One symbolic link must be created for each .exe file.
  • Installers and uninstallers must create and destroy them. If the developer ever changes the name of its .exe file, he must write a routine to check for old symbolic links and update them.
  • Bearing all the above in mind, if two apps turn out to have similarly named .exe files, we will be having a "Symbolic link hell" in addition to the "DLL hell". Isn't one hell enough already?
  • The result is always per-machine (not per-user or per-process).

Meanwhile:

  • Not many apps use the PATH variable anyway. Most apps are GUI apps that install their shortcuts into the Start menu and that their main avenue of execution.
  • The PATH variable can be customized on a per-machine, per-user and even per-process basis. In fact, some apps like Visual Studio have customized Command Prompts with customized per-process PATH variable only for that instance.
1
  • Last part there is the most relevant. Most programs today don't use or need PATH. Some file managers may be an exception.
    – Overmind
    Mar 10, 2017 at 13:30
0

The question is pretty broad and I'm not not sure it'll survive but the obvious answer is that System32 is not at all similar to /usr/bin. You said they play a similar role, but that doesn't make it true. The mere fact that they are both part of the system path doesn't mean they have similar roles.

If anything, System32 is more similar /sbin which is also part of the default system path on Linux. The comparison is far from perfect though as these are very different operating systems.

Is it common practice to put symbolic links to general user-installed programs in /sbin?

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