I have the following declaration of my service:
<ServiceControl Id="ServiceStartStop"
Name="[name]"
Start="install"
Stop="both"
Remove="both"
Wait="no"/>
<ServiceInstall Id="ServiceRegister"
Name="[name]"
DisplayName="[displayname]"
Description="[description]"
Account="LocalSystem"
Arguments="-start"
ErrorControl="critical"
Interactive="yes"
Start="auto"
Type="ownProcess"
Vital="yes" >
<util:PermissionEx User="Authenticated Users"
ServiceChangeConfig = "yes"
ServiceEnumerateDependents = "yes"
ServiceInterrogate = "yes"
ServicePauseContinue = "yes"
ServiceQueryConfig = "yes"
ServiceQueryStatus = "yes"
ServiceStart = "yes"
ServiceStop = "yes"
ServiceUserDefinedControl = "yes" />
</ServiceInstall>
This compiles and links without any errors or warnings. The service exe
is properly specified using KeyPath="yes"
. When I run my msi, it can't get beyond at 'Starting Service...'. I get an error message, as follows:
The UAC is shown when I click 'Install', so what's going wrong?
The ServiceInstall Account must be fully qualified, as such:
<ServiceInstall ... Account="NT AUTHORITY\LocalService" />
It can fail if only specified like this:
<ServiceInstall ... Account="LocalService" />
I had the same problem, it was caused by an earlier version of the service still running on the system. To fix this launch an elevated command line prompt and type:
SC delete NameOfService
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With