Richard
Richard

Reputation:

ServiceInstall or ServiceControl Problem

During Installation, I'm installing my service using ServiceInstall and ServiceControl tags. But, my service is not running. I'm getting error message "Please check you have sufficient privilege to start service". But, I'm in Administrators group. I'm using Wix ver 3.0.

code snippet is here,

<File Id='myexe' Name='myexe.exe' DiskId='1'
        Source='myexe.exe' Vital='yes'>
</File>

<ServiceInstall Id='myService' DisplayName='MySampleService' 
                Name='MySampleService' 
                ErrorControl='normal' Start='auto' 
                Type='ownProcess' Vital='yes' />

     <ServiceControl Id="StartService"
                  Name="MySampleService" Start="install" Wait="yes" />
     <ServiceControl Id="StopService" Name="MySampleService"
                  Stop="both" Wait="yes" Remove="uninstall" />

Please help me.

Upvotes: 2

Views: 2756

Answers (4)

M&#246;ssler
M&#246;ssler

Reputation: 21

do not try to start .NET Services depending on Components being installed into the Global Assembly Cache GAC, ServiceStart comes too early for that

Upvotes: 2

Andrei U
Andrei U

Reputation: 731

Try to use util:User element

for example:

<util:User Id="myServiceUser" Name="[USERNAME]" LogonAsService="yes" UpdateIfExists="yes" CreateUser="no"
                   FailIfExists="no" />

Upvotes: 0

Vapour in the Alley
Vapour in the Alley

Reputation: 496

You could also examine Window Eventlog to identify the problem. If the problem is a missing binary the you can use Depends to find out what is missing.

Upvotes: 0

Rob Mensching
Rob Mensching

Reputation: 36026

That is the generic error you get when the service fails to install or start (if you are telling it to do that) for any reason. It is very frustrating. The only way to debug is slowly remove dependencies until things finally work. More often than not, the service requires some code (an assembly in the GAC?) that isn't fully configured until later.

I usually debug by looking at the Services.msc and trying to start the service while the error message is up. That typically provides better error messages than the Windows Installer does.

Upvotes: 2

Related Questions