Files
ChocolateyPackages/ToolsRoot/tools/chocolateyInstall.ps1
2012-12-03 14:31:12 -05:00

23 lines
521 B
PowerShell

$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
}