2
votes

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" />
1
It should be noted that this is my first WiX project. The installers I created for other services were VS 2010 setup projects.Sean
Couple of observations rather than an answer. 1. In my experience you cannot have two ServiceControl elements for one service, I have found that only one will run and which one is not clear. 2. Does you service use components in the GAC? If so they are not installed until after the service start call this will often generate the error you are seeing.Neil

1 Answers

1
votes

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.