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

@@ -44,6 +44,39 @@ Function NPMFeed-AuthSetup {
$npmrcContent | Out-File -FilePath "$($env:TEMP)/.npmrc" -Encoding utf8
}
Function Set-DefaultPythonVersion {
param(
[Parameter(Mandatory=$true)]
[System.Version] $Version,
[System.String] $Arch = "x64"
)
$pythonPath = $Env:AGENT_TOOLSDIRECTORY + "/Python/${Version}*/${Arch}"
$pythonDir = Get-Item -Path $pythonPath
Write-Host "Use Python ${Version} as a system Python"
Add-MachinePathItem -PathItem $pythonDir.FullName
Add-MachinePathItem -PathItem "$($pythonDir.FullName)\Scripts"
}
Function Set-DefaultRubyVersion {
param(
[Parameter(Mandatory=$true)]
[System.Version] $Version,
[System.String] $Arch = "x64"
)
$rubyPath = $Env:AGENT_TOOLSDIRECTORY + "/Ruby/${Version}*/${Arch}/bin"
$rubyDir = Get-Item -Path $rubyPath
Write-Host "Use Ruby ${Version} as a system Ruby"
Add-MachinePathItem -PathItem $rubyDir.FullName
# Update ruby gem to latest version
gem update --system
}
Import-Module -Name ImageHelpers -Force
$FeedPrefix = "https://npm.pkg.github.com"
$AccessToken = $env:GITHUB_FEED_TOKEN
@@ -71,7 +104,5 @@ $ToolVersions.PSObject.Properties | ForEach-Object {
}
}
#junction point from the previous Python2 directory to the toolcache Python2
Write-Host "Create symlink to Python2"
$python2Dir = (Get-Item -Path ($ToolsDirectory + '/Python/2.7*/x64')).FullName
cmd.exe /c mklink /d "C:\Python27amd64" "$python2Dir"
Set-DefaultPythonVersion -Version "3.7"
Set-DefaultRubyVersion -Version "2.5"

View File

@@ -4,8 +4,11 @@
## Desc: Install boost using tool cache
################################################################################
$BoostDirectory = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath "Boost"
$BoostVersions = $env:BOOST_VERSIONS.split(',')
Import-Module -Name ImageHelpers
$SoftwareName = "Boost"
$BoostDirectory = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath $SoftwareName
$BoostVersions = (Get-ToolsByName -SoftwareName $SoftwareName).Versions | Foreach-Object {"{0}.0" -f $_}
$BoostDefault = $env:BOOST_DEFAULT
foreach($BoostVersion in $BoostVersions)
@@ -20,7 +23,5 @@ foreach($BoostVersion in $BoostVersions)
Write-Host "Adding Boost $BoostVersion to the path..."
# Add the Boost binaries to the path
Add-MachinePathItem $BoostInstallationDir | Out-Null
# Set the BOOSTROOT environment variable
setx BOOST_ROOT $BoostInstallationDir /M | Out-Null
}
}

View File

@@ -8,6 +8,7 @@ Import-Module -Name ImageHelpers
# Install the latest version of Git which is bundled with Git LFS.
# See https://chocolatey.org/packages/git
choco install git -y --package-parameters="/GitAndUnixToolsOnPath /WindowsTerminal /NoShellIntegration"
choco install hub
# Disable GCM machine-wide
[Environment]::SetEnvironmentVariable("GCM_INTERACTIVE", "Never", [System.EnvironmentVariableTarget]::Machine)

View File

