Remove Windows Server 2016 related code from the repository (#5994)

This commit is contained in:
Aleksandr Chebotov
2022-08-01 15:35:36 +02:00
committed by GitHub
parent 493f3c3ee1
commit 8c24b03a8d
26 changed files with 36 additions and 1516 deletions

View File

@@ -35,7 +35,6 @@ Export-ModuleMember -Function @(
'Get-WinVersion'
'Test-IsWin22'
'Test-IsWin19'
'Test-IsWin16'
'Choco-Install'
'Send-RequestToCocolateyPackages'
'Get-LatestChocoPackageVersion'

View File

@@ -436,11 +436,6 @@ function Test-IsWin19
(Get-WinVersion) -match "2019"
}
function Test-IsWin16
{
(Get-WinVersion) -match "2016"
}
function Extract-7Zip {
Param
(

View File

@@ -19,12 +19,10 @@ $avPreference = @(
@{DisableRealtimeMonitoring = $true}
)
if (-not (Test-IsWin16)) {
$avPreference += @(
@{EnableControlledFolderAccess = "Disable"}
@{EnableNetworkProtection = "Disabled"}
)
}
$avPreference += @(
@{EnableControlledFolderAccess = "Disable"}
@{EnableNetworkProtection = "Disabled"}
)
$avPreference | Foreach-Object {
$avParams = $_

View File

@@ -15,9 +15,5 @@ C:\msys64\usr\bin\bash.exe -leo pipefail %*
# gitbash <--> C:\Program Files\Git\bin\bash.exe
New-Item -ItemType SymbolicLink -Path "$shellPath\gitbash.exe" -Target "$env:ProgramFiles\Git\bin\bash.exe" | Out-Null
# WSL is available on Windows Server 2019 and Windows Server 2022
if (-not (Test-IsWin16))
{
# wslbash <--> C:\Windows\System32\bash.exe
New-Item -ItemType SymbolicLink -Path "$shellPath\wslbash.exe" -Target "$env:SystemRoot\System32\bash.exe" | Out-Null
}
# wslbash <--> C:\Windows\System32\bash.exe
New-Item -ItemType SymbolicLink -Path "$shellPath\wslbash.exe" -Target "$env:SystemRoot\System32\bash.exe" | Out-Null

View File

@@ -53,7 +53,7 @@ function Invoke-Warmup (
function Fix-ImportPublishProfile (
$SdkVersion
) {
if ((Test-IsWin16) -or (Test-IsWin19)) {
if (Test-IsWin19) {
# Fix for issue https://github.com/dotnet/sdk/issues/1276. This will be fixed in 3.1.
$sdkTargetsName = "Microsoft.NET.Sdk.ImportPublishProfile.targets"
$sdkTargetsUrl = "https://raw.githubusercontent.com/dotnet/sdk/82bc30c99f1325dfaa7ad450be96857a4fca2845/src/Tasks/Microsoft.NET.Build.Tasks/targets/${sdkTargetsName}"

View File

@@ -20,10 +20,6 @@ Choco-Install -PackageName hub
# Add to PATH
Add-MachinePathItem "C:\Program Files\Git\bin"
if (Test-IsWin16) {
$env:Path += ";$env:ProgramFiles\Git\usr\bin\"
}
# Add well-known SSH host keys to ssh_known_hosts
ssh-keyscan -t rsa,ecdsa,ed25519 github.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts"
ssh-keyscan -t rsa ssh.dev.azure.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts"

View File

@@ -1,17 +1,10 @@
if (Test-IsWin16) {
# Install vcredist140
Choco-Install -PackageName vcredist140
}
if (Test-IsWin19) {
# Install vcredist2010
$Vc2010x86Name = "vcredist_x86.exe"
$Vc2010x86URI = "https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/${Vc2010x86Name}"
$Vc2010x64Name = "vcredist_x64.exe"
$Vc2010x64URI = "https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/${Vc2010x64Name}"
$ArgumentList = ("/install", "/quiet", "/norestart")
Install-Binary -Url $Vc2010x86URI -Name $Vc2010x86Name -ArgumentList $ArgumentList
Install-Binary -Url $Vc2010x64URI -Name $Vc2010x64Name -ArgumentList $ArgumentList
}
# Install vcredist2010
$Vc2010x86Name = "vcredist_x86.exe"
$Vc2010x86URI = "https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/${Vc2010x86Name}"
$Vc2010x64Name = "vcredist_x64.exe"
$Vc2010x64URI = "https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/${Vc2010x64Name}"
$ArgumentList = ("/install", "/quiet", "/norestart")
Install-Binary -Url $Vc2010x86URI -Name $Vc2010x86Name -ArgumentList $ArgumentList
Install-Binary -Url $Vc2010x64URI -Name $Vc2010x64Name -ArgumentList $ArgumentList
Invoke-PesterTests -TestFile "Tools" -TestName "VCRedist"

View File

@@ -14,18 +14,13 @@ if (Test-IsWin22) {
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2166289"
$FilePath = "C:\Program Files (x86)\Windows Kits\10\Vsix\VS2019\WDK.vsix"
$VSver = "2019"
} elseif (Test-IsWin16) {
$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"
} else {
throw "Invalid version of Visual Studio is found. Either 2017,2019 or 2022 are required"
}
$argumentList = ("/features", "+", "/quiet")
if ((Test-IsWin16) -or (Test-IsWin19)) {
if (Test-IsWin19) {
# `winsdksetup.exe /features + /quiet` installs all features without showing the GUI
Install-Binary -Url $winSdkUrl -Name "winsdksetup.exe" -ArgumentList $argumentList
}
@@ -36,7 +31,7 @@ Install-Binary -Url $wdkUrl -Name "wdksetup.exe" -ArgumentList $argumentList
# Need to install the VSIX to get the build targets when running VSBuild
# Windows 2022 - Skip installation due to a regression
# https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk
if ((Test-IsWin16) -or (Test-IsWin19)) {
if (Test-IsWin19) {
$FilePath = Resolve-Path -Path $FilePath
Install-VsixExtension -FilePath $FilePath -Name "WDK.vsix" -VSversion $VSver -InstallOnly
}

View File

@@ -15,12 +15,8 @@ if (Test-IsWin22) {
$imageLabel = "windows-2019"
$softwareUrl = "${githubUrl}/win19/${imageVersion}/images/win/Windows2019-Readme.md"
$releaseUrl="https://github.com/actions/virtual-environments/releases/tag/win19%2F${imageVersion}"
} elseif (Test-IsWin16) {
$imageLabel = "windows-2016"
$softwareUrl = "${githubUrl}/win16/${imageVersion}/images/win/Windows2016-Readme.md"
$releaseUrl="https://github.com/actions/virtual-environments/releases/tag/win16%2F${imageVersion}"
} else {
throw "Invalid platform version is found. Either Windows Server 2016 or 2019 or 2022 are required"
throw "Invalid platform version is found. Either Windows Server 2019 or 2022 are required"
}
$json = @"

View File

@@ -1,19 +0,0 @@
################################################################################
## File: Install-SSDT.ps1
## Desc: Install SQL Server Data Tools for Windows
################################################################################
#SSDT for Visual Studio 2017
#The link down below points to the latest version of SSDT for Visual Studio 2017
$InstallerName = "SSDT-Setup-ENU.exe"
$InstallerUrl = "https://go.microsoft.com/fwlink/?linkid=2124518"
$logFilePath = "$env:TEMP\ssdtlog.txt"
$ArgumentList = ("/install", "INSTALLALL", "/passive", "/norestart", "/log `"$logFilePath`"")
Install-Binary -Url $InstallerUrl -Name $InstallerName -ArgumentList $ArgumentList
Write-Host "******** SSDT SETUP LOG START ********"
Write-Host $(Get-Content $logFilePath | Out-String)
Write-Host "******** SSDT SETUP LOG END ********"
Invoke-PesterTests -TestFile "SSDTExtensions"

View File

@@ -1,10 +0,0 @@
################################################################################
## File: Install-Win81SDK.ps1
## Desc: Install Windows 8.1 SDK
################################################################################
$InstallerName = "sdksetup.exe"
$InstallerUrl = "http://download.microsoft.com/download/B/0/C/B0C80BA3-8AD6-4958-810B-6882485230B5/standalonesdk/${InstallerName}"
$ArgumentList = ("/quiet", "/norestart")
Install-Binary -Url $InstallerUrl -Name $InstallerName -ArgumentList $ArgumentList

View File

@@ -349,7 +349,7 @@ function Build-PackageManagementEnvironmentTable {
"Value" = $env:VCPKG_INSTALLATION_ROOT
}
)
if ((Test-IsWin16) -or (Test-IsWin19)) {
if (Test-IsWin19) {
$envVariables += @(
@{
"Name" = "CONDA"

View File

@@ -121,7 +121,7 @@ $toolsList = @(
(Get-ZstdVersion),
(Get-YAMLLintVersion)
)
if ((Test-IsWin16) -or (Test-IsWin19)) {
if (Test-IsWin19) {
$toolsList += @(
(Get-GoogleCloudSDKVersion),
(Get-ParcelVersion)
@@ -140,7 +140,7 @@ $cliTools = @(
(Get-GHVersion),
(Get-HubVersion)
)
if ((Test-IsWin16) -or (Test-IsWin19)) {
if (Test-IsWin19) {
$cliTools += @(
(Get-CloudFoundryVersion)
)
@@ -220,14 +220,10 @@ $databaseTools = @(
(Get-AzCosmosDBEmulatorVersion),
(Get-DacFxVersion),
(Get-MySQLVersion),
(Get-SQLPSVersion)
(Get-SQLPSVersion),
(Get-SQLOLEDBDriverVersion)
)
if (-not (Test-IsWin16))
{
$databaseTools += Get-SQLOLEDBDriverVersion
}
$markdown += New-MDList -Style Unordered -Lines ($databaseTools | Sort-Object)
$markdown += Build-WebServersSection

View File

@@ -38,19 +38,6 @@ function Get-VisualStudioExtensions {
}
}
# SSDT extensions for VS2017
$vs = (Get-VisualStudioVersion).Name.Split()[-1]
if (Test-IsWin16)
{
$analysisPackageVersion = Get-VSExtensionVersion -packageName '04a86fc2-dbd5-4222-848e-911638e487fe'
$reportingPackageVersion = Get-VSExtensionVersion -packageName '717ad572-c4b7-435c-c166-c2969777f718'
$integrationPackageName = Get-VSExtensionVersion -packageName 'd1b09713-c12e-43cc-9ef4-6562298285ab'
$ssdtPackages = @(
@{Package = 'SSDT Microsoft Analysis Services Projects'; Version = $analysisPackageVersion}
@{Package = 'SSDT SQL Server Integration Services Projects'; Version = $reportingPackageVersion}
@{Package = 'SSDT Microsoft Reporting Services Projects'; Version = $integrationPackageName}
)
}
# SDK
if (Test-IsWin19) {
@@ -60,8 +47,9 @@ function Get-VisualStudioExtensions {
)
}
if ((Test-IsWin16) -or (Test-IsWin19)) {
if (Test-IsWin19) {
# Wix
$vs = (Get-VisualStudioVersion).Name.Split()[-1]
$wixExtensionVersion = ($vsPackages | Where-Object {$_.Id -match 'WixToolset.VisualStudioExtension.Dev' -and $_.type -eq 'vsix'}).Version
$wixPackages = @(
@{Package = "WIX Toolset Studio $vs Extension"; Version = $wixExtensionVersion}

View File

@@ -16,7 +16,7 @@ Describe "MSYS2 packages" {
@{ ToolName = "bash.exe" }
)
if ((Test-IsWin16) -or (Test-IsWin19)) {
if (Test-IsWin19) {
$TestCases += @(
@{ ToolName = "tar.exe" }
@{ ToolName = "make.exe" }

View File

@@ -160,16 +160,12 @@ Describe "Vcpkg" {
}
Describe "VCRedist" -Skip:(Test-IsWin22) {
It "vcredist_140" -Skip:(Test-IsWin19) {
"C:\Windows\System32\vcruntime140.dll" | Should -Exist
}
It "vcredist_2010_x64" -Skip:(Test-IsWin16) {
It "vcredist_2010_x64" {
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1D8E6291-B0D5-35EC-8441-6616F567A0F7}" | Should -Exist
"C:\Windows\System32\msvcr100.dll" | Should -Exist
}
It "vcredist_2010_x64" -Skip:(Test-IsWin16) {
It "vcredist_2010_x64" {
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1D8E6291-B0D5-35EC-8441-6616F567A0F7}" | Should -Exist
"C:\Windows\System32\msvcr100.dll" | Should -Exist
}
@@ -201,7 +197,7 @@ Describe "Kotlin" {
}
}
Describe "SQL OLEDB Driver" -Skip:(Test-IsWin16) {
Describe "SQL OLEDB Driver" {
It "SQL OLEDB Driver" {
"HKLM:\SOFTWARE\Microsoft\MSOLEDBSQL" | Should -Exist
}

View File

@@ -25,7 +25,7 @@ Describe "Visual Studio" {
}
Describe "Windows 10 SDK" {
It "Verifies 17763 SDK is installed" -Skip:((Test-IsWin16) -or (Test-IsWin19)) {
It "Verifies 17763 SDK is installed" -Skip:(Test-IsWin19) {
"${env:ProgramFiles(x86)}\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\10.0.17763.0\UAP.props" | Should -Exist
}
}

View File

@@ -51,7 +51,7 @@ Describe "GDIProcessHandleQuota" {
}
}
Describe "Test Signed Drivers" -Skip:(Test-IsWin16) {
Describe "Test Signed Drivers" {
It "bcdedit testsigning should be Yes"{
"$(bcdedit)" | Should -Match "testsigning\s+Yes"
}