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

prareptissere said:

All pizza places of USA pizza-us.com/.../33176

Find your best pizza.

# September 1, 2010 3:05 PM

ChetteEresy said:

Directory of restaurants organized by states   <a href="restaurants-us.com/.../">Waffle House</a>

# January 24, 2011 5:29 AM

Suresh Lingam said:

The given link is not working.

please provide right URL.

Thanks

# September 15, 2011 3:08 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)