haughtonomous
haughtonomous

Reputation: 4850

installing a service app does not install it

I have read the other similar posts on this forum, I promise! However they haven't helped me

I want to create an installer (msi) for my service app such that it will automatically get installed without the customer having to use the commandline. I know this can be done.

I am using Visual Studio 2008 Team System, on Windows 7. My Windows account has admin privileges. I get the same experience trying to install the service in a Windows XP machine.

Here is what I have done to achieve this:

  1. Service app created and worker code independantly tested. I know the service does actually work once started.

  2. Added installer to the project, with serviceInstaller and serviceProcessInstaller. ServiceInstaller start type = manual, serviceProcessInstaller account = localsystem.

  3. Added a setup project to the solution, changed its property page entries to sensible values (author etc). Added custom actions (primary output from service project) for Install action through to Uninstall action.

  4. Built the solution.

  5. Executed the msi file to install the service. Error - "Cannot start service from the command line or a debugger. A Windows Service must first be installed... etc".

  6. The service isn't visible in the Services admin tool, so it clearly hasn't been installed. However AFAICS everything has been copied to the specified installation folder.

Two questions:

  1. I have methodically followed the msdn documentation (scattered all over the place, it must be said) but can anyone suggest what I could have missed out in setting this up, that would cause the service not to be installed?

  2. Why would it nevertheless be attempting to start the service when I have explicitly set startup to manual?

I tried manually installing the servivce using InstallUtil, but that failed too. The install log from that is:

Installing assembly 'C:\Program Files (x86)\Autoscribe\Matrix Gemini LIMS\Scheduler\MatrixTaskLauncher.exe'.
Affected parameters are:
   logtoconsole = 
   assemblypath = C:\Program Files (x86)\Autoscribe\Matrix Gemini LIMS\Scheduler\MatrixTaskLauncher.exe
   logfile = C:\Program Files (x86)\Autoscribe\Matrix Gemini LIMS\Scheduler\MatrixTaskLauncher.InstallLog
Installing service MatrixTaskLauncherService...
Creating EventLog source MatrixTaskLauncherService in log Application...
Rolling back assembly 'C:\Program Files (x86)\Autoscribe\Matrix Gemini LIMS\Scheduler\MatrixTaskLauncher.exe'.
Affected parameters are:
   logtoconsole = 
   assemblypath = C:\Program Files (x86)\Autoscribe\Matrix Gemini LIMS\Scheduler\MatrixTaskLauncher.exe
   logfile = C:\Program Files (x86)\Autoscribe\Matrix Gemini LIMS\Scheduler\MatrixTaskLauncher.InstallLog
Restoring event log to previous state for source MatrixTaskLauncherService.

which doesn't illuminate much. :-(

TIA

Upvotes: 0

Views: 136

Answers (1)

haughtonomous
haughtonomous

Reputation: 4850

Turned out to be a fault with the service application (no idea what). I deleted it from the solution and created a new one, added my worker class code and hey presto, it installs the service and I can start that too.

Upvotes: 1

Related Questions