Add reliable built-in demo mode
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
$projectRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
Set-Location -LiteralPath $projectRoot
|
||||
|
||||
$existingListener = Get-NetTCPConnection -LocalPort 5760 -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1
|
||||
if ($existingListener) {
|
||||
$existingProcess = Get-CimInstance Win32_Process -Filter "ProcessId=$($existingListener.OwningProcess)" -ErrorAction SilentlyContinue
|
||||
Write-Host ""
|
||||
Write-Host "The simulator is already LISTENING on tcp:127.0.0.1:5760." -ForegroundColor Green
|
||||
Write-Host "Process: $($existingListener.OwningProcess) $($existingProcess.Name)"
|
||||
Write-Host "Leave that simulator running and select 'Simulator (TCP 5760)' in SUB Control."
|
||||
Write-Host ""
|
||||
exit 0
|
||||
}
|
||||
|
||||
if (Test-Path -LiteralPath ".venv\Scripts\python.exe") {
|
||||
& .venv\Scripts\python.exe -u fc_spoofer.py @args
|
||||
} else {
|
||||
& python -u fc_spoofer.py @args
|
||||
}
|
||||
Reference in New Issue
Block a user