Thursday, July 19, 2007

.NET Setup Project Custom Actions

Ever created a .NET windows service in Visual Studio, added a setup project, set all of the properties to install and display the correct information during installation, only to have the service not show up in Windows' Services Microsoft Management Console (mmc)? You probably forgot to add the custom actions.

To add custom actions to your setup project:
1) Click the setup project in Solution Explorer
2) Click the Custom Actions Editor button at the top of Solution Explorer
3) Right-click on the Custom Actions node
4) Click Add Custom Action
5) In the Select Item in Project dialog box, select Application Folder from the dropdown
6) Click OK

That's it. Right-click the setup project, and click Install. Your service should now appear in the Services mmc. Just remember to close the Services mmc before you uninstall, or undesired consequences may result. Good luck!

No comments: