mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
Another mop up commit to add missing changes from the last mop-up.
This commit is contained in:
@@ -1,147 +1,146 @@
|
||||
################################################################################
|
||||
## File: Initialize-VM.ps1
|
||||
## Team: CI-Platform
|
||||
## Desc: VM initialization script, machine level configuration
|
||||
################################################################################
|
||||
|
||||
function Disable-InternetExplorerESC {
|
||||
$AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
|
||||
$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
|
||||
Write-Host "IE Enhanced Security Configuration (ESC) has been disabled."
|
||||
}
|
||||
|
||||
function Disable-InternetExplorerWelcomeScreen {
|
||||
$AdminKey = "HKLM:\Software\Policies\Microsoft\Internet Explorer\Main"
|
||||
New-Item -Path $AdminKey -Value 1 -Force
|
||||
Set-ItemProperty -Path $AdminKey -Name "DisableFirstRunCustomize" -Value 1 -Force
|
||||
Write-Host "Disabled IE Welcome screen"
|
||||
}
|
||||
|
||||
function Disable-UserAccessControl {
|
||||
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Value 00000000 -Force
|
||||
Write-Host "User Access Control (UAC) has been disabled."
|
||||
}
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
Write-Host "Setup PowerShellGet"
|
||||
# Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
|
||||
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
|
||||
Install-Module -Name PowerShellGet -Force
|
||||
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
|
||||
|
||||
|
||||
Write-Host "Disable Antivirus"
|
||||
Set-MpPreference -DisableRealtimeMonitoring $true
|
||||
|
||||
# Disable Windows Update
|
||||
$AutoUpdatePath = "HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"
|
||||
If (Test-Path -Path $AutoUpdatePath) {
|
||||
Set-ItemProperty -Path $AutoUpdatePath -Name NoAutoUpdate -Value 1
|
||||
Write-Host "Disabled Windows Update"
|
||||
}
|
||||
else {
|
||||
Write-Host "Windows Update key does not exist"
|
||||
}
|
||||
|
||||
# Install Windows .NET Features
|
||||
Install-WindowsFeature -Name NET-Framework-Features -IncludeAllSubFeature
|
||||
Install-WindowsFeature -Name NET-Framework-45-Features -IncludeAllSubFeature
|
||||
Install-WindowsFeature -Name BITS -IncludeAllSubFeature
|
||||
Install-WindowsFeature -Name DSC-Service
|
||||
|
||||
Write-Host "Disable UAC"
|
||||
Disable-UserAccessControl
|
||||
|
||||
Write-Host "Disable IE Welcome Screen"
|
||||
Disable-InternetExplorerWelcomeScreen
|
||||
|
||||
Write-Host "Disable IE ESC"
|
||||
Disable-InternetExplorerESC
|
||||
|
||||
Write-Host "Setting local execution policy"
|
||||
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope MachinePolicy -ErrorAction Continue | Out-Null
|
||||
Get-ExecutionPolicy -List
|
||||
|
||||
Write-Host "Enable long path behavior"
|
||||
# See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file#maximum-path-length-limitation
|
||||
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1
|
||||
|
||||
Write-Host "Install chocolatey"
|
||||
$chocoExePath = 'C:\ProgramData\Chocolatey\bin'
|
||||
|
||||
if ($($env:Path).ToLower().Contains($($chocoExePath).ToLower())) {
|
||||
Write-Host "Chocolatey found in PATH, skipping install..."
|
||||
Exit
|
||||
}
|
||||
|
||||
# Add to system PATH
|
||||
$systemPath = [Environment]::GetEnvironmentVariable('Path', [System.EnvironmentVariableTarget]::Machine)
|
||||
$systemPath += ';' + $chocoExePath
|
||||
[Environment]::SetEnvironmentVariable("PATH", $systemPath, [System.EnvironmentVariableTarget]::Machine)
|
||||
|
||||
# Update local process' path
|
||||
$userPath = [Environment]::GetEnvironmentVariable('Path', [System.EnvironmentVariableTarget]::User)
|
||||
if ($userPath) {
|
||||
$env:Path = $systemPath + ";" + $userPath
|
||||
}
|
||||
else {
|
||||
$env:Path = $systemPath
|
||||
}
|
||||
|
||||
# Run the installer
|
||||
Invoke-Expression ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
|
||||
|
||||
# Turn off confirmation
|
||||
choco feature enable -n allowGlobalConfirmation
|
||||
|
||||
# Install webpi
|
||||
choco install webpicmd -y
|
||||
|
||||
|
||||
# Expand disk size of OS drive
|
||||
|
||||
New-Item -Path d:\ -Name cmds.txt -ItemType File -Force
|
||||
|
||||
Add-Content -Path d:\cmds.txt "SELECT VOLUME=C`r`nEXTEND"
|
||||
|
||||
$expandResult = (diskpart /s 'd:\cmds.txt')
|
||||
|
||||
Write-Host $expandResult
|
||||
|
||||
Write-Host "Disk sizes after expansion"
|
||||
|
||||
wmic logicaldisk get size,freespace,caption
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
|
||||
$Content = @"
|
||||
# Hosted Windows2016 image
|
||||
|
||||
The following software is installed on machines in the **Hosted Windows2016** (v$env:ImageVersion) pool.
|
||||
|
||||
Components marked with **\*** have been upgraded since the previous version of the image.
|
||||
|
||||
"@
|
||||
|
||||
Add-ContentToMarkdown -Content $Content
|
||||
|
||||
|
||||
$SoftwareName = "Chocolatey"
|
||||
|
||||
if( $( $(choco version) | Out-String) -match 'Chocolatey v(?<version>.*).*' )
|
||||
{
|
||||
$chocoVersion = $Matches.version.Trim()
|
||||
}
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $chocoVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location for choco.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Initialize-VM.ps1
|
||||
## Desc: VM initialization script, machine level configuration
|
||||
################################################################################
|
||||
|
||||
function Disable-InternetExplorerESC {
|
||||
$AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
|
||||
$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
|
||||
Write-Host "IE Enhanced Security Configuration (ESC) has been disabled."
|
||||
}
|
||||
|
||||
function Disable-InternetExplorerWelcomeScreen {
|
||||
$AdminKey = "HKLM:\Software\Policies\Microsoft\Internet Explorer\Main"
|
||||
New-Item -Path $AdminKey -Value 1 -Force
|
||||
Set-ItemProperty -Path $AdminKey -Name "DisableFirstRunCustomize" -Value 1 -Force
|
||||
Write-Host "Disabled IE Welcome screen"
|
||||
}
|
||||
|
||||
function Disable-UserAccessControl {
|
||||
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Value 00000000 -Force
|
||||
Write-Host "User Access Control (UAC) has been disabled."
|
||||
}
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
Write-Host "Setup PowerShellGet"
|
||||
# Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
|
||||
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
|
||||
Install-Module -Name PowerShellGet -Force
|
||||
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
|
||||
|
||||
|
||||
Write-Host "Disable Antivirus"
|
||||
Set-MpPreference -DisableRealtimeMonitoring $true
|
||||
|
||||
# Disable Windows Update
|
||||
$AutoUpdatePath = "HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"
|
||||
If (Test-Path -Path $AutoUpdatePath) {
|
||||
Set-ItemProperty -Path $AutoUpdatePath -Name NoAutoUpdate -Value 1
|
||||
Write-Host "Disabled Windows Update"
|
||||
}
|
||||
else {
|
||||
Write-Host "Windows Update key does not exist"
|
||||
}
|
||||
|
||||
# Install Windows .NET Features
|
||||
Install-WindowsFeature -Name NET-Framework-Features -IncludeAllSubFeature
|
||||
Install-WindowsFeature -Name NET-Framework-45-Features -IncludeAllSubFeature
|
||||
Install-WindowsFeature -Name BITS -IncludeAllSubFeature
|
||||
Install-WindowsFeature -Name DSC-Service
|
||||
|
||||
Write-Host "Disable UAC"
|
||||
Disable-UserAccessControl
|
||||
|
||||
Write-Host "Disable IE Welcome Screen"
|
||||
Disable-InternetExplorerWelcomeScreen
|
||||
|
||||
Write-Host "Disable IE ESC"
|
||||
Disable-InternetExplorerESC
|
||||
|
||||
Write-Host "Setting local execution policy"
|
||||
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope MachinePolicy -ErrorAction Continue | Out-Null
|
||||
Get-ExecutionPolicy -List
|
||||
|
||||
Write-Host "Enable long path behavior"
|
||||
# See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file#maximum-path-length-limitation
|
||||
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1
|
||||
|
||||
Write-Host "Install chocolatey"
|
||||
$chocoExePath = 'C:\ProgramData\Chocolatey\bin'
|
||||
|
||||
if ($($env:Path).ToLower().Contains($($chocoExePath).ToLower())) {
|
||||
Write-Host "Chocolatey found in PATH, skipping install..."
|
||||
Exit
|
||||
}
|
||||
|
||||
# Add to system PATH
|
||||
$systemPath = [Environment]::GetEnvironmentVariable('Path', [System.EnvironmentVariableTarget]::Machine)
|
||||
$systemPath += ';' + $chocoExePath
|
||||
[Environment]::SetEnvironmentVariable("PATH", $systemPath, [System.EnvironmentVariableTarget]::Machine)
|
||||
|
||||
# Update local process' path
|
||||
$userPath = [Environment]::GetEnvironmentVariable('Path', [System.EnvironmentVariableTarget]::User)
|
||||
if ($userPath) {
|
||||
$env:Path = $systemPath + ";" + $userPath
|
||||
}
|
||||
else {
|
||||
$env:Path = $systemPath
|
||||
}
|
||||
|
||||
# Run the installer
|
||||
Invoke-Expression ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
|
||||
|
||||
# Turn off confirmation
|
||||
choco feature enable -n allowGlobalConfirmation
|
||||
|
||||
# Install webpi
|
||||
choco install webpicmd -y
|
||||
|
||||
|
||||
# Expand disk size of OS drive
|
||||
|
||||
New-Item -Path d:\ -Name cmds.txt -ItemType File -Force
|
||||
|
||||
Add-Content -Path d:\cmds.txt "SELECT VOLUME=C`r`nEXTEND"
|
||||
|
||||
$expandResult = (diskpart /s 'd:\cmds.txt')
|
||||
|
||||
Write-Host $expandResult
|
||||
|
||||
Write-Host "Disk sizes after expansion"
|
||||
|
||||
wmic logicaldisk get size,freespace,caption
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
|
||||
$Content = @"
|
||||
# Azure Pipelines Hosted VS2017 image
|
||||
|
||||
The following software is installed on machines in the Azure Pipelines **Hosted VS2017** (v$env:ImageVersion) pool.
|
||||
|
||||
Components marked with **\*** have been upgraded since the previous version of the image.
|
||||
|
||||
"@
|
||||
|
||||
Add-ContentToMarkdown -Content $Content
|
||||
|
||||
|
||||
$SoftwareName = "Chocolatey"
|
||||
|
||||
if( $( $(choco version) | Out-String) -match 'Chocolatey v(?<version>.*).*' )
|
||||
{
|
||||
$chocoVersion = $Matches.version.Trim()
|
||||
}
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $chocoVersion<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location for choco.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,29 +1,28 @@
|
||||
################################################################################
|
||||
## File: Install-Python.ps1
|
||||
## Team: CI-X
|
||||
## 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"
|
||||
################################################################################
|
||||
## 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"
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
################################################################################
|
||||
## File: Install-SSDT.ps1
|
||||
## Team: CI-Platform
|
||||
## Desc: Install SQL Server Data Tools for Windows
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
#SSDT for Visual Studio 2017 (15.8.2)
|
||||
$InstallerURI = 'https://download.microsoft.com/download/D/F/8/DF8B51B9-8E9F-47F3-A27B-33EEDADD8966/SSDT-Setup-ENU.exe'
|
||||
$InstallerName = 'SSDT-Setup-ENU.exe'
|
||||
$logFilePath = "$env:TEMP\ssdtlog.txt"
|
||||
$ArgumentList = ('/install', 'INSTALLALL', '/passive', '/norestart', "/log `"$logFilePath`"")
|
||||
|
||||
$exitCode = Install-EXE -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentList
|
||||
|
||||
if($exitCode -ne 0 -and $exitCode -ne 3010)
|
||||
{
|
||||
Write-Host "******** SSDT SETUP LOG START ********"
|
||||
Write-Host $(Get-Content $logFilePath | Out-String)
|
||||
Write-Host "******** SSDT SETUP LOG END ********"
|
||||
}
|
||||
|
||||
exit $exitCode
|
||||
################################################################################
|
||||
## File: Install-SSDT.ps1
|
||||
## Desc: Install SQL Server Data Tools for Windows
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
#SSDT for Visual Studio 2017 (15.8.2)
|
||||
$InstallerURI = 'https://download.microsoft.com/download/D/F/8/DF8B51B9-8E9F-47F3-A27B-33EEDADD8966/SSDT-Setup-ENU.exe'
|
||||
$InstallerName = 'SSDT-Setup-ENU.exe'
|
||||
$logFilePath = "$env:TEMP\ssdtlog.txt"
|
||||
$ArgumentList = ('/install', 'INSTALLALL', '/passive', '/norestart', "/log `"$logFilePath`"")
|
||||
|
||||
$exitCode = Install-EXE -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentList
|
||||
|
||||
if($exitCode -ne 0 -and $exitCode -ne 3010)
|
||||
{
|
||||
Write-Host "******** SSDT SETUP LOG START ********"
|
||||
Write-Host $(Get-Content $logFilePath | Out-String)
|
||||
Write-Host "******** SSDT SETUP LOG END ********"
|
||||
}
|
||||
|
||||
exit $exitCode
|
||||
|
||||
@@ -1,202 +1,201 @@
|
||||
################################################################################
|
||||
## File: Install-VS2017.ps1
|
||||
## Team: CI-Build
|
||||
## Desc: Install Visual Studio 2017
|
||||
################################################################################
|
||||
|
||||
Function InstallVS
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$WorkLoads,
|
||||
[String]$Sku,
|
||||
[String] $VSBootstrapperURL
|
||||
)
|
||||
|
||||
$exitCode = -1
|
||||
|
||||
try
|
||||
{
|
||||
Write-Host "Enable short name support on Windows needed for Xamarin Android AOT, defaults appear to have been changed in Azure VMs"
|
||||
$shortNameEnableProcess = Start-Process -FilePath fsutil.exe -ArgumentList ('8dot3name', 'set', '0') -Wait -PassThru
|
||||
$shortNameEnableExitCode = $shortNameEnableProcess.ExitCode
|
||||
|
||||
if ($shortNameEnableExitCode -ne 0)
|
||||
{
|
||||
Write-Host -Object 'Enabling short name support on Windows failed. This needs to be enabled prior to VS 2017 install for Xamarin Andriod AOT to work.'
|
||||
exit $shortNameEnableExitCode
|
||||
}
|
||||
|
||||
Write-Host "Downloading Bootstrapper ..."
|
||||
Invoke-WebRequest -Uri $VSBootstrapperURL -OutFile "${env:Temp}\vs_$Sku.exe"
|
||||
|
||||
$FilePath = "${env:Temp}\vs_$Sku.exe"
|
||||
$Arguments = ('/c', $FilePath, $WorkLoads, '--quiet', '--norestart', '--wait', '--nocache' )
|
||||
|
||||
Write-Host "Starting Install ..."
|
||||
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -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."
|
||||
|
||||
# this wont work because of log size limitation in extension manager
|
||||
# Get-Content $customLogFilePath | Write-Host
|
||||
|
||||
exit $exitCode
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host -Object "Failed to install Visual Studio. Check the logs for details in $customLogFilePath"
|
||||
Write-Host -Object $_.Exception.Message
|
||||
exit -1
|
||||
}
|
||||
}
|
||||
|
||||
$WorkLoads = '--allWorkloads --includeRecommended ' + `
|
||||
'--add Microsoft.Net.Component.4.6.2.SDK ' + `
|
||||
'--add Microsoft.Net.Component.4.6.2.TargetingPack ' + `
|
||||
'--add Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools ' + `
|
||||
'--add Microsoft.Net.Component.4.7.SDK ' + `
|
||||
'--add Microsoft.Net.Component.4.7.TargetingPack ' + `
|
||||
'--add Microsoft.Net.ComponentGroup.4.7.DeveloperTools ' + `
|
||||
'--add Microsoft.Net.Component.4.7.1.SDK ' + `
|
||||
'--add Microsoft.Net.Component.4.7.1.TargetingPack ' + `
|
||||
'--add Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools ' + `
|
||||
'--add Microsoft.Net.ComponentGroup.4.7.2.DeveloperTools ' + `
|
||||
'--add Microsoft.Net.Core.Component.SDK.1x ' + `
|
||||
'--add Microsoft.NetCore.1x.ComponentGroup.Web ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Azure.Storage.AzCopy ' + `
|
||||
'--add Microsoft.VisualStudio.Component.PowerShell.Tools ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.140 ' + `
|
||||
'--add Component.Dotfuscator ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATL ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATL.ARM ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATL.ARM64 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATLMFC ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ClangC2 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.CLI.Support ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Modules.x86.x64 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.10240 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.10586 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.14393 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.15063.Desktop ' + `
|
||||
'--add Component.Unreal ' + `
|
||||
'--add Component.Unreal.Android ' + `
|
||||
'--add Component.Android.SDK23 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TestTools.WebLoadTest ' + `
|
||||
'--add Microsoft.VisualStudio.Web.Mvc4.ComponentGroup ' + `
|
||||
'--add Component.Linux.CMake ' + `
|
||||
'--add Microsoft.Component.PythonTools.UWP ' + `
|
||||
'--remove Component.CPython3.x64 ' + `
|
||||
'--add Microsoft.Component.VC.Runtime.OSSupport ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Tools.ARM ' + `
|
||||
'--add Microsoft.VisualStudio.ComponentGroup.UWP.VC ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VSSDK ' + `
|
||||
'--add Microsoft.VisualStudio.Component.LinqToSql ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TestTools.CodedUITest ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TestTools.Core ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TypeScript.2.0 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TypeScript.2.1 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TypeScript.2.2 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.16299.Desktop.arm ' + `
|
||||
'--add Microsoft.VisualStudio.Component.DslTools ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows81SDK ' + `
|
||||
'--add Microsoft.VisualStudio.Component.WinXP ' + `
|
||||
'--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win81 ' + `
|
||||
'--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.WinXP ' + `
|
||||
'--add Microsoft.VisualStudio.ComponentGroup.ArchitectureTools.Managed ' + `
|
||||
'--add Microsoft.Component.Blend.SDK.WPF ' + `
|
||||
'--add Microsoft.Component.VC.Runtime.UCRTSDK ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATL.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATL.ARM.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATL.ARM64.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATLMFC.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.17134 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.17763 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre '+ `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Runtimes.ARM.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre '
|
||||
|
||||
$Sku = 'Enterprise'
|
||||
$VSBootstrapperURL = 'https://aka.ms/vs/15/release/vs_enterprise.exe'
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
# Install VS
|
||||
$exitCode = InstallVS -WorkLoads $WorkLoads -Sku $Sku -VSBootstrapperURL $VSBootstrapperURL
|
||||
|
||||
# Find the version of VS installed for this instance
|
||||
# Only supports a single instance
|
||||
$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
|
||||
}
|
||||
|
||||
$catalogContent = Get-Content -Path ($instanceFolders.FullName + '\catalog.json')
|
||||
$catalog = $catalogContent | ConvertFrom-Json
|
||||
$version = $catalog.info.id
|
||||
$VSInstallRoot = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise"
|
||||
Write-Host "Visual Studio version" $version "installed"
|
||||
|
||||
# Initialize Visual Studio Experimental Instance for integration testing
|
||||
&"$VSInstallRoot\Common7\IDE\devenv.exe" /RootSuffix Exp /ResetSettings General.vssettings /Command File.Exit | Wait-Process
|
||||
|
||||
# Updating content of MachineState.json file to disable autoupdate of VSIX extensions
|
||||
$newContent = '{"Extensions":[{"Key":"1e906ff5-9da8-4091-a299-5c253c55fdc9","Value":{"ShouldAutoUpdate":false}},{"Key":"Microsoft.VisualStudio.Web.AzureFunctions","Value":{"ShouldAutoUpdate":false}}],"ShouldAutoUpdate":false,"ShouldCheckForUpdates":false}'
|
||||
Set-Content -Path "$VSInstallRoot\Common7\IDE\Extensions\MachineState.json" -Value $newContent
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
|
||||
$SoftwareName = "Visual Studio 2017 Enterprise"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
_Location:_ $VSInstallRoot
|
||||
|
||||
The following workloads including required and recommended components are installed with Visual Studio 2017:
|
||||
|
||||
* Universal Windows Platform development
|
||||
* .NET desktop development
|
||||
* Desktop development with C++
|
||||
* ASP.NET and web development
|
||||
* Azure development
|
||||
* Node.js development
|
||||
* Data storage and processing
|
||||
* Data science and analytical applications *
|
||||
* Game development with Unity *
|
||||
* Linux development with C++ *
|
||||
* Game development with C++ *
|
||||
* Mobile development with C++ *
|
||||
* Office/SharePoint development
|
||||
* Mobile development with .NET
|
||||
* .NET Core cross-platform development
|
||||
* Visual Studio extension development *
|
||||
* Python development *
|
||||
* Mobile development with JavaScript *
|
||||
|
||||
In addition the following optional components are installed:
|
||||
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
# Adding explicitly added Workloads details to markdown by parsing $Workloads
|
||||
Add-ContentToMarkdown -Content $($WorkLoads.Split('--') | % { if( ($_.Split(" "))[0] -like "add") { "* " +($_.Split(" "))[1] } } )
|
||||
|
||||
|
||||
|
||||
exit $exitCode
|
||||
################################################################################
|
||||
## File: Install-VS2017.ps1
|
||||
## Desc: Install Visual Studio 2017
|
||||
################################################################################
|
||||
|
||||
Function InstallVS
|
||||
{
|
||||
Param
|
||||
(
|
||||
[String]$WorkLoads,
|
||||
[String]$Sku,
|
||||
[String] $VSBootstrapperURL
|
||||
)
|
||||
|
||||
$exitCode = -1
|
||||
|
||||
try
|
||||
{
|
||||
Write-Host "Enable short name support on Windows needed for Xamarin Android AOT, defaults appear to have been changed in Azure VMs"
|
||||
$shortNameEnableProcess = Start-Process -FilePath fsutil.exe -ArgumentList ('8dot3name', 'set', '0') -Wait -PassThru
|
||||
$shortNameEnableExitCode = $shortNameEnableProcess.ExitCode
|
||||
|
||||
if ($shortNameEnableExitCode -ne 0)
|
||||
{
|
||||
Write-Host -Object 'Enabling short name support on Windows failed. This needs to be enabled prior to VS 2017 install for Xamarin Andriod AOT to work.'
|
||||
exit $shortNameEnableExitCode
|
||||
}
|
||||
|
||||
Write-Host "Downloading Bootstrapper ..."
|
||||
Invoke-WebRequest -Uri $VSBootstrapperURL -OutFile "${env:Temp}\vs_$Sku.exe"
|
||||
|
||||
$FilePath = "${env:Temp}\vs_$Sku.exe"
|
||||
$Arguments = ('/c', $FilePath, $WorkLoads, '--quiet', '--norestart', '--wait', '--nocache' )
|
||||
|
||||
Write-Host "Starting Install ..."
|
||||
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -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."
|
||||
|
||||
# this wont work because of log size limitation in extension manager
|
||||
# Get-Content $customLogFilePath | Write-Host
|
||||
|
||||
exit $exitCode
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host -Object "Failed to install Visual Studio. Check the logs for details in $customLogFilePath"
|
||||
Write-Host -Object $_.Exception.Message
|
||||
exit -1
|
||||
}
|
||||
}
|
||||
|
||||
$WorkLoads = '--allWorkloads --includeRecommended ' + `
|
||||
'--add Microsoft.Net.Component.4.6.2.SDK ' + `
|
||||
'--add Microsoft.Net.Component.4.6.2.TargetingPack ' + `
|
||||
'--add Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools ' + `
|
||||
'--add Microsoft.Net.Component.4.7.SDK ' + `
|
||||
'--add Microsoft.Net.Component.4.7.TargetingPack ' + `
|
||||
'--add Microsoft.Net.ComponentGroup.4.7.DeveloperTools ' + `
|
||||
'--add Microsoft.Net.Component.4.7.1.SDK ' + `
|
||||
'--add Microsoft.Net.Component.4.7.1.TargetingPack ' + `
|
||||
'--add Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools ' + `
|
||||
'--add Microsoft.Net.ComponentGroup.4.7.2.DeveloperTools ' + `
|
||||
'--add Microsoft.Net.Core.Component.SDK.1x ' + `
|
||||
'--add Microsoft.NetCore.1x.ComponentGroup.Web ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Azure.Storage.AzCopy ' + `
|
||||
'--add Microsoft.VisualStudio.Component.PowerShell.Tools ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.140 ' + `
|
||||
'--add Component.Dotfuscator ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATL ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATL.ARM ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATL.ARM64 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATLMFC ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ClangC2 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.CLI.Support ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Modules.x86.x64 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.10240 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.10586 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.14393 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.15063.Desktop ' + `
|
||||
'--add Component.Unreal ' + `
|
||||
'--add Component.Unreal.Android ' + `
|
||||
'--add Component.Android.SDK23 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TestTools.WebLoadTest ' + `
|
||||
'--add Microsoft.VisualStudio.Web.Mvc4.ComponentGroup ' + `
|
||||
'--add Component.Linux.CMake ' + `
|
||||
'--add Microsoft.Component.PythonTools.UWP ' + `
|
||||
'--remove Component.CPython3.x64 ' + `
|
||||
'--add Microsoft.Component.VC.Runtime.OSSupport ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Tools.ARM ' + `
|
||||
'--add Microsoft.VisualStudio.ComponentGroup.UWP.VC ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VSSDK ' + `
|
||||
'--add Microsoft.VisualStudio.Component.LinqToSql ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TestTools.CodedUITest ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TestTools.Core ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TypeScript.2.0 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TypeScript.2.1 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TypeScript.2.2 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.16299.Desktop.arm ' + `
|
||||
'--add Microsoft.VisualStudio.Component.DslTools ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows81SDK ' + `
|
||||
'--add Microsoft.VisualStudio.Component.WinXP ' + `
|
||||
'--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win81 ' + `
|
||||
'--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.WinXP ' + `
|
||||
'--add Microsoft.VisualStudio.ComponentGroup.ArchitectureTools.Managed ' + `
|
||||
'--add Microsoft.Component.Blend.SDK.WPF ' + `
|
||||
'--add Microsoft.Component.VC.Runtime.UCRTSDK ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATL.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATL.ARM.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATL.ARM64.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATLMFC.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.17134 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.17763 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre '+ `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Runtimes.ARM.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre '
|
||||
|
||||
$Sku = 'Enterprise'
|
||||
$VSBootstrapperURL = 'https://aka.ms/vs/15/release/vs_enterprise.exe'
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
# Install VS
|
||||
$exitCode = InstallVS -WorkLoads $WorkLoads -Sku $Sku -VSBootstrapperURL $VSBootstrapperURL
|
||||
|
||||
# Find the version of VS installed for this instance
|
||||
# Only supports a single instance
|
||||
$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
|
||||
}
|
||||
|
||||
$catalogContent = Get-Content -Path ($instanceFolders.FullName + '\catalog.json')
|
||||
$catalog = $catalogContent | ConvertFrom-Json
|
||||
$version = $catalog.info.id
|
||||
$VSInstallRoot = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise"
|
||||
Write-Host "Visual Studio version" $version "installed"
|
||||
|
||||
# Initialize Visual Studio Experimental Instance for integration testing
|
||||
&"$VSInstallRoot\Common7\IDE\devenv.exe" /RootSuffix Exp /ResetSettings General.vssettings /Command File.Exit | Wait-Process
|
||||
|
||||
# Updating content of MachineState.json file to disable autoupdate of VSIX extensions
|
||||
$newContent = '{"Extensions":[{"Key":"1e906ff5-9da8-4091-a299-5c253c55fdc9","Value":{"ShouldAutoUpdate":false}},{"Key":"Microsoft.VisualStudio.Web.AzureFunctions","Value":{"ShouldAutoUpdate":false}}],"ShouldAutoUpdate":false,"ShouldCheckForUpdates":false}'
|
||||
Set-Content -Path "$VSInstallRoot\Common7\IDE\Extensions\MachineState.json" -Value $newContent
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
|
||||
$SoftwareName = "Visual Studio 2017 Enterprise"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
_Location:_ $VSInstallRoot
|
||||
|
||||
The following workloads including required and recommended components are installed with Visual Studio 2017:
|
||||
|
||||
* Universal Windows Platform development
|
||||
* .NET desktop development
|
||||
* Desktop development with C++
|
||||
* ASP.NET and web development
|
||||
* Azure development
|
||||
* Node.js development
|
||||
* Data storage and processing
|
||||
* Data science and analytical applications *
|
||||
* Game development with Unity *
|
||||
* Linux development with C++ *
|
||||
* Game development with C++ *
|
||||
* Mobile development with C++ *
|
||||
* Office/SharePoint development
|
||||
* Mobile development with .NET
|
||||
* .NET Core cross-platform development
|
||||
* Visual Studio extension development *
|
||||
* Python development *
|
||||
* Mobile development with JavaScript *
|
||||
|
||||
In addition the following optional components are installed:
|
||||
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
# Adding explicitly added Workloads details to markdown by parsing $Workloads
|
||||
Add-ContentToMarkdown -Content $($WorkLoads.Split('--') | % { if( ($_.Split(" "))[0] -like "add") { "* " +($_.Split(" "))[1] } } )
|
||||
|
||||
|
||||
|
||||
exit $exitCode
|
||||
|
||||
@@ -1,52 +1,51 @@
|
||||
################################################################################
|
||||
## File: Install-WDK.ps1
|
||||
## Team: CI-X
|
||||
## 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
|
||||
################################################################################
|
||||
## 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
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
################################################################################
|
||||
## File: Install-Win81SDK.ps1
|
||||
## Team: CI-Platform
|
||||
## Desc: Install Windows 8.1 SDK
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$InstallerURI = 'http://download.microsoft.com/download/B/0/C/B0C80BA3-8AD6-4958-810B-6882485230B5/standalonesdk/sdksetup.exe'
|
||||
$InstallerName = 'sdksetup.exe'
|
||||
$ArgumentList = ('/quiet', '/norestart')
|
||||
|
||||
$exitCode = Install-EXE -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentList
|
||||
|
||||
exit $exitCode
|
||||
################################################################################
|
||||
## File: Install-Win81SDK.ps1
|
||||
## Desc: Install Windows 8.1 SDK
|
||||
################################################################################
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
$InstallerURI = 'http://download.microsoft.com/download/B/0/C/B0C80BA3-8AD6-4958-810B-6882485230B5/standalonesdk/sdksetup.exe'
|
||||
$InstallerName = 'sdksetup.exe'
|
||||
$ArgumentList = ('/quiet', '/norestart')
|
||||
|
||||
$exitCode = Install-EXE -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentList
|
||||
|
||||
exit $exitCode
|
||||
|
||||
@@ -1,54 +1,53 @@
|
||||
################################################################################
|
||||
## File: Install-Wix.ps1
|
||||
## Team: CI-Build
|
||||
## 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
|
||||
################################################################################
|
||||
## 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
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
################################################################################
|
||||
## File: Run-Antivirus.ps1
|
||||
## Team: CI-Platform
|
||||
## Desc: Run a full antivirus scan.
|
||||
## Run right after cleanup before we sysprep
|
||||
################################################################################
|
||||
|
||||
Write-Host "Run antivirus"
|
||||
Push-Location "C:\Program Files\Windows Defender"
|
||||
|
||||
# Tell Defender to use 100% of the CPU during the scan
|
||||
Set-MpPreference -ScanAvgCPULoadFactor 100
|
||||
|
||||
# Full Scan
|
||||
.\MpCmdRun.exe -Scan -ScanType 2
|
||||
Pop-Location
|
||||
|
||||
Write-Host "Set antivirus parmeters"
|
||||
Set-MpPreference -ScanAvgCPULoadFactor 5 `
|
||||
-ExclusionPath "D:\", "C:\"
|
||||
################################################################################
|
||||
## File: Run-Antivirus.ps1
|
||||
## Desc: Run a full antivirus scan.
|
||||
## Run right after cleanup before we sysprep
|
||||
################################################################################
|
||||
|
||||
Write-Host "Run antivirus"
|
||||
Push-Location "C:\Program Files\Windows Defender"
|
||||
|
||||
# Tell Defender to use 100% of the CPU during the scan
|
||||
Set-MpPreference -ScanAvgCPULoadFactor 100
|
||||
|
||||
# Full Scan
|
||||
.\MpCmdRun.exe -Scan -ScanType 2
|
||||
Pop-Location
|
||||
|
||||
Write-Host "Set antivirus parmeters"
|
||||
Set-MpPreference -ScanAvgCPULoadFactor 5 `
|
||||
-ExclusionPath "D:\", "C:\"
|
||||
|
||||
@@ -1,36 +1,35 @@
|
||||
################################################################################
|
||||
## File: Update-DockerImages.ps1
|
||||
## Team: ReleaseManagement
|
||||
## Desc: Pull some standard docker images.
|
||||
## Must be run after docker is installed.
|
||||
################################################################################
|
||||
|
||||
function DockerPull {
|
||||
Param ([string]$image)
|
||||
|
||||
Write-Host Installing $image ...
|
||||
docker pull $image
|
||||
|
||||
if (!$?) {
|
||||
echo "Docker pull failed with a non-zero exit code"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
DockerPull mcr.microsoft.com/windows/servercore:ltsc2016
|
||||
DockerPull mcr.microsoft.com/windows/nanoserver:10.0.14393.953
|
||||
DockerPull microsoft/aspnetcore-build:1.0-2.0
|
||||
DockerPull mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2016
|
||||
DockerPull mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2016
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
|
||||
$SoftwareName = "Docker images"
|
||||
|
||||
$Description = @"
|
||||
The following container images have been cached:
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
Add-ContentToMarkdown -Content $(docker images --digests --format "* {{.Repository}}:{{.Tag}} (Digest: {{.Digest}})")
|
||||
################################################################################
|
||||
## File: Update-DockerImages.ps1
|
||||
## Desc: Pull some standard docker images.
|
||||
## Must be run after docker is installed.
|
||||
################################################################################
|
||||
|
||||
function DockerPull {
|
||||
Param ([string]$image)
|
||||
|
||||
Write-Host Installing $image ...
|
||||
docker pull $image
|
||||
|
||||
if (!$?) {
|
||||
echo "Docker pull failed with a non-zero exit code"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
DockerPull mcr.microsoft.com/windows/servercore:ltsc2016
|
||||
DockerPull mcr.microsoft.com/windows/nanoserver:10.0.14393.953
|
||||
DockerPull microsoft/aspnetcore-build:1.0-2.0
|
||||
DockerPull mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2016
|
||||
DockerPull mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2016
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
|
||||
$SoftwareName = "Docker images"
|
||||
|
||||
$Description = @"
|
||||
The following container images have been cached:
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
Add-ContentToMarkdown -Content $(docker images --digests --format "* {{.Repository}}:{{.Tag}} (Digest: {{.Digest}})")
|
||||
|
||||
@@ -1,51 +1,50 @@
|
||||
################################################################################
|
||||
## File: Validate-SSDT.ps1
|
||||
## Team: CI-Platform
|
||||
## Desc: Validate SQL Server Data Tools for Windows
|
||||
################################################################################
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "SQL Server Data Tools for VS 2017"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $($SsdtPackage.version)<br/>
|
||||
|
||||
The following components are installed:
|
||||
|
||||
* SQL Server Data Tools
|
||||
* SQL Server Analysis Services Designer
|
||||
* SQL Server Integration Services Designer
|
||||
* SQL Server Reporting Services Designers
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
################################################################################
|
||||
## File: Validate-SSDT.ps1
|
||||
## Desc: Validate SQL Server Data Tools for Windows
|
||||
################################################################################
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "SQL Server Data Tools for VS 2017"
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $($SsdtPackage.version)<br/>
|
||||
|
||||
The following components are installed:
|
||||
|
||||
* SQL Server Data Tools
|
||||
* SQL Server Analysis Services Designer
|
||||
* SQL Server Integration Services Designer
|
||||
* SQL Server Reporting Services Designers
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
################################################################################
|
||||
## File: Validate-WDK.ps1
|
||||
## Team: CI-X
|
||||
## 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
|
||||
################################################################################
|
||||
## 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
|
||||
|
||||
@@ -1,63 +1,62 @@
|
||||
################################################################################
|
||||
## File: Validate-Wix.ps1
|
||||
## Team: CI-Build
|
||||
## 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
|
||||
################################################################################
|
||||
## 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
|
||||
|
||||
Reference in New Issue
Block a user