@@ -5,6 +5,7 @@
Import-Module -Name ImageHelpers -Force
$refsJson = Invoke-RestMethod "https://api.github.com/repos/golang/go/git/refs/tags"
function Install-GoVersion
{
Param
@@ -13,17 +14,20 @@ function Install-GoVersion
[Switch]$addToDefaultPath
)
$latestVersionObject = $refsJson | Where-Object { $_.ref -Match "refs/tags/go$goVersion[./d]*" } | Select-Object -Last 1
$latestVersion = $latestVersionObject.ref.replace('refs/tags/go','')
# Download the Go zip archive.
Write-Host "Downloading Go $goVersion..."
Write-Host "Downloading Go $latestVersion..."
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -UseBasicParsing -Uri "https://dl.google.com/go/go$goVersion.windows-amd64.zip" -OutFile go$goVersion.windows-amd64.zip
Invoke-WebRequest -UseBasicParsing -Uri "https://dl.google.com/go/go$latestVersion.windows-amd64.zip" -OutFile go$latestVersion.windows-amd64.zip
# Extract the zip archive. It contains a single directory named "go".
Write-Host "Extracting Go $goVersion..."
Expand-Archive -Path go$goVersion.windows-amd64.zip -DestinationPath "C:\" -Force
Write-Host "Extracting Go $latestVersion..."
Expand-Archive -Path go$latestVersion.windows-amd64.zip -DestinationPath "C:\" -Force
# Delete unnecessary files to conserve space
Write-Host "Cleaning directories of Go $goVersion..."
Write-Host "Cleaning directories of Go $latestVersion..."
if (Test-Path "C:\go\doc")
{
Remove-Item -Recurse -Force "C:\go\doc"
@@ -34,17 +38,17 @@ function Install-GoVersion
}
# Rename the extracted "go" directory to include the Go version number (to support side-by-side versions of Go).
$newDirName = "Go$goVersion"
$newDirName = "Go$latestVersion"
Rename-Item -path "C:\go" -newName $newDirName
# Delete the Go zip archive.
Write-Host "Deleting downloaded archive of Go $goVersion..."
Remove-Item go$goVersion.windows-a`md64.zip
Write-Host "Deleting downloaded archive of Go $latestVersion..."
Remove-Item go$latestVersion.windows-amd64.zip
# Make this the default version of Go?
if ($addToDefaultPath)
{
Write-Host "Adding Go $goVersion to the path..."
Write-Host "Adding Go $latestVersion to the path..."
# Add the Go binaries to the path.
Add-MachinePathItem "C:\$newDirName\bin" | Out-Null
# Set the GOROOT environment variable.
@@ -52,12 +56,12 @@ function Install-GoVersion
}
# Done
Write-Host "Done installing Go $goVersion."
Write-Host "Done installing Go $latestVersion."
return "C:\$newDirName"
}
# Install Go
$goVersionsToInstall = $env:GO_VERSIONS.split(",")
$goVersionsToInstall = $env:GO_VERSIONS.split(", ", [System.StringSplitOptions]::RemoveEmptyEntries)
foreach($go in $goVersionsToInstall) {
Write-Host "Installing Go ${go}"
@@ -66,6 +70,6 @@ foreach($go in $goVersionsToInstall) {
} else {
$installDirectory = Install-GoVersion -goVersion $go
}
$envName = "GOROOT_{0}_{1}_X64" -f $go.split(".")
$envName = "GOROOT_{0}_{1}_X64" -f $go.split(".")
setx $envName "$installDirectory" /M
}

View File

@@ -1,24 +0,0 @@
################################################################################
## File: Install-Ruby.ps1
## Desc: Install Ruby for Windows
################################################################################
Import-Module -Name ImageHelpers
# Ruby versions are already available in the tool cache.
# Tool cache Ruby Path
$toolcacheRubyPath = 'C:\hostedtoolcache\windows\Ruby\2.5.*'
# Get Latest Ruby 2.5.x
$latestRubyBinPath2_5 = Get-ChildItem -Path $toolcacheRubyPath | Sort-Object {[System.Version]$_.Name} | Select-Object -Last 1 | ForEach-Object {
Join-Path $_.FullName 'x64\bin'
}
Add-MachinePathItem $latestRubyBinPath2_5
$env:Path = Get-MachinePath
# Update ruby gem to latest version
gem update --system
exit 0

View File

@@ -4,8 +4,24 @@
################################################################################
# Requires Windows SDK with the same version number as the WDK
$winSdkUrl = "https://go.microsoft.com/fwlink/p/?linkid=2083338"
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2085767"
Import-Module -Name ImageHelpers -Force
if(Test-IsWin19)
{
$winSdkUrl = "https://go.microsoft.com/fwlink/p/?linkid=2083338"
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2085767"
$FilePath = "C:\Program Files (x86)\Windows Kits\10\Vsix\VS2019\WDK.vsix"
$VSver = "2019"
}
else
{
$winSdkUrl = "https://go.microsoft.com/fwlink/p/?LinkID=2023014"
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2026156"
$FilePath = "C:\Program Files (x86)\Windows Kits\10\Vsix\WDK.vsix"
$VSver = "2017"
}
# `winsdksetup.exe /features + /quiet` installs all features without showing the GUI
$sdkExitCode = Install-EXE -Url $winSdkUrl -Name "winsdksetup.exe" -ArgumentList ("/features", "+", "/quiet")
@@ -26,32 +42,4 @@ if ($wdkExitCode -ne 0)
}
# Need to install the VSIX to get the build targets when running VSBuild
# Write-Host "Installing WDK.vsix"
try
{
$process = Start-Process `
-FilePath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\VSIXInstaller.exe" `
-ArgumentList ("/quiet", '"C:\Program Files (x86)\Windows Kits\10\Vsix\VS2019\WDK.vsix"') `
-Wait `
-PassThru
}
catch
{
Write-Host "There is an error during WDK.vsix installation"
$_
exit 1
}
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 1001) # 1001 means the extension is already installed
{
Write-Host "WDK.vsix installed successfully"
}
else
{
Write-Host "Unsuccessful exit code returned by the installation process: $exitCode."
}
exit $exitCode
Install-VsixExtension -FilePath $FilePath -Name "WDK.vsix" -VSversion $VSver -InstallOnly

View File

