Installing Windows Services using the “Setup and Deployment” template and creating a “Setup” project is significantly superior to using the “Installutil” command-line utility, but the steps involved in setting up a windows service to install using one of these projects can be a little involved.
Here is the most concise description available on-line:http://msdn.microsoft.com/en-us/library/zt39148a.aspx#4803
Please note that the section that I always get hung up on is adding the service to the "custom actions" section of the setup and deployment project:
To add a custom action to the setup project
-
In Solution Explorer, right-click the setup project, point to View, and then click Custom Actions.
The Custom Actions editor appears.
-
In the Custom Actions editor, right-click the Custom Actions node and click Add Custom Action.
The Select Item in Project dialog box appears.
-
Double-click the Application Folder in the list 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.
-
In Solution Explorer, right-click the MyServiceSetup project and click Build.
2 comments:
To do it in Visual Studio 2010:
http://msdn.microsoft.com/en-us/library/ddhy0byf.aspx
Oh ... to set how the service is titled in the list of services on the machine (i.e., when going through the list in Computer Management) and not have the generic name "Service1", update the project installer properties...
Post a Comment