build: bundle native_host bridges + fluidsynth runtime vao installer (build_windows.ps1 [4b/6], SF_RESOURCE_DIR fallback, tauri resources native_host)

This commit is contained in:
2026-08-11 18:48:06 +07:00
parent 94dc7dcf12
commit 916ce1334b
8 changed files with 45 additions and 4 deletions
+28
View File
@@ -64,6 +64,34 @@ New-Item -ItemType Directory -Force "src-tauri\resources\daw_engine" | Out-Null
Copy-Item "dist\daw_engine\*" "src-tauri\resources\daw_engine\" -Recurse -Force
Write-Host "Copied onedir engine -> src-tauri\resources\daw_engine"
Write-Host "== [4b/6] Native host bridges (CMake/MSVC) + FluidSynth runtime =="
# T8-T16: vst2/vst3/sf_host_bridge DLL + fluidsynth_runtime (22 DLL) phai nam
# trong resources/native_host/ de exe tim thay luc runtime (Rust: resource_dir/
# native_host; Python: SF_RESOURCE_DIR/native_host). Thieu -> native audio /
# VST GUI khong chay tren may cai sach.
if (-not (Test-Path "native_host\build\CMakeCache.txt")) {
if (-not $env:VST3_SDK_ROOT) {
Write-Host "ERROR: can VST3_SDK_ROOT env (duong dan VST3 SDK) khi chua co native_host\build" -ForegroundColor Red
exit 1
}
& cmake -S native_host -B native_host\build -A x64 -DVST3_SDK_ROOT="$env:VST3_SDK_ROOT"
if ($LASTEXITCODE -ne 0) { Write-Host "ERROR: cmake configure native_host that bai" -ForegroundColor Red; exit 1 }
}
& cmake --build native_host\build --config Release
if ($LASTEXITCODE -ne 0) { Write-Host "ERROR: cmake build native_host that bai" -ForegroundColor Red; exit 1 }
if (-not (Test-Path "native_host\fluidsynth_runtime\libfluidsynth-3.dll")) {
python native_host\scripts\dl_fluidsynth_runtime.py
if ($LASTEXITCODE -ne 0) { Write-Host "ERROR: dl_fluidsynth_runtime that bai" -ForegroundColor Red; exit 1 }
}
if (Test-Path "src-tauri\resources\native_host") {
Remove-Item -Recurse -Force "src-tauri\resources\native_host"
}
New-Item -ItemType Directory -Force "src-tauri\resources\native_host" | Out-Null
Copy-Item "native_host\build\Release\vst2_host_bridge.dll","native_host\build\Release\vst3_host_bridge.dll","native_host\build\Release\sf_host_bridge.dll" "src-tauri\resources\native_host\"
Copy-Item "native_host\fluidsynth_runtime" "src-tauri\resources\native_host\fluidsynth_runtime" -Recurse -Force
Write-Host "== [5/6] VC++ Redistributable cho hooks.nsh =="
if (-not (Test-Path src-tauri\vc_redist.x64.exe)) {
Invoke-WebRequest -Uri "https://aka.ms/vs/17/release/vc_redist.x64.exe" -OutFile src-tauri\vc_redist.x64.exe