update boost toolset and notes, remove BOOST_ROOT

This commit is contained in:
Aleksandr Chebotov
2020-03-17 09:47:22 +03:00
parent 8254ea02af
commit 80449e25a0
52 changed files with 728 additions and 864 deletions

View File

@@ -161,7 +161,94 @@ Hashtable for service arguments
}
}
function Get-VS19ExtensionVersion
function Install-VsixExtension
{
Param
(
[string] $Url,
[Parameter(Mandatory = $true)]
[string] $Name,
[string] $FilePath,
[Parameter(Mandatory = $true)]
[string] $VSversion,
[int] $retries = 20,
[switch] $InstallOnly
)
if (!$InstallOnly)
{
$FilePath = "${env:Temp}\$Name"
while($retries -gt 0)
{
try
{
Write-Host "Downloading $Name..."
(New-Object System.Net.WebClient).DownloadFile($Url, $FilePath)
break
}
catch
{
Write-Host "There is an error during $Name downloading"
$_
$retries--
if ($retries -eq 0)
{
Write-Host "File can't be downloaded"
$_
exit 1
}
Write-Host "Waiting 30 seconds before retrying. Retries left: $retries"
Start-Sleep -Seconds 30
}
}
}
$ArgumentList = ('/quiet', "`"$FilePath`"")
Write-Host "Starting Install $Name..."
try
{
#There are 2 types of packages at the moment - exe and vsix
if ($Name -match "vsix")
{
$process = Start-Process -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\$VSversion\Enterprise\Common7\IDE\VSIXInstaller.exe" -ArgumentList $ArgumentList -Wait -PassThru
}
else
{
$process = Start-Process -FilePath ${env:Temp}\$Name /Q -Wait -PassThru
}
}
catch
{
Write-Host "There is an error during $Name installation"
$_
exit 1
}
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 1001) # 1001 means the extension is already installed
{
Write-Host "$Name installed successfully"
}
else
{
Write-Host "Unsuccessful exit code returned by the installation process: $exitCode."
exit 1
}
#Cleanup downloaded installation files
if (!$InstallOnly)
{
Remove-Item -Force -Confirm:$false $FilePath
}
}
function Get-VSExtensionVersion
{
param (
[string] [Parameter(Mandatory=$true)] $packageName
@@ -187,3 +274,41 @@ function Get-VS19ExtensionVersion
return $packageVersion
}
function Get-ToolcachePackages {
$toolcachePath = Join-Path $env:ROOT_FOLDER "toolcache.json"
Get-Content -Raw $toolcachePath | ConvertFrom-Json
}
function Get-ToolsByName {
param (
[Parameter(Mandatory = $True)]
[string]$SoftwareName
)
(Get-ToolcachePackages).PSObject.Properties | Where-Object { $_.Name -match $SoftwareName } | ForEach-Object {
$packageNameParts = $_.Name.Split("-")
[PSCustomObject] @{
ToolName = $packageNameParts[1]
Versions = $_.Value
Architecture = $packageNameParts[3,4] -join "-"
}
}
}
function Get-WinVersion
{
(Get-WmiObject -class Win32_OperatingSystem).Caption
}
function Test-IsWin19
{
(Get-WinVersion) -match "2019"
}
function Test-IsWin16
{
(Get-WinVersion) -match "2016"
}