locked
Windows service not running from installer RRS feed

  • Question

  • I am attempting to create a Windows Service by following the instructions at http://msdn.microsoft.com/library/en-us/vbcon/html/vbwlkwalkthroughcreatingwindowsserviceapplication.asp.

    I can build the service and run it from the debugger, but if I run it from the installer it does nothing. That is, the installer runs and reports it was installed sucessfully, but no messages are ever posted to the event log from my service. I even tried putting System.Diagnostics.Debugger.Break() in my service and this never gets called.

    After installing my service, it appears in the Add or Remove Programs control panel, but does not appear in the list of services from Programs > Administrative Tools > Services. Also, I can install the service over and over, it does not give me an error message that the service is already installed.

    Another symptom is that, if I set the Account property in my serviceProcessInstaller to "User", I do not get a user account dialog when I run the installer.

    I suspect it is the installer that is broken, but I have double-checked I followed the steps in the web page. What else can I do to diagnose this?
    Friday, January 26, 2007 1:14 AM

Answers

  • Well, I gave this another try monday morning... and it worked first time. The only thing I changed was adding a bunch of fields like Author, DisplayName, Keywords, ProductName, etc. to the MyInstaller properties panel. I cannot understand how this could make the installer behave differently.

    I also shut down my PC for the weekend and restarted it this morning. Could this have fixed it?
    Monday, January 29, 2007 7:57 PM

All replies

  • Is your installer calling 'installutil.exe' on the windows service your are installing?

     

     

    Friday, January 26, 2007 7:43 PM
  • I don't know. I created a Visual Studio Setup project, as described in the tutorial mentioned earlier, which creates a MyInstaller project and a ProjectInstaller.cs file. Neither of these has any mention of "installutil.exe", but neither does the tutorial.

    I tried adding System.Diagnostics.Debugger.Break() to the ProjectInstaller.cs Install method, and this never gets called either.

    Can someone with more knowledge of installers than I look over the tutorial and see if it's doing anythig wrong?
    Friday, January 26, 2007 9:48 PM
  • Well, I gave this another try monday morning... and it worked first time. The only thing I changed was adding a bunch of fields like Author, DisplayName, Keywords, ProductName, etc. to the MyInstaller properties panel. I cannot understand how this could make the installer behave differently.

    I also shut down my PC for the weekend and restarted it this morning. Could this have fixed it?
    Monday, January 29, 2007 7:57 PM