How to deploy and start Windows Service?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mika M

    How to deploy and start Windows Service?

    I'm doing Windows Service programming using C# 2005. My solution
    contains Windows Service project. Then I added Setup and Deployment
    project into the same solution. Both service- and Setup and Deployment
    project are working fine. After running setup, it made files into the
    C:\Program Files\MyCompany \MyService, but how can I install service into
    the services and start this service using only Setup and Deployment project?

    Now I can do this using install.bat-file containing...

    C:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 \installutil /i MyService.exe
    NET START MyService

    ....and uninstall it using ininstall.bat-file containing...

    C:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 \installutil /u MyService.exe

    Or am I doing this correct way at all? What is the correct way to
    install this kind of service easily?

    --
    Thanks in advance!

    Mika
  • Claire

    #2
    Re: How to deploy and start Windows Service?

    Go into visual studio help and look for "services, adding installers"

    In my vis studio 2005 help it's at url
    ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio .v80.en/dv_radcon/html/8b698e9a-b88e-4f44-ae45-e0c5ea0ae5a8.ht m
    I've not worked out yet how to get the service to start after installation,
    so if you work it out then please post back here lol



    Comment

    • Mika M

      #3
      Re: How to deploy and start Windows Service?

      My deployment project was missing Custom Actions. I found instructions
      of the address http://support.microsoft.com/kb/816169

      Now it's going into services ok, but I'm having the same problem as you
      - how to start this service using only Setup and Deployment project without:

      1. booting computer
      2. or going into Start/Control Panel/Administrative Tools/Services and
      start it there.
      3. or using NET START MyService -command

      thanks for the tip anyway!

      Claire kirjoitti:
      Go into visual studio help and look for "services, adding installers"
      >
      In my vis studio 2005 help it's at url
      ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio .v80.en/dv_radcon/html/8b698e9a-b88e-4f44-ae45-e0c5ea0ae5a8.ht m
      I've not worked out yet how to get the service to start after installation,
      so if you work it out then please post back here lol
      >
      >
      >

      Comment

      Working...