none
Install WCF Service Without InstallUtil and Without Setup.exe RRS feed

  • Question

  • I have a service that I would like to host as a Windows Service.  I would like to avoid the overhead of an install msi (especially since this would be the only thing to install) and have the client check to see if the service exists, if not install the service.  How do you install a Windows Service in code?

    Jason

    Tuesday, March 19, 2013 8:38 PM

Answers

  • Hi Jason,

    Check this out

    http://www.c-sharpcorner.com/UploadFile/sachin.nigam/InstallingWinServiceProgrammatically11262005061332AM/InstallingWinServiceProgrammatically.aspx

    Bless you Google......


    ViBi

    Wednesday, March 20, 2013 5:21 AM

All replies

  • On 3/19/2013 4:38 PM, BJHuffine wrote:

    I have a service that I would like to host as a Windows Service.  I would like to avoid the overhead of an install msi (especially since this would be the only thing to install) and have the client check to see if the service exists, if not install the service.  How do you install a Windows Service in code?

    InstallUtil is for installing a Windows service application or called a Windows NT service application. It has nothing to do with installing a WCF service.

    The rest of what you are talking about kind of makes no sense when it comes to a WCF service.

    Wednesday, March 20, 2013 4:19 AM
  • Hi Jason,

    Check this out

    http://www.c-sharpcorner.com/UploadFile/sachin.nigam/InstallingWinServiceProgrammatically11262005061332AM/InstallingWinServiceProgrammatically.aspx

    Bless you Google......


    ViBi

    Wednesday, March 20, 2013 5:21 AM
  • InstallUtil is a command line tool that is a nice way to avoid having to develop a Setup project just to test your service.  It's not exactly a friendly approach for everyone else.  This doesn't make a lot of sense to you because you don't understand my current need and setup.  I didn't go into that to prevent confusing the question with background information. 

    You can consider the design of this as being several parts.  The first is a third-party product that I have no control over.  I can, however, develop a loadable class library using the third-party's api that the third-party application can recognize and load into its process space.  This class library is the second part.  The third part is an exe that I am also developing which has a need to communicate across process boundaries between it and the class library (second part).  To keep from confusing this with the third-party application I'll call this MyApp.exe.  And no, I can't use MSMQ or other messaging technologies due to restrictions on our machines thanks to our corporate IT policies.  That makes this WCF Windows Service the fourth part.  I would like this service application to be running all the time regardless of how many instances of the third-party product are running.  That way the MyApp.exe can communicate with the third-party application's loaded dll regardless of how many instances are running at any point in time. 

    To do this I would like to run the install in-code to avoid having to develop a full-blown setup project just for the one service application.  The dll can check to see that the service exists, if not, run the install code and start it up.


    Jason

    Wednesday, March 20, 2013 11:38 AM
  • ViBi,

    Thanks for the link!  It's not pretty with all the P/Invoke it uses, but I'll give it a try and see how it works.


    Jason

    Wednesday, March 20, 2013 11:41 AM