From 1acb48ed45cda5f2e12af1cf1f79eed7e33f287e Mon Sep 17 00:00:00 2001 From: lawrencegripper Date: Fri, 29 Nov 2024 10:23:46 +0000 Subject: [PATCH] Directly install vs redist before installing postgres --- images/windows/scripts/build/Install-PostgreSQL.ps1 | 9 ++++++++- images/windows/toolsets/toolset-2019.json | 3 ++- images/windows/toolsets/toolset-2022.json | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/images/windows/scripts/build/Install-PostgreSQL.ps1 b/images/windows/scripts/build/Install-PostgreSQL.ps1 index a43b5da55..561325d5e 100644 --- a/images/windows/scripts/build/Install-PostgreSQL.ps1 +++ b/images/windows/scripts/build/Install-PostgreSQL.ps1 @@ -58,9 +58,16 @@ 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 + # Return the previous value of ErrorAction and invoke Install-Binary function $ErrorActionPreference = $errorActionOldValue -$installerArgs = @("--superpassword root", "--enable_acledit 1", "--unattendedmodeui none", "--mode unattended") +$installerArgs = @("--install_runtimes 0", "--superpassword root", "--enable_acledit 1", "--unattendedmodeui none", "--mode unattended") Install-Binary ` -Url $installerUrl ` -InstallArgs $installerArgs ` diff --git a/images/windows/toolsets/toolset-2019.json b/images/windows/toolsets/toolset-2019.json index 960e5146d..e192ede5e 100644 --- a/images/windows/toolsets/toolset-2019.json +++ b/images/windows/toolsets/toolset-2019.json @@ -473,7 +473,8 @@ }, "postgresql": { "signature": "698BA51AA27CC31282AACA5055E4B9190BC6C0E9", - "version": "14" + "version": "14", + "vcRedistSignature": "245D262748012A4FE6CE8BA6C951A4C4AFBC3E5D" }, "kotlin": { "version": "latest" diff --git a/images/windows/toolsets/toolset-2022.json b/images/windows/toolsets/toolset-2022.json index 23afa8b71..ff60ff32e 100644 --- a/images/windows/toolsets/toolset-2022.json +++ b/images/windows/toolsets/toolset-2022.json @@ -382,7 +382,8 @@ }, "postgresql": { "signature": "698BA51AA27CC31282AACA5055E4B9190BC6C0E9", - "version": "14" + "version": "14", + "vcRedistSignature": "245D262748012A4FE6CE8BA6C951A4C4AFBC3E5D" }, "kotlin": { "version": "latest"