V45.36: build_install.ps1 robust voi native stderr (Continue+LASTEXITCODE), kill theo path install/dist khong dong production
This commit is contained in:
+12
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user