none
Self-installing service with arguments to service RRS feed

  • Question

  • I've got a self-installing service and the only way I know to send command line arguments to the service when it's started is like this:

    protected override void OnBeforeInstall(System.Collections.IDictionary savedState)
    {
    	Context.Parameters["assemblypath"] += "\" /service";
    	base.OnBeforeInstall(savedState);
    }
    
    protected override void OnBeforeUninstall(System.Collections.IDictionary savedState)
    {
    	Context.Parameters["assemblypath"] += "\" /service";
    	base.OnBeforeUninstall(savedState);
    }
    

    Anyone know of a less ugly way?

    Wednesday, October 19, 2011 4:15 PM

Answers

All replies