in

ASP.NET Weblogs

Ian Stallings: web log

official chicken™

Installing a Windows Service CORRECTLY

Ok so I posted how I installed my windows service yesterday only to witness my own lack of understanding drive by me waving as it drove into the distance. Thanks to some good feedback here I have now fixed my project and the windows service installs properly now. It was an easy fix because I already had an installer class in my project (http://staff.develop.com/candera/selfinstall.htm). All I had to do was delete the custom actions I had created improperly before (see my last blog post) and then create two new custom actions. One for Install using the output from my service project, and adding one argument  /install. I do the same for unistall but use the /unistall argument.

Thanks for all the feedback! It really helped me.

Comments

 

Charlie Kindel said:

CraigBlog's docs are not quite right for .NET 1.1. I had to do the following:

First, the main checks for args.Length > 1. This should be args.Length > 0.

Next, ti.Context is a property, not a method, so ti.Context(ctx) should be ti.Context = ctx.

Last, it's not clear how to deal with normal service startup in the sample. I added an else to the if (/install) else if (/uninstall) clause where I put my "I'm running as a service" code.
February 7, 2004 3:38 AM
 

TrackBack said:

March 9, 2004 11:09 AM
 

TrackBack said:

August 30, 2004 3:27 PM
 

kubilay said:

Just do the single step in support.microsoft.com/.../317421

June 21, 2007 9:11 AM

Leave a Comment

(required)  
(optional)
(required)  
Add