57 lines
1.7 KiB
Batchfile
57 lines
1.7 KiB
Batchfile
@echo off
|
|
REM Windows Print Service - Troubleshooting and Testing Script
|
|
REM Use this to test the service before installing it as a Windows service
|
|
|
|
echo =========================================
|
|
echo Windows Print Service - Test Mode
|
|
echo =========================================
|
|
echo.
|
|
|
|
REM Set variables
|
|
set CURRENT_DIR=%~dp0
|
|
set SERVICE_NAME=QualityPrintService
|
|
set INSTALL_DIR=C:\QualityPrintService
|
|
set PYTHON_EXE=%INSTALL_DIR%\python_embedded\python.exe
|
|
set PYTHON_SCRIPT=%INSTALL_DIR%\print_service_complete.py
|
|
|
|
echo [INFO] Testing service in standalone mode...
|
|
echo [INFO] This helps diagnose issues before installing as Windows service
|
|
echo.
|
|
|
|
REM Check if files exist
|
|
if not exist "%PYTHON_EXE%" (
|
|
echo [ERROR] Python not found at: %PYTHON_EXE%
|
|
echo [INFO] Make sure the service is installed first using install_service_complete.bat
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
if not exist "%PYTHON_SCRIPT%" (
|
|
echo [ERROR] Service script not found at: %PYTHON_SCRIPT%
|
|
echo [INFO] Make sure the service is installed first using install_service_complete.bat
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo [INFO] Files found, starting service test...
|
|
echo [INFO] Python: %PYTHON_EXE%
|
|
echo [INFO] Script: %PYTHON_SCRIPT%
|
|
echo.
|
|
echo [INFO] Starting service in test mode...
|
|
echo [INFO] Press Ctrl+C to stop the service
|
|
echo [INFO] Service will run on http://localhost:8765
|
|
echo.
|
|
|
|
REM Change to service directory
|
|
cd /d "%INSTALL_DIR%"
|
|
|
|
REM Start service in standalone mode for testing
|
|
"%PYTHON_EXE%" "%PYTHON_SCRIPT%" --standalone
|
|
|
|
echo.
|
|
echo [INFO] Service test completed.
|
|
echo [INFO] If the service ran successfully above, you can now:
|
|
echo [INFO] 1. Test it: http://localhost:8765/health
|
|
echo [INFO] 2. Start Windows service: net start %SERVICE_NAME%
|
|
echo.
|
|
pause |