title: create dependency between windows services startup
body: <p>I have created a windows service which is set to start automatically. This service connects to the database service on startup. The issue is the database service seems to start after my service. Is there is a programmatic way to define this dependency so that my service starts after the database service has started.</p>
  
  <p>I found this article <a href="http://www.boyce.us/windows/servertipcontent.asp?ID=7">http://www.boyce.us/windows/servertipcontent.asp?ID=7</a> which talks about adding a registry entry to do that. I would like to know if there is a C# way to do this? </p>
  
  <p><strong>Update:</strong></p>
  
  <p>Adding to the above question. Here is another scenario. The services are being installed using installshied which does not need a projectinsaller. It seems installshield looks for classes deriving from ServiceBase class and installs each service. How to add the dependency in such a scenario?</p>