Thursday, August 30, 2012

Setup and Deployment project for Windows service

In last post we learned to create a simple windows service and used 'installutil' to install the service from console window.

In this post we will learn how to create a setup and deployment project to make the installation process easy!

1) Create a setup and deployment project. Setup project is available in 'Other Project Types' -> Setup and Deployment ->Windows Studio installer

2) Right Click on the project and Select 'Add -> Project Output'
3) Add Primary Output of the project created in previous post

4) Right click View-> Custom Actions

5) Right click on 'Install' and select 'Custom Actions'
6) Select 'File System on Target Machine' from dropdown and Select 'Application Folder' click 'Ok'
7) Select 'Primary Output from ....'
8) Do the same for install ,commit,rollback and uninstall
10) We are done! Build the project and right click and select install. This will install the service in your machine

11) To start the service go to service window (run Services.msc) and select the service and right click on the service and click start!

No comments: