-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: User binary dir #331
Comments
For some additional context, a default Windows 11 24H2 installation has five paths in the PATH environment variable. These are from Windows Sandbox:
The first four are on the system-wide PATH, and the last one in the user-specific environment variables. For hopefully obvious reasons I'd advise against using the first four for anything unless you happened to be a Microsoft employee. However, I'm not entirely convinced that last one would be suitable for this purpose, either. Based on other discussion regarding it it seems in order to actually make use of it you'd have to be editing registry keys, and it wouldn't be as simple as chucking a symlink there and calling it a day. So in other words I don't think Windows actually has a perfectly matching equivalent for this particular XDG recommendation. Feel free to prove me wrong, though. |
I was able to build this solution that works in both LInux and Windows - on Windows I'm using that directory. However, I found it impractical to use symlinks (in Windows) because they require admin permissions, which I was trying to avoid. Instead what I did was drop a batch file that simply runs my program. This seems to work great, I've so far not had any reported issues with this setup and it doesn't require any special permissions or configurations. Granted, my use case may not be very common, but I'd certainly recommend this as an easy way to make sure your program ends up in PATH. |
Many platforms have a directory for user binaries that is already part of the PATH. This is useful when your application wants to set up some helper utilities by symlinking them in so they're easily accessible.
For example, the XDG specification states:
Although it doesn't provide an env var for this directory, for some reason.
On Windows I believe an equivalent directory would be
%UserProfile%\AppData\Local\Microsoft\WindowsApps
The text was updated successfully, but these errors were encountered: