So I have an MSI that deploys a service.
<ServiceInstall Id='ServiceInstall' ErrorControl='ignore' Type='ownProcess' DisplayName='MetricsReportingService' Description='It does metrics reporting' Name='MetricsReportingService' Start='auto' Account='[SERVICEACCOUNT]' Password='[SERVICEACCOUNTPASSWORD]' />
<ServiceControl Id='MetricsReportingService' Remove='uninstall' Name='MetricsReportingService' Start='install' Stop='both' Wait='yes' />
When I deploy this service on my own boxes, deployment works great, but when I deploy on another person’s machine I get Error 1920, service failed to start.
Now, I’m using the exact same service account and password on both machines (the account has admin permissions on both machines). In fact, I’m using all the same parameters on both machines, but on one it passes and on the other I get that failure.
I don’t see any event logging from my service, so it doesn’t seem to be making it to my code.
What could be causing this discrepancy?
When installing a service for a custom user account you need to make sure that the account has privileges for starting services (it doesn’t have them by default). A solution is to set these privileges by using ntrights.exe as a custom action:
http://support.microsoft.com/kb/315276
For example, you can use this command line:
You can also try using a DLL custom action which sets the privileges through custom code. This custom action should run before the service is installed.