From 400b5e5370b72a9cdaa1633d69e638aeb357abbb Mon Sep 17 00:00:00 2001 From: locpham Date: Tue, 1 Sep 2026 11:44:04 +0700 Subject: [PATCH] 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 --- build_install.ps1 | 8 ++++++-- build_windows.ps1 | 7 ++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/build_install.ps1 b/build_install.ps1 index 037999b..2583927 100644 --- a/build_install.ps1 +++ b/build_install.ps1 @@ -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. diff --git a/build_windows.ps1 b/build_windows.ps1 index c0d2ee8..ee39c2d 100644 --- a/build_windows.ps1 +++ b/build_windows.ps1 @@ -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" }