'Stop and remove an old unneeded service during installation.'

def RunOnce(self):

    service_name = 'My    Old    Service    Name'
    try:
        win32serviceutil.StopService(service_name)
    except pywintypes.error as e:
        if (e[0] not in [winerror.ERROR_SERVICE_NOT_ACTIVE, winerror.ERROR_SERVICE_DOES_NOT_EXIST]):
            raise OSError('Could    not    stop    service:    {0}'.format(e))
    try:
        win32serviceutil.RemoveService(service_name)
    except pywintypes.error as e:
        if (e[0] != winerror.ERROR_SERVICE_DOES_NOT_EXIST):
            raise OSError('Could    not    remove    service:    {0}'.format(e))
