-
Notifications
You must be signed in to change notification settings - Fork 342
[Enhancement] Use custom \bin\ folder #217
Comments
I noticed that the CreatePackages wiki* specifically mentions using the %chocolatey_bin_root% environment variable as installation path under Installation paths -> 1. %chocolatey_bin_root% environment variable, but this variable is empty. *) https://github.com/chocolatey/chocolatey/wiki/CreatePackages |
It also mentions where the ruby package installs if it has not been set. |
You are right, but what I mean is: You are advised (by the docs) to pass the variable to the (random) installer if it is supported. But the path is empty by default. Which means you will be explicitly passing an empty path to the (random) installer and who knows how it will be interpreted. My first thought is that My second thought is that the current solution is to check if But wouldn't it be more logical to have the installer set a default value, rather than have 500+ packages perform this check? If not, we should add a comment about checking the var in the docs so it isn't ambiguous. |
Added "Please note that this variable is empty by default, and needs to be explicitly set by the user. Before installing to %chocolatey_bin_root%, your installation script should check if this variable is not empty." to wiki. |
As far as a default value, I agree - #190 |
And the addition of Install-ChocolateyTool (with some parameters) that does all of this magical work for you. :D Just added for tracking - #221 |
I have the feeling that people who are not working on the code but do care about packages and documentation miss out on the good stuff. :P However, there is no such file in functions: https://github.com/chocolatey/chocolatey/tree/master/src/functions I want to see if it will daisychain with Install-ChocolateyZipPackage (or maybe is does that automatically). |
Ah now I see.. the function doesn't exist yet. I'm slow. :P |
We do try to keep the documentation updated with the things that exist or are in the code base but have not yet been released. |
I'd like to reference this post about env vars and finding the bin path as it is closely related to this issue: Quote: Is function Get-BinPath {
# Calculate $binRoot, which imo should always be set in $env:chocolatey_bin_root as a full path (not relative)
if($env:chocolatey_bin_root -eq $null) {
$binRoot = "$env:ChocolateyInstall\bin"
}
# My chocolatey_bin_root is C:\Common\bin, but looking at other packages, not everyone assumes chocolatey_bin_root is prepended with a drive letter.
elseIf (-not($env:chocolatey_bin_root -imatch "^\w:")) {
# Add drive letter
$binRoot = join-path $env:systemdrive $env:chocolatey_bin_root
}
else {
$binRoot = $env:chocolatey_bin_root
}
return $binRoot
} |
If the Chocolatey installer would set These are just thoughts based on things I found confusing as a new user. |
( Split from #215 )
Using the Install-ChocolateyZipPackage command, all .exe files within the .zip file will be installed in it's respective package folder inside **\Chocolatey\lib**; and the executable will be linked in the form of a .bat file in the *\Chocolatey\bin* directory, unless there is an empty .exe.ignore file present to signal the installer not to do this.
I would like to use 'my' bin-folder for this. I have my own bin folder where I copy .exe's that are not provided with packages, and that I sync* to my other computers.
Is this possible? Is there a chocolatey configuration file? Is this what the chocolatey_bin_root environment var that I read about in someone's package does? Do we need to set it up manually?
*) Because of this (and other reasons), some users prefer .exe files copied to the binary folder in stead of being linked with .bat files. See Issue #216
The text was updated successfully, but these errors were encountered: