From 855a753e2652cb4c3d2175d7a5aacfa5b9e7a2e4 Mon Sep 17 00:00:00 2001 From: locpham Date: Tue, 1 Sep 2026 12:12:14 +0700 Subject: [PATCH] V45.36: build_install.ps1 robust voi native stderr (Continue+LASTEXITCODE), kill theo path install/dist khong dong production --- build_install.ps1 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/build_install.ps1 b/build_install.ps1 index 2583927..761a27e 100644 --- a/build_install.ps1 +++ b/build_install.ps1 @@ -12,23 +12,32 @@ # (VS2019/2022 + vcpkg + vst3sdk submodule + sfizz-src). Chay lai # build_windows.ps1 neu muon build lai bridge/app tu source. # LUU Y: file nay chi dung ky tu ASCII (PowerShell 5.1). -$ErrorActionPreference = "Stop" +# "Stop" + npm/pip warn tren stderr -> NativeCommandError -> chet oai. Dung +# "Continue" + kiem tra $LASTEXITCODE thu cong sau tung lenh native. +$ErrorActionPreference = "Continue" Set-Location $PSScriptRoot -Write-Host "== [1/4] Kill tien trinh cu ==" -Get-Process -Name "daw_engine","sonicforge-daw","daw_vst_bridge" -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue +Write-Host "== [1/4] Kill tien trinh cu (chi install/dist, khong dong production) ==" +Get-Process -ErrorAction SilentlyContinue | Where-Object { + $_.Path -like "$PSScriptRoot\install\*" -or $_.Path -like "$PSScriptRoot\dist\daw_engine\*" +} | Stop-Process -Force -ErrorAction SilentlyContinue Start-Sleep -Milliseconds 500 Write-Host "== [2/4] Frontend bundle (app.jsx -> app.precompiled.js) ==" npm install --no-audit --no-fund +if ($LASTEXITCODE -ne 0) { Write-Host "ERROR: npm install that bai (exit $LASTEXITCODE)" -ForegroundColor Red; exit 1 } if (-not (Test-Path "node_modules\@babel\standalone")) { npm install @babel/standalone --no-audit --no-fund + if ($LASTEXITCODE -ne 0) { Write-Host "ERROR: npm install @babel/standalone that bai (exit $LASTEXITCODE)" -ForegroundColor Red; exit 1 } } node build.mjs +if ($LASTEXITCODE -ne 0) { Write-Host "ERROR: node build.mjs that bai (exit $LASTEXITCODE)" -ForegroundColor Red; exit 1 } Write-Host "== [3/4] Build daw_engine.exe (PyInstaller onedir) ==" python -m pip install -r requirements.txt pyinstaller pywin32 +if ($LASTEXITCODE -ne 0) { Write-Host "ERROR: pip install that bai (exit $LASTEXITCODE)" -ForegroundColor Red; exit 1 } pyinstaller engine.spec --clean --noconfirm +if ($LASTEXITCODE -ne 0) { Write-Host "ERROR: pyinstaller that bai (exit $LASTEXITCODE)" -ForegroundColor Red; exit 1 } if (-not (Test-Path "dist\daw_engine\daw_engine.exe")) { Write-Host "ERROR: dist\daw_engine\daw_engine.exe khong ton tai" -ForegroundColor Red exit 1