There are APIs which let you create a service, can't remember exactly what they are. NtCreateService or something.

The installer just used that.

Slarty