@@ -0,0 +1,23 @@
################################################################################
## File: Install-Wix.ps1
## Desc: Install WIX.
################################################################################
Import-Module -Name ImageHelpers -Force;
choco install wixtoolset -y --force
if(Test-IsWin19)
{
$extensionUrl = "https://wixtoolset.gallerycdn.vsassets.io/extensions/wixtoolset/wixtoolsetvisualstudio2019extension/1.0.0.4/1563296438961/Votive2019.vsix"
$VSver = "2019"
}
else
{
$extensionUrl = "https://robmensching.gallerycdn.vsassets.io/extensions/robmensching/wixtoolsetvisualstudio2017extension/0.9.21.62588/1494013210879/250616/4/Votive2017.vsix"
$VSver = "2017"
}
$extensionName = "Votive$VSver.vsix"
#Installing VS extension 'Wix Toolset Visual Studio Extension'
Install-VsixExtension -Url $extensionUrl -Name $extensionName -VSversion $VSver

View File

@@ -110,6 +110,7 @@ Push-Location -Path $sdk.FullName
"add-ons;addon-google_apis-google-22" `
"add-ons;addon-google_apis-google-21" `
"cmake;3.6.4111459" `
"cmake;3.10.2.4988404" `
"patcher;v4"
Pop-Location

View File

@@ -41,4 +41,4 @@ $Description = @"
_Version:_ $bazelisk_version<br/>
"@
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description

View File

