I\'ve created a windows service in C#, using Visual Studio 2008 I pretty much followed this: http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx
I created
I had this same issue and then I realized that I never set the parent for the ServiceInstaller.
Double-click on your project installer. The designer should show a Service Installer and Process Installer. When you click on either and view the properties you should note the Parent attribute which must both be set to the class name of the Project Installer.
Or, if you do it in code, make sure you set:
serviceInstaller.Parent = this;
and
serviceProcessInstaller.Parent = this;
remember to check the name you've given your service before you search. (right click-> properties->check the service name
Here is a good tutorial from tgeek001 from CodeProject.com that helped me. It includes several things I didn't see in the posts above: 1. Event handler code to stop the service before uninstalling it 2. Specific conditions and properties in the Custom Actions code to set in order to prevent failures (these fixed the Error 1001 that I experienced while following the instructions in the accepted answer above) 3. Win Service property "Remove Previous Version" dropdown set to true
http://www.codeproject.com/Tips/575177/Window-Service-Deployment-using-VS
The following is from the tutorial for Custom Actions Settings (case matters):
Lastly, in the WinService project, make sure to set the dropdown "Remove Previous Versions" to true.
cheers
Follow these instructions, they worked for me. For the setup specifically, that part is near the bottom of the article.
MSDN: Walkthrough: Creating a Windows Service
The most important part of the article you linked, is here
To add a custom action to the setup project
1.In Solution Explorer, right-click the setup project, point to View, then choose Custom Actions. The Custom Actions editor appears.
2.In the Custom Actions editor, right-click the Custom Actions node and choose Add Custom Action. The Select Item in Project dialog box appears.
3.Double-click the application folder in the list box to open it, select primary output from MyNewService (Active), and click OK. The primary output is added to all four nodes of the custom actions � Install, Commit, Rollback, and Uninstall.
4.Build the setup project.
If you skip these steps, your setup project will build and copy your files to the correct directory; however, they will not register your binary as a service without these steps.
I should also note that this works for older versions of Visual Studio that had/have the built-in Setup/Deployment project template. The newer versions of Visual Studio have different setup/deployment projects (some requiring third party software.)
I'd recommend looking into WiX Toolset and check here for WiX Installation of Windows Services.
In Visual Studio 2013 I ran into the same problem using InstallShield template for service application. But it works like charm when using Setup Project template https://visualstudiogallery.msdn.microsoft.com/9abe329c-9bba-44a1-be59-0fbf6151054d
so download Setup Project template close your Studio, run this installation and start your Studio, this will work.
Dunn.