October 2010
Intermediate to advanced
348 pages
7h 10m
English
The ServiceInstall elements works well for installing a service, but doesn't provide a way to start, stop, or uninstall one. For that, you'll use the ServiceControl element. It can be added to the same component as the ServiceInstall element thereby sending signals to the testsvc you're installing.
The following example starts the service during install and stops and removes it during uninstall. These actions happen during the deferred stage of the Execute sequence.
<DirectoryRef Id="INSTALLLOCATION">
<Component ... >
<File ... />
<ServiceInstall ... />
<ServiceControl
Id="sc_WindowsService1"
Name="testsvc"
Start="install"
Stop="both"
Remove="uninstall"
Wait="yes" /> </Component> </DirectoryRef> ...Read now
Unlock full access