diff --git a/images/windows/scripts/build/Install-PostgreSQL.ps1 b/images/windows/scripts/build/Install-PostgreSQL.ps1 index 561325d5e..50fdcf708 100644 --- a/images/windows/scripts/build/Install-PostgreSQL.ps1 +++ b/images/windows/scripts/build/Install-PostgreSQL.ps1 @@ -58,12 +58,14 @@ if ($null -ne ($toolsetVersion | Select-String -Pattern '\d+\.\d+\.\d+')) { } while (!$response) } -# Postgres 14 requires the vs 17 redistributable -$vs17RedistUrl = "https://aka.ms/vs/17/release/vc_redist.x64.exe" -Install-Binary ` - -Url $vs17RedistUrl ` - -InstallArgs @("/install", "/quiet", "/norestart") ` - -ExpectedSignature (Get-ToolsetContent).postgresql.vcRedistSignature +if ((Get-ToolsetContent).postgresql.installVcRedist) { + # Postgres 14 requires the vs 17 redistributable + $vs17RedistUrl = "https://aka.ms/vs/17/release/vc_redist.x64.exe" + Install-Binary ` + -Url $vs17RedistUrl ` + -InstallArgs @("/install", "/quiet", "/norestart") ` + -ExpectedSignature (Get-ToolsetContent).postgresql.vcRedistSignature +} # Return the previous value of ErrorAction and invoke Install-Binary function $ErrorActionPreference = $errorActionOldValue diff --git a/images/windows/toolsets/toolset-2019.json b/images/windows/toolsets/toolset-2019.json index e192ede5e..9f139a4b1 100644 --- a/images/windows/toolsets/toolset-2019.json +++ b/images/windows/toolsets/toolset-2019.json @@ -474,7 +474,8 @@ "postgresql": { "signature": "698BA51AA27CC31282AACA5055E4B9190BC6C0E9", "version": "14", - "vcRedistSignature": "245D262748012A4FE6CE8BA6C951A4C4AFBC3E5D" + "vcRedistSignature": "245D262748012A4FE6CE8BA6C951A4C4AFBC3E5D", + "installVcRedist": true }, "kotlin": { "version": "latest" diff --git a/images/windows/toolsets/toolset-2022.json b/images/windows/toolsets/toolset-2022.json index ff60ff32e..44d851983 100644 --- a/images/windows/toolsets/toolset-2022.json +++ b/images/windows/toolsets/toolset-2022.json @@ -383,7 +383,8 @@ "postgresql": { "signature": "698BA51AA27CC31282AACA5055E4B9190BC6C0E9", "version": "14", - "vcRedistSignature": "245D262748012A4FE6CE8BA6C951A4C4AFBC3E5D" + "vcRedistSignature": "245D262748012A4FE6CE8BA6C951A4C4AFBC3E5D", + "installVcRedist": true }, "kotlin": { "version": "latest"