Windows service not listed when using an MS setup project

Problem: You’ve created a Windows service and it installs fine with installutil.exe, however when you create a Setup Project (in Visual Studio 2010) and set the primary output to the Windows service project, the installer runs successfully, but yours service doesn’t appear in the services list.

Solution: After googling a bit, it turns out you need to add two custom actions to your setup project, one for Install and one for Uninstall, which simply link to the primary output. Here’s what you should have:

After that, rebuild your setup, run and your service should appear.