I created a Windows service with Delphi and used two method to install, start and stop.
Method 1
if i install this service using commandline
C:\MyService\ServiceApp.exe /Install
it installed successfully and i can start and stop too in the service console.
Method 2
but if i install the same service with different name using sc e.g.
C:\Windows\system32>sc create myservice binpath= c:\MyService\ServiceApp.exe
I see it is installed but i can not start the service using service console as well as with
sc start myservice
when i do query using SC , result are as follows
C:\Windows\system32>sc query myservice
SERVICE_NAME: myservice
TYPE : 10 WIN32_OWN_PROCESS
STATE : 2 START_PENDING
(NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x7d0
up till now i was using /Install but i want to install same service multiple times with different names, I got this idea of using from this post. (How to install a windows service from command line specifying name and description?) can anybody explain difference of behavior between /Install and SC?