Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > install a C++ service project and register it with the windows service control applet
 

install a C++ service project and register it with the windows service control applet

I've got a windows service project, written in C++. I'd like to add it as part of a .msi setup / installer project. I can install it okay, but I'd like to also register the service with target machine, so that it appears in the windows service control manager applet (available from control panel -> administration -> services)

I can do this with the command

sc.exe create myservice binpath=c:\myservice.exe

How can I add this to the installer project?
john mccullough  Thursday, July 16, 2009 1:49 PM
If this is managed C++ you'd use Installer classes like C# does.
If it's plain C++, I don't believe there is any built-in support in VS setup projects. Those services are typically installed with a command line /Service, something like that. You'd run that as a custom action at install and the /unregserver (or whatever) as an uninstall custom action.
Phil Wilson
PhilWilson  Friday, July 17, 2009 7:58 PM
If this is managed C++ you'd use Installer classes like C# does.
If it's plain C++, I don't believe there is any built-in support in VS setup projects. Those services are typically installed with a command line /Service, something like that. You'd run that as a custom action at install and the /unregserver (or whatever) as an uninstall custom action.
Phil Wilson
PhilWilson  Friday, July 17, 2009 7:58 PM

You can use google to search for other answers

Custom Search

More Threads

• Application cannot be started
• How to redistribute clickonce applications
• Setting up IIS for Web-Deployed
• .NET 2.0 prerequisites
• Automating minor or major upgrades in VS05
• Deploying a system
• monitor windows installer
• Code Groups: What am I doing wrong?
• setup and deploy
• DeploymentDownloadException Timed Out