diff --git a/images/win/scripts/ImageHelpers/InstallHelpers.ps1 b/images/win/scripts/ImageHelpers/InstallHelpers.ps1 index 30084aa47..7c1f1ba89 100644 --- a/images/win/scripts/ImageHelpers/InstallHelpers.ps1 +++ b/images/win/scripts/ImageHelpers/InstallHelpers.ps1 @@ -45,7 +45,10 @@ function Install-Binary $fileExtension = ([System.IO.Path]::GetExtension($Name)).Replace(".", "") if ($fileExtension -eq "msi") { - $ArgumentList = ('/i', $filePath, '/QN', '/norestart') + if (-not $ArgumentList) + { + $ArgumentList = ('/i', $filePath, '/QN', '/norestart') + } $filePath = "msiexec.exe" } diff --git a/images/win/scripts/Installers/Install-AzureCli.ps1 b/images/win/scripts/Installers/Install-AzureCli.ps1 index 1c8013340..71bb8f276 100644 --- a/images/win/scripts/Installers/Install-AzureCli.ps1 +++ b/images/win/scripts/Installers/Install-AzureCli.ps1 @@ -5,7 +5,7 @@ Write-Host "Install the latest Azure CLI release" $azCliUrl = "https://aka.ms/installazurecliwindows" -Install-Binary -Url $azCliUrl -Name "azure-cli.msi" -ArgumentList ("/qn", "/norestart") +Install-Binary -Url $azCliUrl -Name "azure-cli.msi" $azureCliExtensionPath = Join-Path $Env:CommonProgramFiles 'AzureCliExtensionDirectory' $null = New-Item -ItemType "Directory" -Path $azureCliExtensionPath diff --git a/images/win/scripts/Installers/Install-SQLOLEDBDriver.ps1 b/images/win/scripts/Installers/Install-SQLOLEDBDriver.ps1 new file mode 100644 index 000000000..93df7f526 --- /dev/null +++ b/images/win/scripts/Installers/Install-SQLOLEDBDriver.ps1 @@ -0,0 +1,8 @@ +################################################################################ +## File: Install-SQLOLEDBDriver.ps1 +## Desc: Install SQL OLEDB Driver +################################################################################ + +$binaryDownloadPath = Start-DownloadWithRetry "https://go.microsoft.com/fwlink/?linkid=2183083" "msoledbsql.msi" +$ArgumentList = ("/i", "$binaryDownloadPath", "ADDLOCAL=ALL", "IACCEPTMSOLEDBSQLLICENSETERMS=YES", "/qn") +Install-Binary -FilePath msiexec.exe -ArgumentList $ArgumentList \ No newline at end of file diff --git a/images/win/scripts/Installers/Install-WebPlatformInstaller.ps1 b/images/win/scripts/Installers/Install-WebPlatformInstaller.ps1 index 2263b3a9a..90e102d00 100644 --- a/images/win/scripts/Installers/Install-WebPlatformInstaller.ps1 +++ b/images/win/scripts/Installers/Install-WebPlatformInstaller.ps1 @@ -6,6 +6,6 @@ # Download and install WebPlatformInstaller $webPlatformInstallerFile = "WebPlatformInstaller_x64_en-US.msi" $webPlatformInstallerUrl = "http://go.microsoft.com/fwlink/?LinkId=287166" -Install-Binary -Url $webPlatformInstallerUrl -Name $webPlatformInstallerFile -ArgumentList ("/silent", "/install") +Install-Binary -Url $webPlatformInstallerUrl -Name $webPlatformInstallerFile Invoke-PesterTests -TestFile "Tools" -TestName "WebPlatformInstaller" \ No newline at end of file diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 2f9d0f65e..13ec85561 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -215,14 +215,20 @@ $markdown += New-MDHeader "Databases" -Level 3 $markdown += Build-DatabasesMarkdown $markdown += New-MDHeader "Database tools" -Level 3 -$markdown += New-MDList -Style Unordered -Lines (@( +$databaseTools = @( (Get-AzCosmosDBEmulatorVersion), (Get-DacFxVersion), (Get-MySQLVersion), (Get-SQLPSVersion) - ) | Sort-Object ) +if (-not (Test-IsWin16)) +{ + $databaseTools += Get-SQLOLEDBDriverVersion +} + +$markdown += New-MDList -Style Unordered -Lines ($databaseTools | Sort-Object) + $markdown += Build-WebServersSection $vs = Get-VisualStudioVersion diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index f69aee1d1..a6b83f761 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -111,6 +111,11 @@ function Get-MySQLVersion { return "MySQL $mysqlVersion" } +function Get-SQLOLEDBDriverVersion { + $SQLOLEDBDriverVersion = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOLEDBSQL' InstalledVersion).InstalledVersion + return "SQL OLEDB Driver $SQLOLEDBDriverVersion" +} + function Get-MercurialVersion { ($(hg --version) | Out-String) -match "version (?\d+\.\d+\.?\d*)" | Out-Null $mercurialVersion = $Matches.Version diff --git a/images/win/scripts/Tests/Tools.Tests.ps1 b/images/win/scripts/Tests/Tools.Tests.ps1 index 1773a4fb3..ca3ebecbd 100644 --- a/images/win/scripts/Tests/Tools.Tests.ps1 +++ b/images/win/scripts/Tests/Tools.Tests.ps1 @@ -201,3 +201,9 @@ Describe "Kotlin" { "$toolName -version" | Should -ReturnZeroExitCode } } + +Describe "SQL OLEDB Driver" { + It "SQL OLEDB Driver" { + "HKLM:\SOFTWARE\Microsoft\MSOLEDBSQL" | Should -Exist + } +} \ No newline at end of file diff --git a/images/win/windows2019.json b/images/win/windows2019.json index 2efe458dc..577bf1f30 100644 --- a/images/win/windows2019.json +++ b/images/win/windows2019.json @@ -229,6 +229,7 @@ "{{ template_dir }}/scripts/Installers/Install-DACFx.ps1", "{{ template_dir }}/scripts/Installers/Install-MysqlCli.ps1", "{{ template_dir }}/scripts/Installers/Install-SQLPowerShellTools.ps1", + "{{ template_dir }}/scripts/Installers/Install-SQLOLEDBDriver.ps1", "{{ template_dir }}/scripts/Installers/Install-DotnetSDK.ps1", "{{ template_dir }}/scripts/Installers/Install-Mingw64.ps1", "{{ template_dir }}/scripts/Installers/Install-Haskell.ps1", diff --git a/images/win/windows2022.json b/images/win/windows2022.json index d38ce154c..9a21b4c21 100644 --- a/images/win/windows2022.json +++ b/images/win/windows2022.json @@ -228,6 +228,7 @@ "{{ template_dir }}/scripts/Installers/Install-DACFx.ps1", "{{ template_dir }}/scripts/Installers/Install-MysqlCli.ps1", "{{ template_dir }}/scripts/Installers/Install-SQLPowerShellTools.ps1", + "{{ template_dir }}/scripts/Installers/Install-SQLOLEDBDriver.ps1", "{{ template_dir }}/scripts/Installers/Install-DotnetSDK.ps1", "{{ template_dir }}/scripts/Installers/Install-Mingw64.ps1", "{{ template_dir }}/scripts/Installers/Install-Haskell.ps1",