V45.35: fix build_install/build_windows copy layout PHANG - Copy-Item wildcard tran noi dung _internal ra root (exe treo luc chay); dung robocopy /MIR giu dung cau truc onedir exe+_internal

This commit is contained in:
2026-09-01 11:44:04 +07:00
parent 4cd8fa780d
commit e691c43e62
2 changed files with 10 additions and 5 deletions
+6 -2
View File
@@ -52,8 +52,12 @@ if ($devFiles) {
exit 1
}
New-Item -ItemType Directory -Force "install" | Out-Null
if (Test-Path "install\daw_engine") { Remove-Item -Recurse -Force "install\daw_engine" }
Copy-Item "dist\daw_engine\*" "install\daw_engine\" -Recurse -Force
# Copy-Item wildcard tu dist\daw_engine vao install\daw_engine tao layout PHANG
# (noi dung _internal tran ra root, exe khong thay _internal -> treo luc chay).
# Robocopy /MIR mirror dung cau truc onedir (exe + _internal) + xoa file thua.
robocopy "dist\daw_engine" "install\daw_engine" /MIR /NFL /NDL /NJH /NP /R:1 /W:1 | Out-Null
if ($LASTEXITCODE -ge 8) { Write-Host "ERROR: robocopy install that bai (exit $LASTEXITCODE)" -ForegroundColor Red; exit 1 }
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.
+4 -3
View File
@@ -147,9 +147,10 @@ if ($doEngine) {
Fail "Bundle chua config dev - DUNG TAO BAN CAI"
}
if (-not (Test-Path "dist\daw_engine\daw_engine.exe")) { Fail "dist\daw_engine\daw_engine.exe khong ton tai (onedir build loi?)" }
if (Test-Path "src-tauri\resources\daw_engine") { Remove-Item -Recurse -Force "src-tauri\resources\daw_engine" }
New-Item -ItemType Directory -Force "src-tauri\resources\daw_engine" | Out-Null
Copy-Item "dist\daw_engine\*" "src-tauri\resources\daw_engine\" -Recurse -Force
# Robocopy /MIR (khong Copy-Item wildcard): giu dung cau truc onedir exe+_internal.
robocopy "dist\daw_engine" "src-tauri\resources\daw_engine" /MIR /NFL /NDL /NJH /NP /R:1 /W:1 | Out-Null
if ($LASTEXITCODE -ge 8) { Fail "robocopy resources that bai (exit $LASTEXITCODE)" }
if (-not (Test-Path "src-tauri\resources\daw_engine\_internal")) { Fail "resources/daw_engine/_internal thieu - onedir layout sai" }
Write-Host "Engine OK -> src-tauri/resources/daw_engine"
}