If what you are trying to do is to uninstall a service, you've written, from within itself and you've added an installer to the project, you can simply instantiate your Installer class and call Uninstall. For example, if you dragged an installer onto the designer service and named that component "ProjectInstaller", you can get your service to uninstall itself with the following code:
var installer = new ProjectInstaller();
installer.Uninstall(null);