Sean
Sean

Reputation: 1557

Windows Service installed by Wix

I'm using WiX 3.6 to create an installer for a windows service. I have the solution building and am able to install the service on my development machine and the service starts just like I wanted.

The problem arises when I copy the msi (either Build or Release) to a Windows Server 2003 R2 machine that the service will run on.
I am able to install the service, but when I try to start the service I get an error

"Service failed to start. Verify that you have sufficient privileges to start system service."

Now I am able to install and start other services that I created so I now I that I do have permissions to the server. Below is my service install element.

My question is, what I am I missing that the service starts on the development machine and not the server?

   <File Id="CopyService.exe" Name="CopyService.exe" Source="..\CopyService\bin\$(var.CopyService.Configuration)\CopyService.exe" Vital="yes" KeyPath="yes" DiskId="1"/>
    <File Id="App.config" Name="CopyService.exe.config" Source="..\CopyService\bin\$(var.CopyService.Configuration)\CopyService.exe.config" Vital="yes" KeyPath="no" DiskId="1"/>
      <ServiceInstall
               Id="ServiceInstaller"
                Type="ownProcess"
                Vital="yes"
                Name="ACSIAccountingReports"
                DisplayName="ACSI Accounting Reports"
                Description="Service copies accounting reports from NetForum into an ACSI network folder."
                Start="auto" 
                Account="LocalSystem"
                ErrorControl="ignore"          
                Interactive="no">
    </ServiceInstall>
    <ServiceControl Id="StartService" Name="ACSIAccountingReports" Start="install" Wait="yes" />
    <ServiceControl Id="StopService" Name="ACSIAccountingReports" Stop="both" Wait="yes" Remove="uninstall" />

Upvotes: 2

Views: 1966

Answers (1)

Rob Mensching
Rob Mensching

Reputation: 35946

The error message you are seeing is the default error message from the Windows Installer for all service install failures. It's not terribly helpful. To debug the real issue, try to start your service again while the error dialog is up. It is likely you'll get a more detailed error message about why your service is not starting. If you still get nothing, try using a tool like depends.exe or fuslogvw (to turn on NETFX assembly load failures) to see if you service executable has some missing dependencies.

Remember, GAC'd files are not completed until the very end of the install. Therefore, your service cannot depend on GAC'd files and start the service during the install.

Upvotes: 1

Related Questions