Several tools out there allow you to take a Windows executable and run it as a system service. I can think of two...
reasons why running an executable as a system service is useful:
- You can start any application before any user login takes place.
- You can run applications consistently across user sessions no matter what else is going on.
The tool for implementing this concept that may be the most well thought out is FireDaemon. Like other programs in this space, it takes a Windows application and runs it as a service rather than a console or desktop application.
FireDaemon's strength lies in how it allows an application's GUI to be managed even while the program itself is running non-interactively. The GUI for the "wrapped" program can be shown or suppressed entirely, and FireDaemon can be programmed to supply automatic responses to any dialog boxes that the program might generate (for instance, to say yes to confirmation dialogs).
Programs can be granted or denied the ability to interact with the desktop, or run under any user or system account as needed. A "Graceful Shutdown" option lets you close the program in question by sending the proper console or GUI API event notifications (and close any pending dialog boxes as well, if the GUI has popped them up).
There are options for handling other program behaviors aside from the GUI. If a program writes output to stdout—for instance, a console program that returns results to the console—those results can be captured or appended to a file. Another handy function is the pre-service/post-service applications setting, which lets you set other programs to run before and after the application is launched as a service. Other behaviors can be triggered to run in the event of the application crashing, including "flap detection", which limits the number of times a program is restarted if it shuts down unexpectedly.
FireDaemon is a commercial program, rather than shareware or open source. But there is a 30-day trial version of the program that's fully functional, so you can get a feel for whether or not it does the job of "wrapping" a particular program as a service.
About the author: Serdar Yegulalp is editor of the Windows Insight, (formerly the Windows Power Users Newsletter), a blog site devoted to hints, tips, tricks and news for users and administrators of Windows NT, Windows 2000, Windows XP, Windows Server 2003 and Vista. He has more than 12 years of Windows experience under his belt, and contributes regularly to SearchWinComputing.com and SearchSQLServer.com.
More information on this topic: