'how to skip windows service installation from setup project?

I have a setup installer using Visual Studio 2015, which is working fine on the normal scenario.

But due to my scenarios I had to add a Windows service in my project, but I want this service to be installed only at one place since it's a communication service between govt. website. While this setup has to be installed in all the User PC but my service should be skipped, except server.

How can I handle this part into the custom action of the Setup project?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source