G
Guest
I have a Windows service exe that derives from
System.Configuration.Install.Installer
The exe can be executed from the command line with parameters such as
INSTALL, UNINSTALL, START, and STOP to perform such tasks on the service
But the exe is also the exe that _is_ the service process, so when it's run
with no parameters (by the SCM?) it calls
System.ServiceProcess.ServiceBase.Run ( srp.ServicesToRun ) ;
The problem then is when it's accidently run with no parameters from the
command line.
Is there some way for it to know whether or not it's being executed by the
SCM? I'd like it to be able to give a help message and terminate when it's
run from the command line while still behaving properly when running as a
service.
System.Configuration.Install.Installer
The exe can be executed from the command line with parameters such as
INSTALL, UNINSTALL, START, and STOP to perform such tasks on the service
But the exe is also the exe that _is_ the service process, so when it's run
with no parameters (by the SCM?) it calls
System.ServiceProcess.ServiceBase.Run ( srp.ServicesToRun ) ;
The problem then is when it's accidently run with no parameters from the
command line.
Is there some way for it to know whether or not it's being executed by the
SCM? I'd like it to be able to give a help message and terminate when it's
run from the command line while still behaving properly when running as a
service.