Add ToolsRoot so Chocolatey_Bin_Root is \tools
This commit is contained in:
22
ToolsRoot/tools/chocolateyInstall.ps1
Normal file
22
ToolsRoot/tools/chocolateyInstall.ps1
Normal 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
|
||||
}
|
Reference in New Issue
Block a user