WebTop

WebTop scripts bundle_cef.ps1

1.3 KB 33 lines Raw ↗ GitHub ↗

param(    [string]$Config = "Release")$ErrorActionPreference = "Stop"$root  = Resolve-Path "$PSScriptRoot\.."$dist  = Join-Path $root "dist"$cefdir = Join-Path $root "third_party\cef"New-Item -ItemType Directory -Force -Path $dist | Out-Nullif (-not (Test-Path "$cefdir\Release\libcef.dll")) {    throw "CEF runtime DLLs missing. Run download_cef.ps1 first."}Copy-Item "$cefdir\Release\libcef.dll" -Destination $dist -ForceCopy-Item "$cefdir\Release\chrome_elf.dll" -Destination $dist -Force -ErrorAction SilentlyContinueforeach ($f in @("icudtl.dat","resources.pak","chrome_100_percent.pak",               "chrome_200_percent.pak","v8_context_snapshot.bin","snapshot_blob.bin")) {    if (Test-Path "$cefdir\Release\$f") {        Copy-Item "$cefdir\Release\$f" -Destination $dist -Force    }}if (Test-Path "$cefdir\Release\locales") {    $destLoc = Join-Path $dist "locales"    if (Test-Path $destLoc) { Remove-Item -Recurse -Force $destLoc }    Copy-Item "$cefdir\Release\locales" -Destination $destLoc -Force -Recurse}if (Test-Path "$cefdir\Resources") {    $destRes = Join-Path $dist "Resources"    if (Test-Path $destRes) { Remove-Item -Recurse -Force $destRes }    Copy-Item "$cefdir\Resources" -Destination $destRes -Force -Recurse}Write-Host "CEF runtime files copied to $dist"