Creating a Windows service
There are dozens of services running on every Windows machine all of the time: some to keep your machine updated or secure, some to provide access to installed databases, others to watch for malicious activity, and many others to provide myriad functionality. Delphi has supported building Windows services for a long time. In fact, it's pretty simple to get one up and running—just follow these steps to bring the data modules from our console app into a new service app:
- Create a new Windows Service application (navigate to File | New | Other from the menu, and then expand Delphi and Windows).
- Answer "Yes" to enable the Visual Component Library framework.
- Add the two data modules we created for the server:
udmParksDB
andudmTCPParksServer
. - Add the logging units of
LoggerPro
,LoggerPro.FileAppender
, anduMyParksLogging
(these are the same ones from the previous server project except for the console logging unit).
...