Scott Hanselman

ServiceProcessInstaller HelpText has very little documentation

December 15, 2004 Comment on this post [0] Posted in Programming
Sponsored By

I googled around for info on the ServiceProcessInstaller, hoping to change the HelpText. It's a getter, so you have derive and override, rather than setting it. No biggie, but I was surprised. I'm used to googling for .NET documentation and finding MASSIVE amounts of stuff...lot's of articles, etc. Apparently the ServiceProcessInstaller just isn't sexy enough to write about.

This overloaded getter will show help text when someone calls "InstallUtil.exe myserviceassembly.exe /?" on my service exe.

Anyway, I did this. It's not rocket science, but I'd have perferred a setter. Maybe I'm old fashioned.

   88 internal class MySpecialServiceProcessInstaller : System.ServiceProcess.ServiceProcessInstaller
   89 {
   90     public override string HelpText
   91     {
   92         get
   93         {
   94             return @"Enter the Username and Password for the Whatever account in the form \\domain\username. For machines not in a domain, enter hostname\username.";
   95         }
   96     }
   97 }

Then I change the InitializeComponent section - you know, the section you're never supposed to change?

   64 private void InitializeComponent()
   65 {
   66     this.serviceProcessInstaller1 = new MySpecialServiceProcessInstaller();
   67     this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();

Maybe when I google for it again, I'll find my own site. If I can touch the life of just one child who's also using System.ServiceProcess.ServiceProcessInstaller...

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.