Client failed to launch on startup

Oh! In case anyone’s interested in the batch file…

Checks for network connectivity first, then checks that the Ignition service is running, then checks that the server’s port is being listened to. Still waits 30 seconds after all that (just because the ports being listened to doesn’t mean that the Ignition context is ready for business… :open_mouth: )

Requires the portqry command line app, but it’s a freebie from Microsoft.

@echo off

SET host=192.168.140.18
SET port=8088
CLS
SET /A Try=0

:CHECK_PING

SET /A Try=%Try%+1
ECHO Checking network connection, please wait... Try %Try%
PING -n 1 %host% | FIND "TTL" > NUL
IF NOT ERRORLEVEL 1 GOTO :PING_SUCCESS
IF ERRORLEVEL 1 GOTO :PING_FAIL

:PING_FAIL
ECHO PING FAILED, retrying...
GOTO :CHECK_PING

:PING_SUCCESS
ECHO PING SUCCESSFUL          
SET /A TRY=0
:CHECK_SERVICE

SET /A TRY=%TRY%+1
ECHO CHECKING SERVICE... Try %TRY%
sc \\%host% query ignition | FIND "STATE" | FIND "RUNNING" > NUL


IF NOT ERRORLEVEL 1 GOTO :SERVICE_SUCCESS
IF ERRORLEVEL 1 GOTO :SERVICE_FAIL

:SERVICE_FAIL
ECHO Ignition Service not yet RUNNING, checking again.
TIMEOUT /t 3
GOTO :CHECK_SERVICE

:SERVICE_SUCCESS
ECHO SERVICE SUCCESSFUL          
SET /A TRY=0

:CHECK_PORT
SET /A TRY=%TRY%+1
ECHO Checking for Server listening on port %port%... Try %TRY%

portqry -n %host% -e %port% -q

IF NOT ERRORLEVEL 1 GOTO :SUCCESS
IF ERRORLEVEL 1 GOTO :PORT_FAILED

:PORT_FAILED
ECHO Ignition not listening on port %port%, checking again.
TIMEOUT /t 3
GOTO :CHECK_PORT

:SUCCESS
ECHO All Okay. Waiting a bit longer, just to be sure!
TIMEOUT /t 30
C:\Windows\SysWOW64\javaws.exe -localfile "C:\Users\jordanc\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\59\e48e0bb-26133902"