title: How to check if a windows service is installed in C#
body: <p>I've written a Windows Service that exposes a WCF service to a GUI installed on the same machine.  When I run the GUI, if I can't connect to the service, I need to know if it's because the service app hasn't been installed yet, or if it's because the service is not running.  If the former, I'll want to install it (as described <a href="https://stackoverflow.com/questions/255056/install-a-net-windows-service-without-installutil-exe/255062#255062">here</a>); if the latter, I'll want to start it up.</p>
  
  <p>Question is: how do you detect if the service is installed, and then having detected that it's installed, how do you start it up?</p>