mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-14 05:48:07 +00:00
Implement new Pester Tests for Visual Studio (#1251)
* implement pester tests for visual studio * fix components list
This commit is contained in:
committed by
GitHub
parent
99bd7bf035
commit
532b49be6f
@@ -89,6 +89,16 @@
|
||||
"source": "{{ template_dir }}/scripts/Tests",
|
||||
"destination": "{{user `image_folder`}}"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{template_dir}}/toolsets/toolcache-2016.json",
|
||||
"destination": "{{user `root_folder`}}/toolcache.json"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{template_dir}}/toolsets/toolset-2016.json",
|
||||
"destination": "{{user `toolset_json_path`}}"
|
||||
},
|
||||
{
|
||||
"type": "windows-shell",
|
||||
"inline": [
|
||||
@@ -179,6 +189,9 @@
|
||||
0,
|
||||
3010
|
||||
],
|
||||
"environment_vars":[
|
||||
"TOOLSET_JSON_PATH={{user `toolset_json_path`}}"
|
||||
],
|
||||
"scripts":[
|
||||
"{{ template_dir }}/scripts/Installers/Windows2016/Install-VS2017.ps1"
|
||||
],
|
||||
@@ -317,16 +330,6 @@
|
||||
"{{ template_dir }}/scripts/Installers/Install-Packer.ps1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{template_dir}}/toolsets/toolcache-2016.json",
|
||||
"destination": "{{user `root_folder`}}/toolcache.json"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{template_dir}}/toolsets/toolset-2016.json",
|
||||
"destination": "{{user `toolset_json_path`}}"
|
||||
},
|
||||
{
|
||||
"type": "powershell",
|
||||
"environment_vars":[
|
||||
|
||||
@@ -89,6 +89,16 @@
|
||||
"source": "{{ template_dir }}/scripts/Tests",
|
||||
"destination": "{{user `image_folder`}}"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{template_dir}}/toolsets/toolcache-2019.json",
|
||||
"destination": "{{user `root_folder`}}/toolcache.json"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{template_dir}}/toolsets/toolset-2019.json",
|
||||
"destination": "{{user `toolset_json_path`}}"
|
||||
},
|
||||
{
|
||||
"type": "windows-shell",
|
||||
"inline": [
|
||||
@@ -187,6 +197,9 @@
|
||||
0,
|
||||
3010
|
||||
],
|
||||
"environment_vars":[
|
||||
"TOOLSET_JSON_PATH={{user `toolset_json_path`}}"
|
||||
],
|
||||
"scripts":[
|
||||
"{{ template_dir }}/scripts/Installers/Windows2019/Install-VS2019.ps1"
|
||||
],
|
||||
@@ -292,16 +305,6 @@
|
||||
"{{ template_dir }}/scripts/Installers/Install-Packer.ps1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{template_dir}}/toolsets/toolcache-2019.json",
|
||||
"destination": "{{user `root_folder`}}/toolcache.json"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{template_dir}}/toolsets/toolset-2019.json",
|
||||
"destination": "{{user `toolset_json_path`}}"
|
||||
},
|
||||
{
|
||||
"type": "powershell",
|
||||
"environment_vars":[
|
||||
|
||||
@@ -33,5 +33,9 @@ Export-ModuleMember -Function @(
|
||||
'Get-WhichTool'
|
||||
'Get-EnvironmentVariable'
|
||||
'Invoke-PesterTests'
|
||||
'Get-VsCatalogJsonPath'
|
||||
'Get-VisualStudioPath'
|
||||
'Install-AndroidSDKPackages'
|
||||
'Get-VisualStudioPackages'
|
||||
'Get-VisualStudioComponents'
|
||||
)
|
||||
|
||||
@@ -464,6 +464,36 @@ function Extract-7Zip {
|
||||
}
|
||||
}
|
||||
|
||||
function Get-VsCatalogJsonPath {
|
||||
$instanceFolder = Get-Item "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances\*" | Select-Object -First 1
|
||||
return Join-Path $instanceFolder.FullName "catalog.json"
|
||||
}
|
||||
|
||||
function Get-VisualStudioPath {
|
||||
Param
|
||||
(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$Version,
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$Edition
|
||||
)
|
||||
|
||||
return "${env:ProgramFiles(x86)}\Microsoft Visual Studio\${Version}\${Edition}"
|
||||
}
|
||||
|
||||
function Get-VisualStudioPackages
|
||||
{
|
||||
$packagePath = "$env:ProgramData\Microsoft\VisualStudio\Packages\_Instances\*\state.packages.json"
|
||||
$instanceFolders = Get-ChildItem -Path $packagePath
|
||||
(Get-Content -Path $instanceFolders | ConvertFrom-Json).packages
|
||||
}
|
||||
|
||||
function Get-VisualStudioComponents {
|
||||
$vsPackages = Get-VisualStudioPackages | Where-Object type -in 'Component', 'Workload'
|
||||
$vsPackages | Sort-Object Id | Select-Object @{n = 'Package'; e = {$_.Id}} |
|
||||
Where-Object { $_.Package -notmatch "[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}" }
|
||||
}
|
||||
|
||||
function Install-AndroidSDKPackages {
|
||||
Param
|
||||
(
|
||||
|
||||
@@ -5,86 +5,20 @@
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
$toolset = Get-ToolsetContent
|
||||
$requiredComponents = $toolset.visualStudio.workloads | ForEach-Object { "--add $_" }
|
||||
$workLoads = @(
|
||||
"--allWorkloads --includeRecommended"
|
||||
$requiredComponents
|
||||
"--remove Component.CPython3.x64"
|
||||
)
|
||||
$workLoadsArgument = [String]::Join(" ", $workLoads)
|
||||
|
||||
$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.Component.4.7.2.SDK ' + `
|
||||
'--add Microsoft.Net.Component.4.7.2.TargetingPack ' + `
|
||||
'--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.Sharepoint.BuildTools ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TeamOffice.BuildTools ' + `
|
||||
'--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 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Workflow.BuildTools ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.Office ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.OfficeBuildTools '
|
||||
|
||||
$ReleaseInPath = "Enterprise"
|
||||
$BootstrapperUrl = "https://aka.ms/vs/15/release/vs_${ReleaseInPath}.exe"
|
||||
$releaseInPath = $toolset.visualStudio.edition
|
||||
$bootstrapperUrl = "https://aka.ms/vs/15/release/vs_${releaseInPath}.exe"
|
||||
|
||||
# Install VS
|
||||
Install-VisualStudio -BootstrapperUrl $BootstrapperUrl -WorkLoads $WorkLoads
|
||||
Install-VisualStudio -BootstrapperUrl $bootstrapperUrl -WorkLoads $workLoadsArgument
|
||||
|
||||
# Find the version of VS installed for this instance
|
||||
# Only supports a single instance
|
||||
@@ -97,15 +31,14 @@ if ($instanceFolders -is [array])
|
||||
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\$ReleaseInPath"
|
||||
Write-Host "Visual Studio version ${version} installed"
|
||||
$visualStudioVersion = $toolset.visualStudio.version
|
||||
$vsInstallRoot = Get-VisualStudioPath -Version $visualStudioVersion -Edition $releaseInPath
|
||||
|
||||
# Initialize Visual Studio Experimental Instance for integration testing
|
||||
& "$VSInstallRoot\Common7\IDE\devenv.exe" /RootSuffix Exp /ResetSettings General.vssettings /Command File.Exit | Wait-Process
|
||||
& "$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
|
||||
Set-Content -Path "$vsInstallRoot\Common7\IDE\Extensions\MachineState.json" -Value $newContent
|
||||
|
||||
Invoke-PesterTests -TestFile "VisualStudio"
|
||||
@@ -2,114 +2,23 @@
|
||||
## File: Install-VS2019.ps1
|
||||
## Desc: Install Visual Studio 2019
|
||||
################################################################################
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
$toolset = Get-ToolsetContent
|
||||
$requiredComponents = $toolset.visualStudio.workloads | ForEach-Object { "--add $_" }
|
||||
$workLoads = @(
|
||||
"--allWorkloads --includeRecommended"
|
||||
$requiredComponents
|
||||
"--remove Component.CPython3.x64"
|
||||
)
|
||||
$workLoadsArgument = [String]::Join(" ", $workLoads)
|
||||
|
||||
$WorkLoads = '--allWorkloads --includeRecommended ' + `
|
||||
'--add Component.Dotfuscator ' + `
|
||||
'--add Component.Linux.CMake ' + `
|
||||
'--add Component.UnityEngine.x64 ' + `
|
||||
'--add Component.UnityEngine.x86 ' + `
|
||||
'--add Component.Unreal.Android ' + `
|
||||
'--add Microsoft.Component.Azure.DataLake.Tools ' + `
|
||||
'--add Microsoft.Component.CookiecutterTools ' + `
|
||||
'--add Microsoft.Component.PythonTools.Miniconda ' + `
|
||||
'--add Microsoft.Component.PythonTools.Web ' + `
|
||||
'--add Microsoft.Component.VC.Runtime.UCRTSDK ' + `
|
||||
'--add Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools ' + `
|
||||
'--add Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools ' + `
|
||||
'--add Microsoft.Net.Component.4.7.2.SDK ' + `
|
||||
'--add Microsoft.Net.Component.4.7.2.TargetingPack ' + `
|
||||
'--add Microsoft.Net.ComponentGroup.4.7.2.DeveloperTools ' + `
|
||||
'--add Microsoft.Net.ComponentGroup.4.7.DeveloperTools ' + `
|
||||
'--add Microsoft.VisualStudio.Component.AspNet45 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Azure.Kubernetes.Tools ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Azure.MobileAppsSdk ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Azure.ServiceFabric.Tools ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Azure.Storage.AzCopy ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Debugger.JustInTime ' + `
|
||||
'--add Microsoft.VisualStudio.Component.DslTools ' + `
|
||||
'--add Microsoft.VisualStudio.Component.EntityFramework ' + `
|
||||
'--add Microsoft.VisualStudio.Component.FSharp.Desktop ' + `
|
||||
'--add Microsoft.VisualStudio.Component.LinqToSql ' + `
|
||||
'--add Microsoft.VisualStudio.Component.SQL.SSDT ' + `
|
||||
'--add Microsoft.VisualStudio.Component.PortableLibrary ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Sharepoint.BuildTools ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TeamOffice ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TeamOffice.BuildTools ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TestTools.CodedUITest ' + `
|
||||
'--add Microsoft.VisualStudio.Component.TestTools.WebLoadTest ' + `
|
||||
'--add Microsoft.VisualStudio.Component.UWP.VC.ARM64 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.140 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATL.ARM ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATLMFC ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.ATLMFC.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.CLI.Support ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.CMake.Project ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.DiagnosticTools ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.MFC.ARM ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.MFC.ARM.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.MFC.ARM64 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.MFC.ARM64.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Redist.MSM ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Runtimes.ARM.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.v141 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.v141.x86.x64 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.v141.x86.x64.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.v141.ARM.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.v141.ARM64.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.v141.ATL ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.v141.ATL.ARM.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.v141.ATL.ARM64.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.v141.ATL.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.v141.MFC ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.v141.MFC.ARM.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.v141.MFC.ARM64.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.v141.MFC.Spectre ' + `
|
||||
'--add Microsoft.VisualStudio.Component.VC.14.25.x86.x64 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.16299 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.17134 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.17763 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.18362 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.19041 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.WinXP ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Workflow.BuildTools ' + `
|
||||
'--add Microsoft.VisualStudio.ComponentGroup.Azure.CloudServices ' + `
|
||||
'--add Microsoft.VisualStudio.ComponentGroup.Azure.ResourceManager.Tools ' + `
|
||||
'--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang ' + `
|
||||
'--add Microsoft.VisualStudio.ComponentGroup.Web.CloudTools ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.Azure ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.Data ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.DataScience ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.ManagedDesktop ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.ManagedGame ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.NativeCrossPlat ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.NativeDesktop ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.NativeGame ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.NativeMobile ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.NetCoreTools ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.NetCrossPlat ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.NetWeb ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.Node ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.Office ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.Python ' + `
|
||||
'--remove Component.CPython3.x64 ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.Universal ' + `
|
||||
'--add Microsoft.VisualStudio.Workload.VisualStudioExtension ' + `
|
||||
'--add Component.MDD.Linux ' + `
|
||||
'--add Component.MDD.Linux.GCC.arm'
|
||||
|
||||
$ReleaseInPath = "Enterprise"
|
||||
$BootstrapperUrl = "https://aka.ms/vs/16/release/vs_${ReleaseInPath}.exe"
|
||||
$releaseInPath = $toolset.visualStudio.edition
|
||||
$bootstrapperUrl = "https://aka.ms/vs/16/release/vs_${releaseInPath}.exe"
|
||||
|
||||
# Install VS
|
||||
Install-VisualStudio -BootstrapperUrl $BootstrapperUrl -WorkLoads $WorkLoads
|
||||
Install-VisualStudio -BootstrapperUrl $bootstrapperUrl -WorkLoads $workLoadsArgument
|
||||
|
||||
# Find the version of VS installed for this instance
|
||||
# Only supports a single instance
|
||||
@@ -122,18 +31,15 @@ if ($instanceFolders -is [array])
|
||||
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\2019\$ReleaseInPath"
|
||||
Write-Host "Visual Studio version ${version} installed"
|
||||
$visualStudioVersion = $toolset.visualStudio.version
|
||||
$vsInstallRoot = Get-VisualStudioPath -Version $visualStudioVersion -Edition $releaseInPath
|
||||
|
||||
# Initialize Visual Studio Experimental Instance
|
||||
& "$VSInstallRoot\Common7\IDE\devenv.exe" /RootSuffix Exp /ResetSettings General.vssettings /Command File.Exit
|
||||
& "$vsInstallRoot\Common7\IDE\devenv.exe" /RootSuffix Exp /ResetSettings General.vssettings /Command File.Exit
|
||||
|
||||
# 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
|
||||
Set-Content -Path "$vsInstallRoot\Common7\IDE\Extensions\MachineState.json" -Value $newContent
|
||||
|
||||
# Install Windows 10 SDK version 10.0.14393.795
|
||||
$sdkUrl = "https://go.microsoft.com/fwlink/p/?LinkId=838916"
|
||||
@@ -141,3 +47,5 @@ $sdkFileName = "sdksetup14393.exe"
|
||||
$argumentList = ("/q", "/norestart", "/ceip off", "/features OptionId.WindowsSoftwareDevelopmentKit")
|
||||
|
||||
Install-Binary -Url $sdkUrl -Name $sdkFileName -ArgumentList $argumentList
|
||||
|
||||
Invoke-PesterTests -TestFile "VisualStudio"
|
||||
27
images/win/scripts/Tests/VisualStudio.Tests.ps1
Normal file
27
images/win/scripts/Tests/VisualStudio.Tests.ps1
Normal file
@@ -0,0 +1,27 @@
|
||||
Describe "Visual Studio" {
|
||||
Context "Basic" {
|
||||
It "Catalog.json" {
|
||||
Get-VsCatalogJsonPath | Should -Exist
|
||||
}
|
||||
|
||||
It "Devenv.exe" {
|
||||
$visualStudioEdition = Get-ToolsetContent | Select-Object -ExpandProperty visualStudio | Select-Object -ExpandProperty edition
|
||||
$visualStudioVersion = Get-ToolsetContent | Select-Object -ExpandProperty visualStudio | Select-Object -ExpandProperty version
|
||||
$vsInstallRoot = Get-VisualStudioPath -Version $visualStudioVersion -Edition $visualStudioEdition
|
||||
$devenvexePath = "${vsInstallRoot}\Common7\IDE\devenv.exe"
|
||||
$devenvexePath | Should -Exist
|
||||
}
|
||||
}
|
||||
|
||||
Context "Visual Studio components" {
|
||||
$expectedComponents = Get-ToolsetContent | Select-Object -ExpandProperty visualStudio | Select-Object -ExpandProperty workloads
|
||||
$testCases = $expectedComponents | ForEach-Object { @{ComponentName = $_} }
|
||||
BeforeAll {
|
||||
$installedComponents = Get-VisualStudioComponents | Select-Object -ExpandProperty Package
|
||||
}
|
||||
|
||||
It "<ComponentName>" -TestCases $testCases {
|
||||
$installedComponents | Should -Contain $ComponentName
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -142,5 +142,79 @@
|
||||
"patcher;v4",
|
||||
"ndk-bundle"
|
||||
]
|
||||
},
|
||||
"visualStudio": {
|
||||
"version" : "2017",
|
||||
"edition" : "Enterprise",
|
||||
"workloads": [
|
||||
"Microsoft.Net.Component.4.6.2.SDK",
|
||||
"Microsoft.Net.Component.4.6.2.TargetingPack",
|
||||
"Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools",
|
||||
"Microsoft.Net.Component.4.7.SDK",
|
||||
"Microsoft.Net.Component.4.7.TargetingPack",
|
||||
"Microsoft.Net.ComponentGroup.4.7.DeveloperTools",
|
||||
"Microsoft.Net.Component.4.7.1.SDK",
|
||||
"Microsoft.Net.Component.4.7.1.TargetingPack",
|
||||
"Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools",
|
||||
"Microsoft.Net.Component.4.7.2.SDK",
|
||||
"Microsoft.Net.Component.4.7.2.TargetingPack",
|
||||
"Microsoft.Net.ComponentGroup.4.7.2.DeveloperTools",
|
||||
"Microsoft.Net.Core.Component.SDK.1x",
|
||||
"Microsoft.NetCore.1x.ComponentGroup.Web",
|
||||
"Microsoft.VisualStudio.Component.Azure.Storage.AzCopy",
|
||||
"Microsoft.VisualStudio.Component.VC.140",
|
||||
"Component.Dotfuscator",
|
||||
"Microsoft.VisualStudio.Component.VC.ATL",
|
||||
"Microsoft.VisualStudio.Component.VC.ATL.ARM",
|
||||
"Microsoft.VisualStudio.Component.VC.ATL.ARM64",
|
||||
"Microsoft.VisualStudio.Component.VC.ATLMFC",
|
||||
"Microsoft.VisualStudio.Component.VC.ClangC2",
|
||||
"Microsoft.VisualStudio.Component.VC.CLI.Support",
|
||||
"Microsoft.VisualStudio.Component.VC.Modules.x86.x64",
|
||||
"Microsoft.VisualStudio.Component.Windows10SDK.10240",
|
||||
"Microsoft.VisualStudio.Component.Windows10SDK.10586",
|
||||
"Microsoft.VisualStudio.Component.Windows10SDK.14393",
|
||||
"Microsoft.VisualStudio.Component.Windows10SDK.15063.Desktop",
|
||||
"Component.Unreal",
|
||||
"Component.Unreal.Android",
|
||||
"Component.Android.SDK23",
|
||||
"Microsoft.VisualStudio.Component.TestTools.WebLoadTest",
|
||||
"Microsoft.VisualStudio.Web.Mvc4.ComponentGroup",
|
||||
"Component.Linux.CMake",
|
||||
"Microsoft.Component.PythonTools.UWP",
|
||||
"Microsoft.Component.VC.Runtime.OSSupport",
|
||||
"Microsoft.VisualStudio.Component.VC.Tools.ARM",
|
||||
"Microsoft.VisualStudio.ComponentGroup.UWP.VC",
|
||||
"Microsoft.VisualStudio.Component.VSSDK",
|
||||
"Microsoft.VisualStudio.Component.LinqToSql",
|
||||
"Microsoft.VisualStudio.Component.TestTools.CodedUITest",
|
||||
"Microsoft.VisualStudio.Component.TestTools.Core",
|
||||
"Microsoft.VisualStudio.Component.TypeScript.2.0",
|
||||
"Microsoft.VisualStudio.Component.TypeScript.2.1",
|
||||
"Microsoft.VisualStudio.Component.TypeScript.2.2",
|
||||
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
|
||||
"Microsoft.VisualStudio.Component.Windows10SDK.16299.Desktop.arm",
|
||||
"Microsoft.VisualStudio.Component.DslTools",
|
||||
"Microsoft.VisualStudio.Component.Windows81SDK",
|
||||
"Microsoft.VisualStudio.Component.WinXP",
|
||||
"Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win81",
|
||||
"Microsoft.VisualStudio.ComponentGroup.NativeDesktop.WinXP",
|
||||
"Microsoft.VisualStudio.ComponentGroup.ArchitectureTools.Managed",
|
||||
"Microsoft.Component.Blend.SDK.WPF",
|
||||
"Microsoft.Component.VC.Runtime.UCRTSDK",
|
||||
"Microsoft.VisualStudio.Component.Sharepoint.Tools",
|
||||
"Microsoft.VisualStudio.Component.TeamOffice",
|
||||
"Microsoft.VisualStudio.Component.VC.ATL.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.ATL.ARM.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.ATL.ARM64.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.ATLMFC.Spectre",
|
||||
"Microsoft.VisualStudio.Component.Windows10SDK.17134",
|
||||
"Microsoft.VisualStudio.Component.Windows10SDK.17763",
|
||||
"Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.Runtimes.ARM.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre",
|
||||
"Microsoft.VisualStudio.Component.Workflow",
|
||||
"Microsoft.VisualStudio.Workload.Office"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -151,5 +151,101 @@
|
||||
"patcher;v4",
|
||||
"ndk-bundle"
|
||||
]
|
||||
},
|
||||
"visualStudio": {
|
||||
"version" : "2019",
|
||||
"edition" : "Enterprise",
|
||||
"workloads": [
|
||||
"Component.Dotfuscator",
|
||||
"Component.Linux.CMake",
|
||||
"Component.UnityEngine.x64",
|
||||
"Component.Unreal.Android",
|
||||
"Microsoft.Component.Azure.DataLake.Tools",
|
||||
"Microsoft.Component.PythonTools.Miniconda",
|
||||
"Microsoft.Component.PythonTools.Web",
|
||||
"Microsoft.Component.VC.Runtime.UCRTSDK",
|
||||
"Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools",
|
||||
"Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools",
|
||||
"Microsoft.Net.Component.4.7.2.SDK",
|
||||
"Microsoft.Net.Component.4.7.2.TargetingPack",
|
||||
"Microsoft.Net.ComponentGroup.4.7.DeveloperTools",
|
||||
"Microsoft.VisualStudio.Component.AspNet45",
|
||||
"Microsoft.VisualStudio.Component.Azure.Kubernetes.Tools",
|
||||
"Microsoft.VisualStudio.Component.Azure.ServiceFabric.Tools",
|
||||
"Microsoft.VisualStudio.Component.Azure.Storage.AzCopy",
|
||||
"Microsoft.VisualStudio.Component.Debugger.JustInTime",
|
||||
"Microsoft.VisualStudio.Component.DslTools",
|
||||
"Microsoft.VisualStudio.Component.EntityFramework",
|
||||
"Microsoft.VisualStudio.Component.FSharp.Desktop",
|
||||
"Microsoft.VisualStudio.Component.LinqToSql",
|
||||
"Microsoft.VisualStudio.Component.SQL.SSDT",
|
||||
"Microsoft.VisualStudio.Component.Sharepoint.Tools",
|
||||
"Microsoft.VisualStudio.Component.PortableLibrary",
|
||||
"Microsoft.VisualStudio.Component.TeamOffice",
|
||||
"Microsoft.VisualStudio.Component.TestTools.CodedUITest",
|
||||
"Microsoft.VisualStudio.Component.TestTools.WebLoadTest",
|
||||
"Microsoft.VisualStudio.Component.UWP.VC.ARM64",
|
||||
"Microsoft.VisualStudio.Component.VC.140",
|
||||
"Microsoft.VisualStudio.Component.VC.ATL.ARM",
|
||||
"Microsoft.VisualStudio.Component.VC.ATLMFC",
|
||||
"Microsoft.VisualStudio.Component.VC.ATLMFC.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.CLI.Support",
|
||||
"Microsoft.VisualStudio.Component.VC.CMake.Project",
|
||||
"Microsoft.VisualStudio.Component.VC.DiagnosticTools",
|
||||
"Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset",
|
||||
"Microsoft.VisualStudio.Component.VC.MFC.ARM",
|
||||
"Microsoft.VisualStudio.Component.VC.MFC.ARM.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.MFC.ARM64",
|
||||
"Microsoft.VisualStudio.Component.VC.MFC.ARM64.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.Redist.MSM",
|
||||
"Microsoft.VisualStudio.Component.VC.Runtimes.ARM.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest",
|
||||
"Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest",
|
||||
"Microsoft.VisualStudio.Component.VC.v141.x86.x64",
|
||||
"Microsoft.VisualStudio.Component.VC.v141.x86.x64.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.v141.ARM.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.v141.ARM64.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.v141.ATL",
|
||||
"Microsoft.VisualStudio.Component.VC.v141.ATL.ARM.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.v141.ATL.ARM64.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.v141.ATL.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.v141.MFC",
|
||||
"Microsoft.VisualStudio.Component.VC.v141.MFC.ARM.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.v141.MFC.ARM64.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.v141.MFC.Spectre",
|
||||
"Microsoft.VisualStudio.Component.VC.14.25.x86.x64",
|
||||
"Microsoft.VisualStudio.Component.Windows10SDK.16299",
|
||||
"Microsoft.VisualStudio.Component.Windows10SDK.17134",
|
||||
"Microsoft.VisualStudio.Component.Windows10SDK.17763",
|
||||
"Microsoft.VisualStudio.Component.Windows10SDK.18362",
|
||||
"Microsoft.VisualStudio.Component.Windows10SDK.19041",
|
||||
"Microsoft.VisualStudio.Component.WinXP",
|
||||
"Microsoft.VisualStudio.Component.Workflow",
|
||||
"Microsoft.VisualStudio.ComponentGroup.Azure.CloudServices",
|
||||
"Microsoft.VisualStudio.ComponentGroup.Azure.ResourceManager.Tools",
|
||||
"Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang",
|
||||
"Microsoft.VisualStudio.ComponentGroup.Web.CloudTools",
|
||||
"Microsoft.VisualStudio.Workload.Azure",
|
||||
"Microsoft.VisualStudio.Workload.Data",
|
||||
"Microsoft.VisualStudio.Workload.DataScience",
|
||||
"Microsoft.VisualStudio.Workload.ManagedDesktop",
|
||||
"Microsoft.VisualStudio.Workload.ManagedGame",
|
||||
"Microsoft.VisualStudio.Workload.NativeCrossPlat",
|
||||
"Microsoft.VisualStudio.Workload.NativeDesktop",
|
||||
"Microsoft.VisualStudio.Workload.NativeGame",
|
||||
"Microsoft.VisualStudio.Workload.NativeMobile",
|
||||
"Microsoft.VisualStudio.Workload.NetCoreTools",
|
||||
"Microsoft.VisualStudio.Workload.NetCrossPlat",
|
||||
"Microsoft.VisualStudio.Workload.NetWeb",
|
||||
"Microsoft.VisualStudio.Workload.Node",
|
||||
"Microsoft.VisualStudio.Workload.Office",
|
||||
"Microsoft.VisualStudio.Workload.Python",
|
||||
"Microsoft.VisualStudio.Workload.Universal",
|
||||
"Microsoft.VisualStudio.Workload.VisualStudioExtension",
|
||||
"Component.MDD.Linux",
|
||||
"Component.MDD.Linux.GCC.arm"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user