diff --git a/build_install.ps1 b/build_install.ps1 index 761a27e..0cf49e1 100644 --- a/build_install.ps1 +++ b/build_install.ps1 @@ -69,6 +69,13 @@ if ($LASTEXITCODE -ge 8) { Write-Host "ERROR: robocopy install that bai (exit $L if (-not (Test-Path "install\daw_engine\_internal")) { Write-Host "ERROR: install\daw_engine\_internal thieu - onedir layout sai" -ForegroundColor Red; exit 1 } # 3 binary (bridge/lib/app) da commit san trong install/ - khong ghi de, # neu user da build lai bridge/app thi tu copy vao day. +# VC++ runtime app-local: bridge C++ link /MD can MSVCP140/VCRUNTIME140 canh +# exe (khong phu thuoc vc_redist he thong). Dong bo tu src-tauri/binaries. +foreach ($dll in @("MSVCP140.dll", "MSVCP140_2.dll", "VCRUNTIME140.dll", "VCRUNTIME140_1.dll")) { + $src = "src-tauri\binaries\$dll" + if (Test-Path $src) { Copy-Item $src "install\$dll" -Force } + else { Write-Host "WARN: thieu $dll trong src-tauri\binaries - chay build_windows.ps1 -Bridge truoc" -ForegroundColor Yellow } +} Write-Host "" Write-Host "== DONE ==" diff --git a/build_windows.ps1 b/build_windows.ps1 index de0b5b4..9774a18 100644 --- a/build_windows.ps1 +++ b/build_windows.ps1 @@ -125,6 +125,14 @@ if ($doBridge) { Copy-Item "native_bridge\build\Release\$dll" "src-tauri\binaries\$dll" -Force } } + # VC++ runtime app-local (MSVCP140/VCRUNTIME140) — bridge C++ link /MD nen + # can cac dll nay CANH exe, khong phu thuoc vc_redist he thong. Lay tu + # System32 (ban redist da cai) de bundle vao installer/portable. + foreach ($dll in @("MSVCP140.dll", "MSVCP140_2.dll", "VCRUNTIME140.dll", "VCRUNTIME140_1.dll")) { + $sys = Join-Path $env:WINDIR "System32\$dll" + if (Test-Path $sys) { Copy-Item $sys "src-tauri\binaries\$dll" -Force } + else { Write-Host "WARN: thieu $dll trong System32 (VC++ redist chua cai?)" -ForegroundColor Yellow } + } Write-Host "Bridge OK -> src-tauri/binaries" } diff --git a/src-tauri/binaries/MSVCP140.dll b/src-tauri/binaries/MSVCP140.dll new file mode 100644 index 0000000..9fa781c Binary files /dev/null and b/src-tauri/binaries/MSVCP140.dll differ diff --git a/src-tauri/binaries/MSVCP140_2.dll b/src-tauri/binaries/MSVCP140_2.dll new file mode 100644 index 0000000..b299feb Binary files /dev/null and b/src-tauri/binaries/MSVCP140_2.dll differ diff --git a/src-tauri/binaries/VCRUNTIME140.dll b/src-tauri/binaries/VCRUNTIME140.dll new file mode 100644 index 0000000..410f3a7 Binary files /dev/null and b/src-tauri/binaries/VCRUNTIME140.dll differ diff --git a/src-tauri/binaries/VCRUNTIME140_1.dll b/src-tauri/binaries/VCRUNTIME140_1.dll new file mode 100644 index 0000000..d1a74e7 Binary files /dev/null and b/src-tauri/binaries/VCRUNTIME140_1.dll differ diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 842bd04..b12aa10 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -25,7 +25,11 @@ "resources": { "resources/daw_engine": "daw_engine/", "binaries/libfluidsynth-3.dll": "libfluidsynth-3.dll", - "binaries/jpeg62.dll": "jpeg62.dll" + "binaries/jpeg62.dll": "jpeg62.dll", + "binaries/MSVCP140.dll": "MSVCP140.dll", + "binaries/MSVCP140_2.dll": "MSVCP140_2.dll", + "binaries/VCRUNTIME140.dll": "VCRUNTIME140.dll", + "binaries/VCRUNTIME140_1.dll": "VCRUNTIME140_1.dll" }, "externalBin": ["binaries/daw_vst_bridge", "binaries/fx_vst_bridge", "binaries/plugin_host"], "windows": {