Add ToolsRoot so Chocolatey_Bin_Root is \tools

This commit is contained in:
Iristyle
2012-12-03 14:31:12 -05:00
parent ddbf24cbf7
commit 7a84f6df89
3 changed files with 64 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
$packageName = 'ToolsRoot'
try
{
$variableName = 'Chocolatey_Bin_Root'
if (!(Get-Item Env:$variableName -ErrorAction SilentlyContinue))
{
$path = '\tools'
[Environment]::SetEnvironmentVariable($variableName, $path, 'User')
Set-Item Env:$variableName $path
$binRoot = Join-Path $Env:SystemDrive $path
Write-Host "Configured $variableName as $binRoot"
}
Write-ChocolateySuccess $package
}
catch
{
Write-ChocolateyFailure $package "$($_.Exception.Message)"
throw
}