Hereβs a fancier and user-friendly version of the batch script with clear customer-facing language, debug info for reporting, and improved symbols for feedback. It will make the experience more polished and easier to understand for the customer.
Save as run_debug_with_bun.bat
@echo off REM ========================== REM Fancy Debug Automation Script REM ==========================
REM Set constants set OBS_PORT=1234 set SCRIPT_PATH=saveConsoleAndHAR.js set DEBUG_LOG=debug_info.log
REM Clear any previous debug logs if exist %DEBUG_LOG% del %DEBUG_LOG%
echo ============================================================ echo π Welcome to the OBS Debug Automation Script π echo ============================================================ echo This script will: echo 1οΈβ£ Start OBS Studio with remote debugging. echo 2οΈβ£ Ensure Bun and Puppeteer are installed. echo 3οΈβ£ Run the debug script to collect console logs and HAR data. echo ============================================================ echo.
REM -------------------------------------------------------------- REM Step 1: Locate OBS Path from Registry REM -------------------------------------------------------------- echo βοΈ Step 1: Locating OBS Studio... for /f "tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" /s /f "OBS Studio" ^| findstr "InstallLocation"') do ( set OBS_PATH=%%b )
if "%OBS_PATH%"=="" ( echo π ERROR: OBS Studio not found in the Windows Registry. >> %DEBUG_LOG% echo Possible Issues: echo - OBS Studio is not installed. echo - OBS Studio installation was not added to the Registry. echo π‘ Solution: Please reinstall OBS Studio. echo Debug Info: See %DEBUG_LOG% for details. pause exit /b )
set OBS_EXEC="%OBS_PATH%\bin\64bit\obs64.exe" if not exist %OBS_EXEC% ( echo π ERROR: OBS executable not found at %OBS_EXEC%. >> %DEBUG_LOG% echo Possible Issues: echo - OBS Studio installation might be incomplete. echo π‘ Solution: Verify the OBS installation path. echo Debug Info: See %DEBUG_LOG% for details. pause exit /b )
echo β OBS Studio found at: %OBS_EXEC% echo.
REM -------------------------------------------------------------- REM Step 2: Start OBS with Remote Debugging REM -------------------------------------------------------------- echo βοΈ Step 2: Starting OBS Studio with remote debugging on port %OBS_PORT%... start "" %OBS_EXEC% --remote-debugging-port=%OBS_PORT% if %ERRORLEVEL% neq 0 ( echo π ERROR: Failed to start OBS Studio. >> %DEBUG_LOG% echo π‘ Solution: Ensure OBS Studio is properly installed and accessible. echo Debug Info: See %DEBUG_LOG% for details. pause exit /b ) echo β OBS Studio started successfully. echo.
REM --------------------------------------------------------------
REM Step 3: Check and Install Bun
REM --------------------------------------------------------------
echo βοΈ Step 3: Checking for Bun...
bun --version >nul 2>&1
if %ERRORLEVEL% neq 0 (
echo
REM --------------------------------------------------------------
REM Step 4: Check and Install Puppeteer
REM --------------------------------------------------------------
echo βοΈ Step 4: Checking for Puppeteer...
bun pm ls puppeteer >nul 2>&1
if %ERRORLEVEL% neq 0 (
echo
REM -------------------------------------------------------------- REM Step 5: Run the Puppeteer Script REM -------------------------------------------------------------- echo βοΈ Step 5: Running Puppeteer script to collect logs and HAR data... bun run %SCRIPT_PATH% >> %DEBUG_LOG% 2>&1 if %ERRORLEVEL% neq 0 ( echo π ERROR: Puppeteer script execution failed. >> %DEBUG_LOG% echo Possible Issues: echo - Script syntax issues. echo - Puppeteer-related errors. echo π‘ Solution: Verify the script and dependencies. echo Debug Info: See %DEBUG_LOG% for details. pause exit /b ) echo β Debugging complete! Logs and HAR data have been saved. echo.
REM -------------------------------------------------------------- REM Completion REM -------------------------------------------------------------- echo π All tasks completed successfully! π echo You can find the collected data in the output files. echo If you encounter any issues, please share %DEBUG_LOG% with your support team. pause
Key Features of the Script:
1. Fancy Design:
β’ Uses symbols (β
, π,
Output Example:
============================================================ π Welcome to the OBS Debug Automation Script π
This script will: 1οΈβ£ Start OBS Studio with remote debugging. 2οΈβ£ Ensure Bun and Puppeteer are installed. 3οΈβ£ Run the debug script to collect console logs and HAR data.
βοΈ Step 1: Locating OBS Studio... β OBS Studio found at: "C:\Program Files\obs-studio\bin\64bit\obs64.exe"
βοΈ Step 2: Starting OBS Studio with remote debugging on port 1234... β OBS Studio started successfully.
βοΈ Step 3: Checking for Bun... β Bun is already installed.
βοΈ Step 4: Checking for Puppeteer... β Puppeteer is already installed.
βοΈ Step 5: Running Puppeteer script to collect logs and HAR data... β Debugging complete! Logs and HAR data have been saved.
π All tasks completed successfully! π You can find the collected data in the output files. If you encounter any issues, please share debug_info.log with your support team.
How It Helps: β’ Customers get clear, actionable messages at every step. β’ Debug logs can be shared with you for efficient troubleshooting. β’ Handles common issues gracefully with easy-to-understand solutions.