How to create windows service installer

Open the service file on the desing mode.

Right click it and click Add Installer.

Visual Studio will do some magic and you’ll have a new ProjectInstaller.cs added to your project. It also added a few new references to the solution. If the “ProjectInstaller.cs [Design]” tab is not up, bring it up, and click on the serviceInstaller1 item.

On the propery widow give it some meaning full name.

Now go back and click on the serviceProcessInstaller1.

Here in the Account property is where you will want to set the security settings.

I can go with a fairly low level of security and set to “LocalSystem”.

OK, we’re almost done. Right click the project name  and select properties from the menu. (Note, make sure to click the project, not the solution!) Now on the Application tab, under “Startup object” pick YourProjectName.Program. Now save everything and build your project.

Now its time to install the service using command line utility.

Use installutil to install the windows service.

, , ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Share to Facebook Share to Twitter Stumble It Share on Tumblr Digg More...