@@ -3,6 +3,8 @@
## Desc: Validate Boost
################################################################################
Import-Module -Name ImageHelpers
function Validate-BoostVersion
{
Param
@@ -49,36 +51,31 @@ $tmplMarkRoot = @"
_Environment:_
* PATH: contains the location of Boost version {0}
* BOOST_ROOT: root directory of the Boost version {0} installation
* {1}: root directory of the Boost version {0} installation
"@
$SoftwareName = 'Boost'
$Description = New-Object System.Text.StringBuilder
$BoostRootDirectory = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath "Boost"
$BoostVersionsToInstall = $env:BOOST_VERSIONS.split(",")
$SoftwareName = 'Boost'
$BoostRootDirectory = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath $SoftwareName
$BoostTools = Get-ToolsByName -SoftwareName $SoftwareName
foreach($BoostVersion in $BoostVersionsToInstall)
foreach ($BoostTool in $BoostTools)
{
Validate-BoostVersion -BoostRootPath $BoostRootDirectory -BoostRelease $BoostVersion
$BoostVersionTag = "BOOST_ROOT_{0}" -f $BoostVersion.Replace('.', '_')
$BoostToolsetName = $BoostTool.Architecture
$BoostVersionsToInstall = $BoostTool.Versions | Foreach-Object {"{0}.0" -f $_}
foreach($BoostVersion in $BoostVersionsToInstall)
{
Validate-BoostVersion -BoostRootPath $BoostRootDirectory -BoostRelease $BoostVersion
$BoostVersionTag = "BOOST_ROOT_{0}" -f $BoostVersion.Replace('.', '_')
if ([Version]$BoostVersion -ge "1.70.0")
{
$BoostToolsetName = "msvc-14.2"
}
else
{
$BoostToolsetName = "msvc-14.1"
}
if($BoostVersion -eq $env:BOOST_DEFAULT)
{
$null = $Description.AppendLine(($tmplMarkRoot -f $BoostVersion, $BoostVersionTag, $BoostToolsetName))
}
else
{
$null = $Description.AppendLine(($tmplMark -f $BoostVersion, $BoostVersionTag, $BoostToolsetName))
if($BoostVersion -eq $env:BOOST_DEFAULT)
{
$null = $Description.AppendLine(($tmplMarkRoot -f $BoostVersion, $BoostVersionTag, $BoostToolsetName))
}
else
{
$null = $Description.AppendLine(($tmplMark -f $BoostVersion, $BoostVersionTag, $BoostToolsetName))
}
}
}

View File

@@ -2,48 +2,61 @@
## File: Validate-Git.ps1
## Desc: Validate Git for Windows
################################################################################
if((Get-Command -Name 'git') -and (Get-Command -Name 'bash') -and (Get-Command -Name 'awk') -and (Get-Command -Name 'git-lfs'))
{
Write-Host "$(git version) on path"
Write-Host "$(git-lfs version) on path"
function Test-CommandName {
param(
[parameter(Mandatory)][string] $CommandName
)
Write-Host "Checking the [$CommandName]"
if(-not (Get-Command $CommandName -ErrorAction "Continue")) {
Write-Host "[!] $CommandName is not found"
exit 1
}
}
else
{
Write-Host "git or git-lfs are not on path."
exit 1
function Test-Command {
param(
[parameter(Mandatory)][string] $CommandName,
[parameter(Mandatory)][string] $CommandDescription,
[parameter(Mandatory)][string] $VersionCmd,
[parameter(Mandatory)][string] $regexVersion,
[parameter(Mandatory)][string] $DescriptionMarkdown
)
Test-CommandName -CommandName $CommandName
$strVersion = Invoke-Expression $VersionCmd
Write-Host "$strVersion on path"
if($strVersion -match $regexVersion) {
$Version = $Matches.version
}
else {
Write-Host "[!] $CommandName version detection failed"
exit 1
}
# Adding description of the software to Markdown
$DescriptionMarkdown = $DescriptionMarkdown -f $Version
Add-SoftwareDetailsToMarkdown -SoftwareName $CommandDescription -DescriptionMarkdown $DescriptionMarkdown
}
Test-CommandName -CommandName 'bash'
Test-CommandName -CommandName 'awk'
if( $(git version) -match 'git version (?<version>.*).win.*' )
{
$gitVersion = $Matches.version
}
if( $(git-lfs version) -match 'git-lfs\/(?<version>.*) \(Git.*' )
{
$gitLfsVersion = $Matches.version
}
# Adding description of the software to Markdown
$SoftwareName = "Git"
$Description = @"
_Version:_ $gitVersion<br/>
$GitDescription = @"
_Version:_ {0}<br/>
_Environment:_
* PATH: contains location of git.exe
"@
Test-Command -CommandName 'git' -CommandDescription 'Git' -VersionCmd "git version" -regexVersion 'git version (?<version>.*).win.*' -DescriptionMarkdown $GitDescription
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
# Adding description of the software to Markdown
$SoftwareName = "Git Large File Storage (LFS)"
$Description = @"
_Version:_ $gitLfsVersion<br/>
$GitLfsDescription = @"
_Version:_ {0}<br/>
_Environment:_
* PATH: contains location of git-lfs.exe
* GIT_LFS_PATH: location of git-lfs.exe
"@
Test-Command -CommandName 'git-lfs' -CommandDescription 'Git Large File Storage (LFS)' -VersionCmd "git-lfs version" -regexVersion 'git-lfs\/(?<version>.*) \(Git.*' -DescriptionMarkdown $GitLfsDescription
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
$HubCliDescription = @"
_Version:_ {0}<br/>
_Environment:_
* PATH: contains location of hub.exe
"@
Test-Command -CommandName 'hub' -CommandDescription 'Hub CLI' -VersionCmd "hub version | Select-String 'hub version'" -regexVersion 'hub version (?<version>.*)' -DescriptionMarkdown $HubCliDescription

View File

@@ -8,18 +8,31 @@ function Get-GoVersion
{
Param
(
[String]$goRootPath
[String]$goVersion
)
Write-Host "Check if $goVersion is presented in the system"
$DestinationPath = "$($env:SystemDrive)\"
$goDirectory = Get-ChildItem -Path $DestinationPath -Filter "Go$goVersion*" | Select-Object -First 1
$goPath = Join-Path $env:SystemDrive $goDirectory
$env:Path = "$goRootPath\bin;" + $env:Path
if( $(go version) -match 'go version go(?<version>.*) win.*' )
$env:Path = "$goPath\bin;" + $env:Path
$version = $(go version)
$matchVersion = $version -match $goVersion
$semanticEquality = $version -match 'go version go(?<version>.*) win.*'
if($semanticEquality -And $matchVersion)
{
$goVersion = $Matches.version
return $goVersion
}
$goFullVersion = $Matches.version
Write-Host "$goFullVersion has been found"
Write-Host "Unable to determine Go version at " + $goRootPath
return ""
return $goFullVersion
}
else
{
Write-Host "Unable to determine Go version at " + $goPath
exit 1
}
}
# Verify that go.exe is on the path
@@ -53,10 +66,10 @@ _Environment:_
$SoftwareName = "Go (x64)"
$Description = New-Object System.Text.StringBuilder
$goVersionsToInstall = $env:GO_VERSIONS.split(",")
$goVersionsToInstall = $env:GO_VERSIONS.split(", ", [System.StringSplitOptions]::RemoveEmptyEntries)
foreach($go in $goVersionsToInstall) {
$goVersion = Get-GoVersion -goRootPath "C:\Go${go}"
$goVersion = Get-GoVersion -goVersion $go
$goVersionTag = "GOROOT_{0}_{1}_X64" -f $go.split(".")
if ($goVersion -eq $go) {
if($go -eq $env:GO_DEFAULT) {

View File

@@ -1,45 +0,0 @@
################################################################################
## File: Validate-Python.ps1
## Desc: Configure python on path based on what is installed in the tools cache
## Must run after tools cache is downloaded and validated
################################################################################
if(Get-Command -Name 'python')
{
Write-Host "Python $(& python -V 2>&1) on path"
}
else
{
Write-Host "Python is not on path"
exit 1
}
$Python3Version = $(& python -V 2>&1)
if ($Python3Version -notlike "Python 3.*")
{
Write-Error "Python 3 is not in the PATH"
}
$python2path = $Env:AGENT_TOOLSDIRECTORY + '/Python/2.7*/x64'
$python2Dir = Get-Item -Path $python2path
$env:Path = $python2Dir.FullName + ";" + $env:Path
$Python2Version = & $env:comspec "/s /c python --version 2>&1"
# Adding description of the software to Markdown
$SoftwareName = "Python (64 bit)"
$Description = @"
#### $Python3Version
_Environment:_
* PATH: contains location of python.exe
#### $Python2Version
_Location:_ $Python2Path
"@
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description

View File

@@ -1,55 +0,0 @@
################################################################################
## File: Validate-Ruby.ps1
## Desc: Verify that Ruby is on the path and output version information.
################################################################################
# Function that gets the version of Ruby at the specified path
function Get-RubyVersion
{
Param
(
[String]$rubyRootPath
)
# Prepend to the path like: C:\hostedtoolcache\windows\Ruby\2.5.0\x64\bin
$env:Path = "$rubyRootPath;" + $env:Path
# Extract the version from Ruby output like: ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]
if( $(ruby --version) -match 'ruby (?<version>.*) \(.*' )
{
$rubyVersion = $Matches.version
return $rubyVersion
}
Write-Host "Unable to determine Ruby version at " + $rubyRootPath
exit 1
}
# Verify that ruby is on the path
if(Get-Command -Name 'ruby')
{
Write-Host "$(ruby --version) is on the path."
}
else
{
Write-Host "Ruby is not on the path."
exit 1
}
# Default Ruby Version on Path
$rubyExeOnPath = (Get-Command -Name 'ruby').Path
$rubyBinOnPath = Split-Path -Path $rubyExeOnPath
$rubyVersionOnPath = Get-RubyVersion -rubyRootPath $rubyBinOnPath
$gemVersion = & gem -v
# Add details of available versions in Markdown
$SoftwareName = "Ruby (x64)"
$Description = @"
#### $rubyVersionOnPath
_Environment:_
* Location: $rubyBinOnPath
* PATH: contains the location of ruby.exe version $rubyVersionOnPath
* Gem Version: $gemVersion
"@
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description

View File

@@ -63,6 +63,78 @@ function RunTestsByPath {
}
}
function Get-SystemDefaultPython {
Write-Host "Validate system Python..."
if (Get-Command -Name 'python')
{
Write-Host "Python $(& python -V 2>&1) on path"
}
else
{
Write-Host "Python is not on path"
exit 1
}
$pythonBinVersion = $(& python -V 2>&1)
if ($pythonBinVersion -notlike "Python 3.*")
{
Write-Error "Python 3 is not in the PATH"
exit 1
}
$pythonBinOnPath = Split-Path -Path (Get-Command -Name 'python').Path
$description = GetDefaultToolDescription -SoftwareVersion $pythonBinVersion -SoftwareLocation $pythonBinOnPath
return $description
}
function Get-SystemDefaultRuby {
Write-Host "Validate system Ruby..."
if (Get-Command -Name 'ruby')
{
Write-Host "$(ruby --version) is on the path."
}
else
{
Write-Host "Ruby is not on the path."
exit 1
}
$rubyBinOnPath = Split-Path -Path (Get-Command -Name 'ruby').Path
if ( $(ruby --version) -notmatch 'ruby (?<version>.*) \(.*' )
{
Write-Host "Unable to determine Ruby version at " + $rubyBinOnPath
exit 1
}
$rubyVersionOnPath = "Ruby $($Matches.version)"
$description = GetDefaultToolDescription -SoftwareVersion $rubyVersionOnPath -SoftwareLocation $rubyBinOnPath
$gemVersion = & gem -v
$description += "* Gem Version: $gemVersion<br/>"
return $description
}
function GetDefaultToolDescription {
param (
[Parameter(Mandatory = $True)]
[string]$SoftwareVersion,
[Parameter(Mandatory = $True)]
[string]$SoftwareLocation
)
$description = "<br/>__System default version:__ $SoftwareVersion<br/>"
$description += "_Environment:_<br/>"
$description += "* Location: $SoftwareLocation<br/>"
$description += "* PATH: contains the location of $SoftwareVersion<br/>"
return $description
}
function GetMarkdownDescription {
param (
[Parameter(Mandatory = $True)]
@@ -123,6 +195,14 @@ function ToolcacheTest {
$markdownDescription += GetMarkdownDescription -SoftwareVersion $foundVersion -SoftwareArchitecture $requiredArchitecture
}
}
if ($SoftwareName -contains "Python") {
$markdownDescription += Get-SystemDefaultPython
}
if ($SoftwareName -contains "Ruby") {
$markdownDescription += Get-SystemDefaultRuby
}
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $markdownDescription
}

View File

@@ -19,7 +19,7 @@ function Get-WDKVersion
}
$WDKVersion = Get-WDKVersion
$WDKPackageVersion = Get-VS19ExtensionVersion -packageName "Microsoft.Windows.DriverKit"
$WDKPackageVersion = Get-VSExtensionVersion -packageName "Microsoft.Windows.DriverKit"
# Adding description of the software to Markdown
$SoftwareName = "Windows Driver Kit"

View File

@@ -4,6 +4,7 @@
################################################################################
Import-Module -Name ImageHelpers -Force
function Get-WixVersion {
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
$installedApplications = Get-ItemProperty -Path $regKey
@@ -21,14 +22,23 @@ else {
exit 1
}
$WixPackageVersion = Get-VS19ExtensionVersion -packageName "WixToolset.VisualStudioExtension.Dev16"
if(Test-IsWin19)
{
$WixPackageVersion = Get-VSExtensionVersion -packageName "WixToolset.VisualStudioExtension.Dev16"
$VSver = "2019"
}
else
{
$WixPackageVersion = Get-VSExtensionVersion -packageName "WixToolset.VisualStudioExtension.Dev15"
$VSver = "2017"
}
# Adding description of the software to Markdown
$SoftwareName = "WIX Tools"
$Description = @"
_Toolset Version:_ $WixToolSetVersion<br/>
_WIX Toolset Visual Studio Extension Version:_ $WixPackageVersion<br/>
_WIX Toolset Studio $VSver Extension Version:_ $WixPackageVersion<br/>
_Environment:_
* WIX: Installation root of WIX
"@

View File

@@ -8,7 +8,13 @@ function Disable-InternetExplorerESC {
$UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}"
Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0 -Force
Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0 -Force
Stop-Process -Name Explorer -Force -ErrorAction Continue
$ieProcess = Get-Process -Name Explorer -ErrorAction SilentlyContinue
if ($ieProcess){
Stop-Process -Name Explorer -Force -ErrorAction Continue
}
Write-Host "IE Enhanced Security Configuration (ESC) has been disabled."
}

View File

@@ -1,28 +0,0 @@
################################################################################
## File: Install-Python.ps1
## Desc: Configure python on path with 3.6.* version from the tools cache
## Must run after tools cache is setup
################################################################################
Import-Module -Name ImageHelpers -Force
$python36path = $Env:AGENT_TOOLSDIRECTORY + '/Python/3.6*/x64'
$pythonDir = Get-Item -Path $python36path
if($pythonDir -is [array])
{
Write-Host "More than one python 3.6.* installations found"
Write-Host $pythonDir
exit 1
}
$currentPath = Get-MachinePath
if ($currentPath | Select-String -SimpleMatch $pythonDir.FullName)
{
Write-Host $pythonDir.FullName ' is already in PATH'
exit 0
}
Add-MachinePathItem -PathItem $pythonDir.FullName
Add-MachinePathItem -PathItem "$($pythonDir.FullName)\Scripts"

View File

@@ -1,51 +0,0 @@
################################################################################
## File: Install-WDK.ps1
## Desc: Install the Windows Driver Kit
################################################################################
# Version: 10.0.17763.0
# Update Validate-WDK.ps1 if the version changes!
# There doesn't seem to be any way to check the version programmatically
# Requires Windows SDK with the same version number as the WDK
$winSdkUrl = "https://go.microsoft.com/fwlink/p/?LinkID=2023014"
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2026156"
# `winsdksetup.exe /features + /quiet` installs all features without showing the GUI
$sdkExitCode = Install-EXE -Url $winSdkUrl -Name "winsdksetup.exe" -ArgumentList ("/features", "+", "/quiet")
if ($sdkExitCode -ne 0)
{
Write-Host "Failed to install the Windows SDK."
exit $sdkExitCode
}
# `wdksetup.exe /features + /quiet` installs all features without showing the GUI
$wdkExitCode = Install-EXE -Url $wdkUrl -Name "wdksetup.exe" -ArgumentList ("/features", "+", "/quiet")
if ($wdkExitCode -ne 0)
{
Write-Host "Failed to install the Windows Driver Kit."
exit $wdkExitCode
}
# Need to install the VSIX to get the build targets when running VSBuild
Write-Host "Installing WDK.vsix"
$process = Start-Process `
-FilePath "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VSIXInstaller.exe" `
-ArgumentList ("/quiet", '"C:\Program Files (x86)\Windows Kits\10\Vsix\WDK.vsix"') `
-Wait `
-PassThru
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 1001) # 1001 means the extension is already installed
{
Write-Host "WDK.vsix installed successfully"
}
else
{
Write-Host "Unsuccessful exit code returned by the installation process: $exitCode."
}
exit $exitCode

View File

@@ -1,53 +0,0 @@
################################################################################
## File: Install-Wix.ps1
## Desc: Install WIX.
################################################################################
function Install-VsixExtension
{
Param
(
[String]$Url,
[String]$Name
)
$exitCode = -1
try
{
Write-Host "Downloading $Name..."
$FilePath = "${env:Temp}\$Name"
Invoke-WebRequest -Uri $Url -OutFile $FilePath
$ArgumentList = ('/quiet', $FilePath)
Write-Host "Starting Install $Name..."
$process = Start-Process -FilePath 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VSIXInstaller.exe' -ArgumentList $ArgumentList -Wait -PassThru
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
Write-Host -Object 'Installation successful'
return $exitCode
}
else
{
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
return $exitCode
}
}
catch
{
Write-Host -Object "Failed to install the Extension $Name"
Write-Host -Object $_.Exception.Message
return -1
}
}
choco install wixtoolset -y --force
#Installing VS extension 'Wix Toolset Visual Studio 2017 Extension'
$exitCode = Install-VsixExtension -Url 'https://robmensching.gallerycdn.vsassets.io/extensions/robmensching/wixtoolsetvisualstudio2017extension/0.9.21.62588/1494013210879/250616/4/Votive2017.vsix' -Name 'Votive2017.vsix'
return $exitCode

View File

@@ -5,39 +5,13 @@
Import-Module -Name ImageHelpers -Force
function Get-SSDTExtensionPackage {
$vsProgramData = Get-Item -Path "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances"
$instanceFolders = Get-ChildItem -Path $vsProgramData.FullName
if($instanceFolders -is [array])
{
Write-Host "More than one instance installed"
exit 1
}
$stateContent = Get-Content -Path ($instanceFolders.FullName + '\state.packages.json')
$state = $stateContent | ConvertFrom-Json
$SsdtPackage = $state.packages | where { $_.id -eq "SSDT" }
return $SsdtPackage
}
$SsdtPackage = Get-SSDTExtensionPackage
if($SsdtPackage){
Write-Host "SSDT version" $SsdtPackage.version "installed"
}
else {
Write-Host "SSDT is not installed"
exit 1
}
$SSDTPackageVersion = Get-VSExtensionVersion -packageName "SSDT"
# Adding description of the software to Markdown
$SoftwareName = "SQL Server Data Tools for VS 2017"
$Description = @"
_Version:_ $($SsdtPackage.version)<br/>
_Version:_ $SSDTPackageVersion<br/>
The following components are installed:

View File

@@ -1,13 +0,0 @@
################################################################################
## File: Validate-WDK.ps1
## Desc: Validate the installation of the Windows Driver Kit
################################################################################
# Adding description of the software to Markdown
$SoftwareName = "Windows Driver Kit"
$Description = @"
_Version:_ 10.0.17763.0<br/>
"@
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description

View File

@@ -1,62 +0,0 @@
################################################################################
## File: Validate-Wix.ps1
## Desc: Validate WIX.
################################################################################
Import-Module -Name ImageHelpers -Force
function Get-WixVersion {
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
$installedApplications = Get-ItemProperty -Path $regKey
$Version = ($installedApplications | Where-Object { $_.DisplayName -and $_.DisplayName.toLower().Contains("wix") } | Select-Object -First 1).DisplayVersion
return $Version
}
#Gets the extension details from state.json
function Get-WixExtensionPackage {
$vsProgramData = Get-Item -Path "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances"
$instanceFolders = Get-ChildItem -Path $vsProgramData.FullName
if($instanceFolders -is [array])
{
Write-Host "More than one instance installed"
exit 1
}
$stateContent = Get-Content -Path ($instanceFolders.FullName + '\state.packages.json')
$state = $stateContent | ConvertFrom-Json
$WixPackage = $state.packages | where { $_.id -eq "WixToolset.VisualStudioExtension.Dev15" }
return $WixPackage
}
$WixToolSetVersion = Get-WixVersion
if($WixToolSetVersion) {
Write-Host "Wix Toolset version" $WixPackage.version "installed"
}
else {
Write-Host "Wix Toolset is not installed"
exit 1
}
$WixPackage = Get-WixExtensionPackage
if($WixPackage) {
Write-Host "Wix Extension version" $WixPackage.version "installed"
}
else {
Write-Host "Wix Extension is not installed"
exit 1
}
# Adding description of the software to Markdown
$SoftwareName = "WIX Tools"
$Description = @"
_Toolset Version:_ $WixToolSetVersion<br/>
_WIX Toolset Studio 2017 Extension Version:_ $($WixPackage.version)<br/>
_Environment:_
* WIX: Installation root of WIX
"@
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description

View File

@@ -8,7 +8,13 @@ function Disable-InternetExplorerESC {
$UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}"
Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0 -Force
Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0 -Force
Stop-Process -Name Explorer -Force -ErrorAction Continue
$ieProcess = Get-Process -Name Explorer -ErrorAction SilentlyContinue
if ($ieProcess){
Stop-Process -Name Explorer -Force -ErrorAction Continue
}
Write-Host "IE Enhanced Security Configuration (ESC) has been disabled."
}

View File

@@ -1,44 +0,0 @@
###################################################################################
## File: Install-AnalysisExtenstion.ps1
## Desc: Install the Microsoft Analysis Services Projects Visual Studio extension
###################################################################################
$extensionUrl = "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ProBITools/vsextensions/MicrosoftAnalysisServicesModelingProjects/2.9.5/vspackage"
$extensionDownloadPath = Join-Path $Env:TEMP "Microsoft.DataTools.AnalysisServices.vsix"
Write-Host "Downloading Microsoft.DataTools.AnalysisServices.vsix extension"
(New-Object System.Net.WebClient).DownloadFile($extensionUrl, $extensionDownloadPath)
Write-Host "Installing Microsoft.DataTools.AnalysisServices.vsix extension"
try
{
$process = Start-Process `
-FilePath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\VSIXInstaller.exe" `
-ArgumentList ("/quiet", "$extensionDownloadPath") `
-Wait `
-PassThru
}
catch
{
Write-Host "There is an error during Microsoft.DataTools.AnalysisServices.vsix installation"
$_
exit 1
}
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 1001) # 1001 means the extension is already installed
{
Write-Host "Microsoft.DataTools.AnalysisServices.vsix installed successfully"
}
else
{
Write-Host "Unsuccessful exit code returned by the installation process: $exitCode."
exit 1
}
#Cleanup installation files
Remove-Item -Force -Confirm:$false $extensionDownloadPath
exit $exitCode

View File

@@ -1,28 +0,0 @@
################################################################################
## File: Install-Python.ps1
## Desc: Configure python on path with 3.7.* version from the tools cache
## Must run after tools cache is setup
################################################################################
Import-Module -Name ImageHelpers -Force
$python37path = $Env:AGENT_TOOLSDIRECTORY + '/Python/3.7*/x64'
$pythonDir = Get-Item -Path $python37path
if($pythonDir -is [array])
{
Write-Host "More than one python 3.7.* installations found"
Write-Host $pythonDir
exit 1
}
$currentPath = Get-MachinePath
if ($currentPath | Select-String -SimpleMatch $pythonDir.FullName)
{
Write-Host $pythonDir.FullName ' is already in PATH'
exit 0
}
Add-MachinePathItem -PathItem $pythonDir.FullName
Add-MachinePathItem -PathItem "$($pythonDir.FullName)\Scripts"

View File

@@ -0,0 +1,11 @@
###################################################################################
## File: Install-SSDTExtensions.ps1
## Desc: Install the extensions previously known as SSDT package
###################################################################################
Import-Module -Name ImageHelpers -Force
Install-VsixExtension -Url 'https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ProBITools/vsextensions/MicrosoftAnalysisServicesModelingProjects/2.9.5/vspackage' -Name 'Microsoft.DataTools.AnalysisServices.vsix' -VSversion "2019"
Install-VsixExtension -Url 'https://marketplace.visualstudio.com/_apis/public/gallery/publishers/SSIS/vsextensions/SqlServerIntegrationServicesProjects/3.4/vspackage' -Name 'Microsoft.DataTools.IntegrationServices.exe' -VSversion "2019"
Install-VsixExtension -Url 'https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ProBITools/vsextensions/MicrosoftReportProjectsforVisualStudio/2.6.3/vspackage' -Name 'Microsoft.DataTools.ReportingServices.vsix' -VSversion "2019"

View File

@@ -1,53 +0,0 @@
################################################################################
## File: Install-Wix.ps1
## Desc: Install WIX.
################################################################################
function Install-VsixExtension
{
Param
(
[String]$Url,
[String]$Name
)
$ReleaseInPath = 'Enterprise'
$exitCode = -1
try
{
Write-Host "Downloading $Name..."
$FilePath = "${env:Temp}\$Name"
Invoke-WebRequest -Uri $Url -OutFile $FilePath
$ArgumentList = ('/quiet', $FilePath)
Write-Host "Starting Install $Name..."
$process = Start-Process -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\2019\$ReleaseInPath\Common7\IDE\VSIXInstaller.exe" -ArgumentList $ArgumentList -Wait -PassThru
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
Write-Host -Object 'Installation successful'
return $exitCode
}
else
{
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
return $exitCode
}
}
catch
{
Write-Host -Object "Failed to install the Extension $Name"
Write-Host -Object $_.Exception.Message
return -1
}
}
choco install wixtoolset -y --force
#Installing VS extension 'Wix Toolset Visual Studio 2019 Extension'
$exitCode = Install-VsixExtension -Url 'https://wixtoolset.gallerycdn.vsassets.io/extensions/wixtoolset/wixtoolsetvisualstudio2019extension/1.0.0.4/1563296438961/Votive2019.vsix' -Name 'Votive2019.vsix'
#return $exitCode

View File

@@ -1,18 +0,0 @@
################################################################################
## File: Validate-AnalysisExtenstion.ps1
## Desc: Validate Microsoft Analysis Services Projects Visual Studio extension
################################################################################
Import-Module -Name ImageHelpers -Force
#AnalysisPackage doesn't have any proper name in the state.packages.json file, only id is available
$AnalysisPackageVersion = Get-VS19ExtensionVersion -packageName "04a86fc2-dbd5-4222-848e-911638e487fe"
# Adding description of the software to Markdown
$SoftwareName = "Microsoft Analysis Services Projects Visual Studio Extension"
$Description = @"
_Version:_ $AnalysisPackageVersion<br/>
"@
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description

View File

@@ -0,0 +1,22 @@
################################################################################
## File: Validate-SSDTExtensions.ps1
## Desc: Validate SQL Server Data Tools Visual Studio extensions
################################################################################
Import-Module -Name ImageHelpers -Force
#These extensions don't have any proper name in the state.packages.json file, only id is available, which can be found on extension marketplace download page
$AnalysisPackageVersion = Get-VSExtensionVersion -packageName "04a86fc2-dbd5-4222-848e-911638e487fe"
$IntegrationPackageVersion = Get-VSExtensionVersion -packageName "851E7A09-7B2B-4F06-A15D-BABFCB26B970"
$ReportingPackageVersion = Get-VSExtensionVersion -packageName "717ad572-c4b7-435c-c166-c2969777f718"
# Adding description of the software to Markdown
$SoftwareName = "Microsoft SSDT Visual Studio 2019 Extensions"
$Description = @"
_Microsoft Analysis Services Projects Version:_ $AnalysisPackageVersion<br/>
_SQL Server Integration Services Projects Version:_ $IntegrationPackageVersion<br/>
_Microsoft Reporting Services Projects Version:_ $ReportingPackageVersion<br/>
"@
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description