@echo off REM ============================================================ REM Sing Detect - build a PORTABLE folder for ANY Windows PC. REM REM Run this instead of build.bat when you want a copy-paste app. REM Output: dist-portable\SingDetect\ REM Usage: copy that whole folder anywhere, double-click REM "Sing Detect.exe". ffmpeg is bundled inside. REM ============================================================ setlocal EnableDelayedExpansion set "PATH=%USERPROFILE%\.cargo\bin;%PATH%" cd /d "%~dp0" REM --- 1. Locate ffmpeg.exe + ffprobe.exe -------------------- set "FFMPEG=" set "FFPROBE=" if exist "C:\ffmpeg\bin\ffmpeg.exe" set "FFMPEG=C:\ffmpeg\bin\ffmpeg.exe" if exist "C:\ffmpeg\bin\ffprobe.exe" set "FFPROBE=C:\ffmpeg\bin\ffprobe.exe" if not defined FFMPEG for /f "delims=" %%i in ('where ffmpeg 2^>nul') do if not defined FFMPEG set "FFMPEG=%%i" if not defined FFPROBE for /f "delims=" %%i in ('where ffprobe 2^>nul') do if not defined FFPROBE set "FFPROBE=%%i" if not defined FFMPEG ( echo [ERROR] ffmpeg.exe not found. Install ffmpeg or place it in C:\ffmpeg\bin & pause & exit /b 1 ) if not defined FFPROBE ( echo [ERROR] ffprobe.exe not found. Install ffmpeg or place it in C:\ffmpeg\bin & pause & exit /b 1 ) echo Using ffmpeg: !FFMPEG! echo Using ffprobe: !FFPROBE! REM --- 2. Build the release app ------------------------------ if not exist "node_modules" call npm install echo Building release (this takes a few minutes the first time)... call npm run tauri build if errorlevel 1 ( echo [ERROR] Build failed. & pause & exit /b 1 ) REM --- 3. Assemble the portable folder ---------------------- set "OUT=dist-portable\SingDetect" if exist "dist-portable" rmdir /s /q "dist-portable" mkdir "%OUT%" copy /y "src-tauri\target\release\sing-detect.exe" "%OUT%\Sing Detect.exe" >nul copy /y "!FFMPEG!" "%OUT%\ffmpeg.exe" >nul copy /y "!FFPROBE!" "%OUT%\ffprobe.exe" >nul xcopy /e /i /y "sidecar" "%OUT%\sidecar" >nul echo. echo ============================================================ echo DONE. Your portable app is here: echo %CD%\%OUT% echo. echo Copy that whole "SingDetect" folder to any Windows PC and echo double-click "Sing Detect.exe". ffmpeg is included. echo. echo Detection needs Python 3.10 on the target PC. The app has a echo built-in "Test detection engine" button that installs the echo ML packages and model for you on first run. echo ============================================================ pause