mirror of
https://github.com/hansjone/netx.git
synced 2026-10-14 22:20:50 +08:00
Deploy the VC++ runtime app-local for the bundled PostgreSQL.
The EDB binaries link vcruntime140 (and msvcp140 via ICU), which a clean Windows install lacks, so the built-in DB and the wizard's external-DB connection test (psql) failed on fresh/offline PCs without the VC++ 2015-2022 redistributable. Copy vcruntime140(_1)/msvcp140(_1,_2) into postgres\pgsql\bin at build time and extract vcruntime140 with psql. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
6ff10834e5
commit
a9a1c284a5
2 changed files with 12 additions and 0 deletions
|
|
@ -168,6 +168,15 @@ if (Test-Path (Join-Path $pgsql "bin\pg_ctl.exe")) {
|
|||
Remove-Item -Recurse -Force (Join-Path $pgStage "lib\pgxs") -ErrorAction SilentlyContinue
|
||||
Get-ChildItem (Join-Path $pgStage "share\locale") -Directory -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.Name -notlike "zh_CN*" } | Remove-Item -Recurse -Force
|
||||
# The EDB binaries link the VC++ 2015-2022 runtime (vcruntime140, msvcp140 via ICU), which a
|
||||
# clean Windows install does not have. Deploy it app-local (allowed by the VC++ redist terms)
|
||||
# so the bundled PostgreSQL starts on fresh / offline machines without the redistributable.
|
||||
$sys32 = Join-Path $env:SystemRoot "System32"
|
||||
foreach ($dll in @("vcruntime140.dll", "vcruntime140_1.dll", "msvcp140.dll", "msvcp140_1.dll", "msvcp140_2.dll")) {
|
||||
$src = Join-Path $sys32 $dll
|
||||
if (-not (Test-Path -LiteralPath $src)) { throw "vc_runtime_missing_on_build_machine: $src (install the VC++ 2015-2022 x64 redistributable)" }
|
||||
Copy-Item -LiteralPath $src -Destination (Join-Path $pgStage "bin\$dll") -Force
|
||||
}
|
||||
Get-ChildItem -Path $pgsql -File -ErrorAction SilentlyContinue | ForEach-Object {
|
||||
Copy-Item -Path $_.FullName -Destination (Join-Path $pgStage $_.Name) -Force
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,6 +170,8 @@ Source: "{#StageDir}\postgres\pgsql\bin\liblz4.dll"; Flags: dontcopy
|
|||
Source: "{#StageDir}\postgres\pgsql\bin\libzstd.dll"; Flags: dontcopy
|
||||
Source: "{#StageDir}\postgres\pgsql\bin\libxml2.dll"; Flags: dontcopy
|
||||
Source: "{#StageDir}\postgres\pgsql\bin\libxslt.dll"; Flags: dontcopy
|
||||
; VC++ runtime deployed app-local by build_release.ps1 (clean PCs lack the redistributable).
|
||||
Source: "{#StageDir}\postgres\pgsql\bin\vcruntime140.dll"; Flags: dontcopy
|
||||
; These helpers are extracted for PrepareToInstall, before the new program tree is copied.
|
||||
Source: "{#StageDir}\packaging\_common.ps1"; Flags: dontcopy
|
||||
Source: "{#StageDir}\packaging\service_lifecycle.ps1"; Flags: dontcopy
|
||||
|
|
@ -492,6 +494,7 @@ begin
|
|||
ExtractTemporaryFile('libzstd.dll');
|
||||
ExtractTemporaryFile('libxml2.dll');
|
||||
ExtractTemporaryFile('libxslt.dll');
|
||||
ExtractTemporaryFile('vcruntime140.dll');
|
||||
Result := FileExists(ExpandConstant('{tmp}\psql.exe')) and
|
||||
FileExists(ExpandConstant('{tmp}\test_pg_conn.ps1'));
|
||||
GPgToolsReady := Result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue