S
Soren S. Jorgensen
Hi,
How do I see, from within my main method, in what context my assembly,
containing my service program, is executed ??
I want to be able to detect if the assembly is executed by the service
system (say started from the Services applet) or if it was executed from a
command line (in which case the service won't start).
The reason for this is that on my service assembly I have created the
ability to install/uninstall the service program from a command line. Say
you call the assembly like: "MyService.exe -install" from the command line
the assembly will be installed as a service. Executing the assembly without
arguments will run the service. So if user simply executes the assembly from
a command line (without arguments) will cause an error as the service must
be started by the system. I'd like to detect this up front, and tell the
user he/she has done something not allowed.
Any help appreciated...
Btw. running .NET 1.1
Kr. Soren
How do I see, from within my main method, in what context my assembly,
containing my service program, is executed ??
I want to be able to detect if the assembly is executed by the service
system (say started from the Services applet) or if it was executed from a
command line (in which case the service won't start).
The reason for this is that on my service assembly I have created the
ability to install/uninstall the service program from a command line. Say
you call the assembly like: "MyService.exe -install" from the command line
the assembly will be installed as a service. Executing the assembly without
arguments will run the service. So if user simply executes the assembly from
a command line (without arguments) will cause an error as the service must
be started by the system. I'd like to detect this up front, and tell the
user he/she has done something not allowed.
Any help appreciated...
Btw. running .NET 1.1
Kr. Soren