63 lines
1.8 KiB
Batchfile
63 lines
1.8 KiB
Batchfile
@echo off
|
|
REM SonicForge DAW - Windows build (daw_engine.exe + Tauri shell)
|
|
setlocal enabledelayedexpansion
|
|
cd /d "%~dp0"
|
|
|
|
echo [1/6] Kiem tra Python + Node...
|
|
python --version
|
|
if errorlevel 1 (
|
|
echo THIEU Python 3.11+ - cai tu python.org, tick Add to PATH
|
|
pause
|
|
exit /b 1
|
|
)
|
|
node --version
|
|
if errorlevel 1 (
|
|
echo THIEU Node 20+ - cai tu nodejs.org
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo [2/6] Kiem tra / cai Rust toolchain...
|
|
where cargo >nul 2>nul
|
|
if errorlevel 1 (
|
|
echo Cai Rust qua rustup MSVC toolchain...
|
|
powershell -Command "Invoke-WebRequest https://win.rustup.rs/x86_64 -OutFile rustup-init.exe"
|
|
rustup-init.exe -y --default-toolchain stable --profile minimal
|
|
del rustup-init.exe
|
|
set "PATH=%USERPROFILE%\.cargo\bin;%PATH%"
|
|
)
|
|
cargo --version
|
|
if errorlevel 1 (
|
|
echo Rust cai that bai - can Visual Studio Build Tools voi C++ workload
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo [3/6] Cai Python deps...
|
|
pip install pyinstaller pywin32
|
|
if errorlevel 1 exit /b 1
|
|
pip install -r requirements.txt
|
|
if errorlevel 1 exit /b 1
|
|
pip install --no-deps "pedalboard>=0.8.0"
|
|
|
|
echo [4/6] Precompile JS...
|
|
npm install --no-audit --no-fund >nul 2>nul
|
|
node node_modules/@babel/cli/bin/babel.js app/static/js/app.jsx --config-file ./babel.config.json -o app/static/js/app.precompiled.js
|
|
if errorlevel 1 exit /b 1
|
|
|
|
echo [5/6] Build daw_engine.exe...
|
|
pyinstaller engine.spec --clean --noconfirm
|
|
if errorlevel 1 exit /b 1
|
|
if not exist "src-tauri\binaries" mkdir "src-tauri\binaries"
|
|
copy /y dist\daw_engine.exe "src-tauri\binaries\daw_engine-x86_64-pc-windows-msvc.exe" >nul
|
|
|
|
echo [6/6] Build Tauri installer...
|
|
npm install -D @tauri-apps/cli@^2 >nul 2>nul
|
|
call npx tauri build
|
|
|
|
echo.
|
|
echo HOAN TAT - Installer:
|
|
echo src-tauri\target\release\bundle\nsis\SonicForgeDAW_1.0.0_x64-setup.exe
|
|
echo src-tauri\target\release\bundle\msi\SonicForgeDAW_1.0.0_x64_en-US.msi
|
|
pause
|