raise RuntimeError, "The executable '%s' is registered as the Python " \
"service exe, but it does not exist as specified" \
% exeName
except win32api.error:
# OK - not there - lets go a-searchin'
for path in sys.path:
look = os.path.join(path, exeName)
if os.path.isfile(look):
return win32api.GetFullPathName(look)
# Try the global Path.
try:
return win32api.SearchPath(None, exeName)[0]
except win32api.error:
msg = "%s is not correctly registered\nPlease locate and run %s, and it will self-register\nThen run this service registration process again." % (exeName, exeName)