Installing a windows service

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

    #1

    Installing a windows service

    I've created a windows service and tested it. It works the way I want
    it to. I added a ProjectInstalle r and set the appropriate properties
    in my Windows Service project. To install it, I went to a Visual
    Studio Command Prompt and issued the appropriate InstallUtil
    <path\executabl ecommand and the service runs perfectly on my
    development machine. What I can't figure out is how to install on it
    any other machine. Any pointers or links to information would be
    appreciated, I've search the 'net and this newsgroup and haven't found
    an answer.

  • Chris Dunaway

    #2
    Re: Installing a windows service


    BK wrote:
    I've created a windows service and tested it. It works the way I want
    it to. I added a ProjectInstalle r and set the appropriate properties
    in my Windows Service project. To install it, I went to a Visual
    Studio Command Prompt and issued the appropriate InstallUtil
    <path\executabl ecommand and the service runs perfectly on my
    development machine. What I can't figure out is how to install on it
    any other machine. Any pointers or links to information would be
    appreciated, I've search the 'net and this newsgroup and haven't found
    an answer.
    This may not be what you want, but I used the code at this link:
    http://tinyurl.com/yexh6z to make my service self-installable. It adds
    a /install and /uninstall switch to be able to install the service.

    You can use this code and then add a step to your install project to
    get the service to install itself.

    Chris

    Comment

    • Blake

      #3
      Re: Installing a windows service

      ^^^ What he says. :-)

      I make every windows service self-installable now. Saves a lot of
      hassle.

      It is also possible to create a single exe that can be a service *and*
      a stand alone app.

      If you want to get super-creative you can make your exe also behave as
      a console listener for the
      service if the service is installed and running.

      -Blake

      On Dec 8, 9:25 am, "Chris Dunaway" <dunaw...@gmail .comwrote:
      BK wrote:
      I've created a windows service and tested it. It works the way I want
      it to. I added a ProjectInstalle r and set the appropriate properties
      in my Windows Service project. To install it, I went to a Visual
      Studio Command Prompt and issued the appropriate InstallUtil
      <path\executabl ecommand and the service runs perfectly on my
      development machine. What I can't figure out is how to install on it
      any other machine. Any pointers or links to information would be
      appreciated, I've search the 'net and this newsgroup and haven't found
      an answer.This may not be what you want, but I used the code at this link:http://tinyurl.com/yexh6zto make my service self-installable. It adds
      a /install and /uninstall switch to be able to install the service.
      >
      You can use this code and then add a step to your install project to
      get the service to install itself.
      >
      Chris

      Comment

      • BK

        #4
        Re: Installing a windows service

        Thanks, this will get me started.

        Comment

        • BK

          #5
          Re: Installing a windows service

          I was looking for a managed code solution, or even just a way to
          manually install the service on another machine. This service will
          only be used on one machine, perhaps a few machines at some point down
          the road. For now, I need to find a way to install it on to a machine
          easily, it doesn't even have to happen programatically . Thanks in
          advance,

          BK

          Comment

          • BK

            #6
            Re: Installing a windows service

            This article cleared it all up:

            http://msdn.microsoft.com/library/de...tml/vs05d1.asp

            Thanks for the replies.

            Comment

            • Master Programmer

              #7
              Re: Installing a windows service

              Just write values to the registry....

              "HKEY_LOCAL_MAC HINE\System\Cur rentControlSet\ Services\MyServ ice",
              "DisplayNam e", "My Program Description"

              "HKEY_LOCAL_MAC HINE\System\Cur rentControlSet\ Services\MyServ ice",
              "ErrorContr ol", 1

              "HKEY_LOCAL_MAC HINE\System\Cur rentControlSet\ Services\MyServ ice",
              "ImagePath" , "C:\MyExe.e xe"

              "HKEY_LOCAL_MAC HINE\System\Cur rentControlSet\ Services\MyServ ice",
              "ObjectName ", "LocalSyste m"

              "HKEY_LOCAL_MAC HINE\System\Cur rentControlSet\ Services\MyServ ice",
              "Start", 2

              "HKEY_LOCAL_MAC HINE\System\Cur rentControlSet\ Services\MyServ ice",
              "Type", 272


              The Grand Master

              BK wrote:
              I was looking for a managed code solution, or even just a way to
              manually install the service on another machine. This service will
              only be used on one machine, perhaps a few machines at some point down
              the road. For now, I need to find a way to install it on to a machine
              easily, it doesn't even have to happen programatically . Thanks in
              advance,
              >
              BK

              Comment

              Working...