|
|
|
|
|
by yokohummer7
3359 days ago
|
|
> Why in the design of Windows aren't programs installed or symlinked in the PATH by default? I guess that was a design choice somewhere along the history of Windows/DOS. Is there a reason? Windows' way of program executable placement is using the holy Registry. It's called 'Application Registration'[1] and was introduced to reduce the needs to modify the system-wide PATH variable. (They thought it was a bad idea to modify a system variable so frequently, and I partially agree.) You can find registered applications in `HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths`. Very few programs use that feature, which is unfortunate, but popular applications like Chrome and Firefox register themselves in it. That's why you can invoke `chrome` in the 'Run' dialog. Edit: Another context to add: at the time App Paths was added, to modify PATH you had to edit AUTOEXEC.BAT manually which was painful. Not only that, but also PATH had a length limitation of 128 characters. You can find more details in the Raymond Chen's blog, as useful as always.[2] [1] https://msdn.microsoft.com/en-us/library/windows/desktop/ee8... [2] https://blogs.msdn.microsoft.com/oldnewthing/20110725-00/?p=... |
|
I should note there are still length limits - in practice you'll run into issues with as few as 2047 characters:
https://support.microsoft.com/en-us/help/830473/command-prom...
Debugging this is really annoying, as one of my coworkers found out when one too many applications decided to add multiple paths to PATH (for example, nVidia CodeWorks has added no less than 8 subdirectories of C:\NVPACK\ to PATH to support Android development - for gradle, ant, jdk, ndk, and the android SDK's support, build-tools, platform-tools, and regular tools.)
Said coworker ended up spending some time using directory junctions to shorten the paths in PATH to the point where his dev environment was useful again.