Copy link to clipboard
Copied
Hi, I'm trying to use the ServerSocket class in AIR to make a server of some sort. The problem is that I cannot get it to run as a windows service. I used "sc create" to create the service. I don't call nativeWindow.activate, so there shouldn't be a UI. The service is set to log on as my user. But when I try to run it, I get "Error 1053: The service did not respond to the start or control request in a timely fashion".
How can I get it to run as a service?
Thanks,
Sean
Copy link to clipboard
Copied
Hi Sean,
Unfortunately, I don't have an answer to this question, but I'm hoping others in the community can help out. Running AIR as a service has been a popular request, but not something we officially support at this time. There have been a couple of feature requests made for this that I'd encourage you and others interested to go vote on:
Run AIR app as a service on a server machine without user logon on the machine
Register and run as Services on OS
Googling "Error 1053: The service did not respond to the start or control request in a timely fashion" returns quite a few hits, with responses ranging from increasing time out lengths, changing logon account types, and many other service property tweaks.
Please let us know if your able to get this to work and hopefully others can contribute their experiences as well.
Chris
Copy link to clipboard
Copied
Thanks for the response Chris. I tried every combination of options I could find, and I always got that message. I'm going to try using a service wrapper now.
Sean
Copy link to clipboard
Copied
I've gotten my service to run using Apache's procrun. It has a nice monitor (although it has some java config options that do nothing when running an AIR app), and is pretty easy to install. I include this install.bat script in the main source folder:
@echo off
echo Stopping monitor
MyServicew //MQ
echo Stopping existing service
MyService //SS
echo Installing service if it doesn't exist
MyService //IS
echo Updating service
MyService //US --DisplayName="My Service" --Description="Description of my service." --StartMode=exe --StartImage="%CD%\AIRAppName.exe" --StartParams="service;start" --StopParams="service;stop" --StopTimeout=5 --LogPath="./"
echo Starting monitor and service
start MyServicew //MR
pause
Then my AIR app handles the invoke events with 'service start' and 'service stop'.
Sean