I wrote a windows service that runs on Framework 4.0 and running in VS 2015. I also created a setup project (free Installshield version).
My service did not show und
After some digging I found out that the installer fails with that error when it tries to remove the service (associated with whatever you are installing) - AND (the service) is not there anymore. My use case scenario - Start install from MVS2015 of a complex solution that comprises also a windows service. When you change the version of the solution, the installer stops in its tracks finding that the your app was installed before and can not uninstall it as it is a different version. It pops up a dialog box stating this and exits .... BUT IT HAS UNINSTALLED the service. Now trying to install or uninstall fails with the error 1001 because windows doesn't find the service to uninstall it.
If somebody has a better solution please post it, but my solution is to use sc command line utility. sc is a utility that can be used to manipulate services from the command line (type sc for help). So i use sc to add the service (by name), and then I can do uninstall, or install as usual. Is compulsory to have a valid bin path in command - but ANY valid path will be accepted.
sc create [service name] [binPath= ] ...
Example:
sc create MyService binPath= C:\Windows\explorer.exe
[SC] CreateService SUCCESS