October 2010
Intermediate to advanced
348 pages
7h 10m
English
Now that you know how to install a service from the command line, let's look at how to do it with an installer. WiX has an element called ServiceInstall that you can use to add a new service to the services management console. This assumes that you've already created the executable file that will become the endpoint for your service, as discussed earlier.
First of all, we'll use the familiar Component and File elements to install the .exe to the install directory on the target machine. Add the following code to your WiX project:
<DirectoryRef Id="INSTALLLOCATION"> <Component Id="CMP_WindowsService1" Guid="3D3DE5C1-7154-4c61-9816-248A85F6DEBF"> <File Id="WindowsService1.exe" Name="WindowsService1.exe" KeyPath="yes" ...
Read now
Unlock full access