M
Massi
Hi everyone, I'm writing a script which implement a windows service
with the win32serviceutil module. The service works perfectly, but now
I would need to install several instances of the same service on my
machine for testing purpose.
This is hard since the service name is hard-coded in the service class
definition:
class MyService(win32serviceutil.ServiceFramework) :
_svc_name_ = 'MyService'
_svc_display_name_ = 'Instance ofMyService'
def __init__(self, args) :
win32serviceutil.ServiceFramework.__init__(self, args)
self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
def SvcStop(self) :
self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
sys.stopservice = "true"
win32event.SetEvent(self.hWaitStop)
def SvcDoRun(self) :
#Do something...
So can anyone point me out which is the best way to "parametrize" the
service name? Thanks in advance for your help!
with the win32serviceutil module. The service works perfectly, but now
I would need to install several instances of the same service on my
machine for testing purpose.
This is hard since the service name is hard-coded in the service class
definition:
class MyService(win32serviceutil.ServiceFramework) :
_svc_name_ = 'MyService'
_svc_display_name_ = 'Instance ofMyService'
def __init__(self, args) :
win32serviceutil.ServiceFramework.__init__(self, args)
self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
def SvcStop(self) :
self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
sys.stopservice = "true"
win32event.SetEvent(self.hWaitStop)
def SvcDoRun(self) :
#Do something...
So can anyone point me out which is the best way to "parametrize" the
service name? Thanks in advance for your help!