# Quick fix script to update Backend service PYTHONPATH # Run this as Administrator to fix the ModuleNotFoundError param( [string]$InstallPath = "C:\inetpub\wwwroot\roa2web", [string]$ServiceName = "ROA2WEB-Backend" ) Write-Host "Fixing Backend service PYTHONPATH..." -ForegroundColor Cyan # Stop service Write-Host "Stopping service..." -ForegroundColor Yellow & nssm stop $ServiceName Start-Sleep -Seconds 3 # Update PYTHONPATH to shared directory $sharedPath = Join-Path $InstallPath "shared" Write-Host "Setting PYTHONPATH to: $sharedPath" -ForegroundColor Yellow & nssm set $ServiceName AppEnvironmentExtra "PYTHONPATH=$sharedPath" # Start service Write-Host "Starting service..." -ForegroundColor Yellow & nssm start $ServiceName Start-Sleep -Seconds 3 # Check status Write-Host "`nChecking service status..." -ForegroundColor Cyan & nssm status $ServiceName Write-Host "`nDone! Check logs at: $InstallPath\logs\backend-stderr.log" -ForegroundColor Green Write-Host "If errors persist, check the log file for details." -ForegroundColor Yellow