Instead: Install SQL Server 2017 Express LocalDB and its cumulative update
This commit is contained in:
parent
7a5981131c
commit
70d8d125f9
|
|
@ -296,7 +296,7 @@ jobs:
|
||||||
buildArgs: -test "/p:SkipIISBackwardsCompatibilityTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISForwardsCompatibilityTests=true"
|
buildArgs: -test "/p:SkipIISBackwardsCompatibilityTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISForwardsCompatibilityTests=true"
|
||||||
beforeBuild:
|
beforeBuild:
|
||||||
- powershell: ./eng/scripts/InstallSqlServerLocalDB.ps1
|
- powershell: ./eng/scripts/InstallSqlServerLocalDB.ps1
|
||||||
displayName: Install SQL Server 2016 Express LocalDB
|
displayName: Install SQL Server 2017 Express LocalDB
|
||||||
- powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1"
|
- powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1"
|
||||||
displayName: Setup IISExpress test certificates and schema
|
displayName: Setup IISExpress test certificates and schema
|
||||||
- powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Setup signalrclienttests.exe"
|
- powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Setup signalrclienttests.exe"
|
||||||
|
|
|
||||||
|
|
@ -1,44 +1,53 @@
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Installs SQL Server 2016 Express LocalDB on a machine.
|
Installs SQL Server 2017 Express LocalDB on a machine.
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This script installs Microsoft SQL Server 2016 Express LocalDB on a machine.
|
This script installs Microsoft SQL Server 2017 Express LocalDB on a machine.
|
||||||
.LINK
|
.LINK
|
||||||
https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-2016-express-localdb?view=sql-server-2016
|
https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-2016-express-localdb?view=sql-server-2017
|
||||||
https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2016
|
https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2017
|
||||||
#>
|
#>
|
||||||
|
|
||||||
$ErrorActionPreference = 'Stop'
|
$ErrorActionPreference = 'Stop'
|
||||||
|
$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
|
||||||
Set-StrictMode -Version 1
|
Set-StrictMode -Version 1
|
||||||
|
|
||||||
$intermedateDir = "$PSScriptRoot\obj"
|
$intermedateDir = "$PSScriptRoot\obj"
|
||||||
mkdir $intermedateDir -ErrorAction Ignore | Out-Null
|
mkdir $intermedateDir -ErrorAction Ignore | Out-Null
|
||||||
|
|
||||||
$bootstrapper = "$intermedateDir\SQLExpressInstaller.exe"
|
Write-Host "Installing SQL Server 2017 Express LocalDB" -f Magenta
|
||||||
$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
|
|
||||||
|
|
||||||
Write-Host "Installing SQL Server 2016 Express LocalDB" -f Magenta
|
|
||||||
|
|
||||||
# Get the bootstrapper.
|
|
||||||
Write-Host ""
|
|
||||||
Write-Host "Downloading 'SQLServer2016-SSEI-Expr.exe' to '$bootstrapper'."
|
|
||||||
Invoke-WebRequest -OutFile $bootstrapper -Uri `
|
|
||||||
"https://download.microsoft.com/download/3/7/6/3767D272-76A1-4F31-8849-260BD37924E4/SQLServer2016-SSEI-Expr.exe"
|
|
||||||
|
|
||||||
# Download SqlLocalDB.msi.
|
# Download SqlLocalDB.msi.
|
||||||
|
$installerFilename = "SqlLocalDB.msi"
|
||||||
|
$installerPath = "$intermedateDir\$installerFilename"
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
$arguments = '/Action=Download', '/Quiet', '/HideProgressBar', `
|
Write-Host "Downloading '$installerFilename' to '$installerPath'."
|
||||||
'/MediaType=LocalDB', "/MediaPath=`"$intermedateDir`"", '/Language=en-us'
|
Invoke-WebRequest -OutFile $installerPath -Uri `
|
||||||
Write-Host "Running '`"$bootstrapper`" $arguments'."
|
"https://download.microsoft.com/download/E/F/2/EF23C21D-7860-4F05-88CE-39AA114B014B/$installerFilename"
|
||||||
$process = Start-Process "$bootstrapper" -ArgumentList $arguments -PassThru -Verbose -Wait
|
|
||||||
if ($process.ExitCode -ne 0) {
|
# Install LocalDB.
|
||||||
|
$arguments = '/package', "`"$installerPath`"", '/NoRestart', '/Passive', `
|
||||||
|
'IACCEPTSQLLOCALDBLICENSETERMS=YES', 'HIDEPROGRESSBAR=YES'
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host "Running 'msiexec $arguments'."
|
||||||
|
$process = Start-Process msiexec.exe -ArgumentList $arguments -NoNewWindow -PassThru -Verbose -Wait
|
||||||
|
if ($process.ExitCode -ne 0)
|
||||||
|
{
|
||||||
exit $process.ExitCode
|
exit $process.ExitCode
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install LocalDB.
|
# Download SQLServer2017-KB4484710-x64.exe.
|
||||||
|
$installerFilename = "SQLServer2017-KB4484710-x64.exe"
|
||||||
|
$installerPath = "$intermedateDir\$installerFilename"
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
$arguments = '/package', "`"$intermedateDir\en-us\SqlLocalDB.msi`"", '/NoRestart', '/Passive', `
|
Write-Host "Downloading SQL Server 2017 Cumulative Update 14 to '$installerPath'."
|
||||||
'IACCEPTSQLLOCALDBLICENSETERMS=YES', 'HIDEPROGRESSBAR=YES'
|
Invoke-WebRequest -OutFile $installerPath -Uri `
|
||||||
Write-Host "Running 'msiexec $arguments'."
|
"https://download.microsoft.com/download/C/4/F/C4F908C9-98ED-4E5F-88D5-7D6A5004AEBD/$installerFilename"
|
||||||
$process = Start-Process msiexec.exe -ArgumentList $arguments -NoNewWindow -PassThru -Verbose -Wait
|
|
||||||
|
# Update LocalDB.
|
||||||
|
$arguments = '/Action=Patch', '/AllInstances', '/IAcceptSQLServerLicenseTerms', `
|
||||||
|
'/Quiet', '/SuppressPrivacyStatementNotice'
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host "Running '`"$installerPath`" $arguments'."
|
||||||
|
$process = Start-Process "$installerPath" -ArgumentList $arguments -PassThru -Verbose -Wait
|
||||||
exit $process.ExitCode
|
exit $process.ExitCode
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue