To install a service, you can use the sc utility. The steps are:
- Copy the executable and all its dependencies into a directory (
%SYSTEMROOT%\System32
is perfectly valid).
- Run as administrator of the computer the command:
sc create MathsService binPath= %SYSTEMROOT%\System32\Maths.exe type= own type= interact start= demand DisplayName= "My fabulous Maths service"
Where MathsService is the name of the service, the argument to binPath is the binary location and DisplayName argument is the name that shows on services.msc. The argument to start can be boot (not suitable for a service), system (not suitable for a service), auto (autostart), demand (on demand start, you have to start your service manually) or disabled (service will not start even manually).
In this example, i use type= own type= interact. This allows the service to interact with the desktop (for TCP/IP communications, for example).
Complete reference of sc sintaxis is available running sc. Also check http://support.microsoft.com/kb/251192