BUILD.bat 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. @echo off
  2. setlocal
  3. title Building AudioRecorder.exe...
  4. color 0A
  5. :: Always run from the folder this .bat file lives in
  6. cd /d "%~dp0"
  7. echo.
  8. echo ================================================
  9. echo Audio Recorder - EXE Builder
  10. echo ================================================
  11. echo Build folder: %~dp0
  12. echo.
  13. :: Check Python
  14. python --version >nul 2>&1
  15. if errorlevel 1 (
  16. echo [ERROR] Python not found!
  17. echo Download from https://python.org and tick "Add to PATH"
  18. pause & exit /b 1
  19. )
  20. python --version
  21. echo.
  22. echo [1/4] Installing dependencies...
  23. pip install pyinstaller flask sounddevice soundfile numpy pillow pystray lameenc --quiet
  24. if errorlevel 1 (
  25. echo [ERROR] pip install failed.
  26. pause & exit /b 1
  27. )
  28. echo Dependencies OK.
  29. echo.
  30. echo [2/4] Preparing source files...
  31. if not exist "src" mkdir src
  32. if exist "audio_recorder_server.py" (
  33. copy /Y "audio_recorder_server.py" "src\audio_recorder_server.py" >nul
  34. echo Copied audio_recorder_server.py to src\
  35. ) else (
  36. echo [ERROR] audio_recorder_server.py not found in this folder!
  37. echo Place audio_recorder_server.py alongside BUILD.bat and try again.
  38. pause & exit /b 1
  39. )
  40. if not exist "src\launcher.py" (
  41. echo [ERROR] src\launcher.py not found!
  42. pause & exit /b 1
  43. )
  44. echo Source files OK.
  45. echo.
  46. echo [3/4] Running PyInstaller (may take 2-3 minutes)...
  47. echo.
  48. pyinstaller "%~dp0AudioRecorder.spec" --clean --noconfirm
  49. if errorlevel 1 (
  50. echo.
  51. echo [ERROR] PyInstaller failed. See output above.
  52. pause & exit /b 1
  53. )
  54. echo.
  55. echo [4/4] Done!
  56. echo.
  57. echo ================================================
  58. echo SUCCESS: dist\AudioRecorder.exe
  59. echo ================================================
  60. echo.
  61. echo Double-click AudioRecorder.exe to launch.
  62. echo It will appear as a system tray icon.
  63. echo Right-click the tray icon for controls.
  64. echo.
  65. if exist "dist\AudioRecorder.exe" explorer "%~dp0dist"
  66. pause