views:

76

answers:

0

Possible Duplicate:
Automatically start a Windows Service on install

I have a Windows service that I've flagged for automatic start-up in its installer. I use a Setup Project to install the service, which works fine, but I can't figure out how to get it to automatically start the service.

Is there a way I can tell either the setup project, the service's installer, or InstallUtil.exe that the service should start once it's been installed? Or at the very least, is there a way to do it in .Net somehow?

I tried following this suggestion, but it didn't seem to work. I put the class in my service project, but the service wasn't started. I also tried putting similar code in my service's project installer, but that, too, didn't work.