diff --git a/images/win/scripts/Installers/Install-SQLExpress.ps1 b/images/win/scripts/Installers/Install-SQLExpress.ps1 index d6bbfaa3a..d93f82383 100644 --- a/images/win/scripts/Installers/Install-SQLExpress.ps1 +++ b/images/win/scripts/Installers/Install-SQLExpress.ps1 @@ -7,7 +7,7 @@ Import-Module -Name ImageHelpers -Force; function Download-FullSQLPackage { param( [String]$InstallerPath, - [String]$Arguments = ("/MEDIAPATH=C:\SQLInstall", "/MEDIATYPE=Core","/Action=Download", "/QUIET") + [String]$Arguments = ("/MEDIAPATH=$InstallerPath", "/MEDIATYPE=Core","/Action=Download", "/QUIET") ) Write-Host "Downloading full package to $InstallerPath..." $process = Start-Process -FilePath $InstallerPath -ArgumentList $Arguments -Wait -PassThru @@ -65,8 +65,9 @@ function Start-Installer { $installerUrl = "https://go.microsoft.com/fwlink/?linkid=866658" $downloadPath = "C:\SQLInstall" $setupPath = Join-Path $downloadPath "SQLEXPR_x64_ENU" +md $downloadPath Set-Location -Path $downloadPath -$installerPath = Start-DownloadWithRetry -Url "https://go.microsoft.com/fwlink/?linkid=866658" -Name "SQL2019-SSEI-Expr.exe" +$installerPath = Start-DownloadWithRetry -Url "https://go.microsoft.com/fwlink/?linkid=866658" -DownloadPath $downloadPath -Name "SQL2019-SSEI-Expr.exe" Download-FullSQLPackage -InstallerPath $installerPath Unpack-SQLInstaller -InstallPath "$setupPath.exe" $resultPath = Join-Path $setupPath "SETUP.exe"