Job Savers NT Service AppWizard

I wrote this wizard, not so much because NT Services are hard to write, but simply
because they can be hard to debug if something is slightly wrong, so I figured I’d get
the code right, and then automate it.

Instruction

This NT Service wizard is pretty simple to use, you only have to privide:


  • Internal name – Which should be unique, and not include spaces.
  • Display name – The string that you see in the list of the services manager.
  • Comments – You have to decide what level of source code comments you want.

Generated Code

The first thing you will want to do is build your new service, once thats done you can install it by typing:


  • myservice.exe install

Then later on you can remove it with:


  • myservice.exe remove me

The first thing everyone asks me when writting a new service is “What do I do now?” well, once you have your
service code, you will add a thread to do the real work you want done, I normally
create my threat in the bottom of serviceMain, and then put code in serviceHandler so that
my thread gets started/stopped/paused on all the service control notifications.

Install/Uninstall

To install any wizard, you must simply copy the wizard (any .awx file) it to your devstudio/sharedide/template directory.


Conversly, to remove a wizard, simply deleting the .awx file from your template directory while DevStudio isnt running
will do it.


Known Problems

You will see (and can ignore) the following warnings when compiling this code:


  • Command line warning D4024 : unrecognized source file type ‘d’, object file assumed
  • Command line warning D4027 : source file ‘d’ ignored

Download NT Service AppWizard – 12.9KB

More by Author

Must Read