# I wish to replicate /usr/local/bin on Windows



## Rastko (Dec 22, 2018)

I have lots of "no-install" software on Windows, and wish to centralize the location of the binaries, but I am faced with a conundrum.

As opposed to BSD and other UNIX-like systems, Windows expects main package binaries, supporting binaries, libraries and config files in a single location/directory, which makes dispersing the binaries around nearly impossible. On the other hand, it seems quite unnatural to add every "no-install" location to the executable path.

How does BSD achieves it? I know a lot of "bin" files are actually shell scripts, or symbolic links to such and such, but there seems to be more to it than meets the eye.


----------



## Beastie (Dec 22, 2018)

Rastko said:


> As opposed to BSD and other UNIX-like systems, Windows expects main package binaries, supporting binaries, libraries and config files in a single location/directory


That's only partially accurate. While most programs will have a bunch of .DLLs sitting along with the main .EXE each in their own subdirectory under %ProgramFiles% (or %ProgramFiles(x86)%), settings are always expected to be stored under %AppData% (or the HKCU registry hive). Only older programs - or badly-designed ones - will break this rule. Also a lot of general-purpose libraries will go into %SystemRoot%\SysWOW64 and %SystemRoot%\System32. And ProgramData bears a similarity to /var.
While all this is not always the case, nowadays filesystem hierarchy is less of a mess than it used to be in the Windows 9x era.



Rastko said:


> How does BSD achieves it?


Very easily by having 1) a clearly-defined filesystem hierarchy, 2) configuring software at build-time to be standard-compliant, and 3) providing appropriate patches for the not-so-well-behaved ones (e.g. hardcoded Linux-specific paths).

Windows simply has a different way of storing things and you have to live with it.


----------

