WebTop

WebTop scripts download_cef.ps1

1.5 KB 35 lines Raw ↗ GitHub ↗

param(    [string]$CefVersion = "6533",    [string]$CefBuild   = "chromium-119.0.6045.159")$ErrorActionPreference = "Stop"$root   = Resolve-Path "$PSScriptRoot\.."$third  = Join-Path $root "third_party"$cefdir = Join-Path $third "cef"New-Item -ItemType Directory -Force -Path $third | Out-Nullif (-not (Test-Path "$cefdir\cmake\cef_variables.cmake")) {    Write-Host "CEF not present. Downloading Standard Distribution (Windows x64)..."    $url = "https://cef-builds.spotifycdn.com/cef_binary_${CefVersion}_windows64_minimal.tar.bz2"    $archive = Join-Path $third "cef.tar.bz2"    Invoke-WebRequest -Uri $url -OutFile $archive    Write-Host "Extracting $archive ..."    tar -xjf $archive -C $third    $extracted = Get-ChildItem -Directory -Path $third | Where-Object { $_.Name -like "cef_binary_*windows64_minimal*" } | Select-Object -First 1    if (-not $extracted) { throw "CEF extraction failed" }    if (Test-Path $cefdir) { Remove-Item -Recurse -Force $cefdir }    Move-Item $extracted.FullName $cefdir    Remove-Item $archive    Write-Host "Building libcef_dll_wrapper..."    cmake -S "$cefdir" -B "$cefdir\build" -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release    cmake --build "$cefdir\build" --config Release --target libcef_dll_wrapper    if (-not (Test-Path "$cefdir\Release\libcef_dll_wrapper.lib")) {        throw "libcef_dll_wrapper.lib not built"    }    Write-Host "CEF ready at $cefdir"}else {    Write-Host "CEF already present at $cefdir"}