<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2722" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>The intent is to register the service to run in
debug mode if you're currently</FONT></DIV>
<DIV><FONT face=Arial size=2>running a debug build. By convention, pyd's
and exe's have _d appended</FONT></DIV>
<DIV><FONT face=Arial size=2>to them for a debug build, so you'd have
win32service_d.pyd.</FONT></DIV>
<DIV><FONT face=Arial size=2>It would be more reliable to use
os.path.splitext and check that the last</FONT></DIV>
<DIV><FONT face=Arial size=2>2 chars </FONT><FONT face=Arial size=2>are _d
rather than doing .find on the whole path.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> hth</FONT></DIV>
<DIV><FONT face=Arial size=2>
Roger</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"><FONT
face=sans-serif size=2>Hi</FONT> <BR><BR><FONT face=sans-serif size=2>We have
the following problem when we try to install a Python script as Win32
service:</FONT> <BR><BR><FONT face=sans-serif size=2>The Python script is
located in a path that contains the substring "_demonstrator". When installing
the Python service for this script, we get the error message, the the file
"PythonService_d.exe" isn't found. We don't have this file in our Python
installation. First investigations led us to the following lines at
win32serviceutil.py:</FONT> <BR><BR><FONT face=sans-serif size=2>def
LocatePythonServiceExe(exeName = None):</FONT> <BR><FONT face=sans-serif
size=2> # Try and find the specified EXE somewhere. If
specifically registered,</FONT> <BR><FONT face=sans-serif size=2>
# use it. Otherwise look down sys.path, and the global PATH
environment.</FONT> <BR><FONT face=sans-serif size=2> if exeName
is None:</FONT> <BR><FONT face=sans-serif size=2>
if win32service.__file__.find("_d")>=0:</FONT> <BR><FONT face=sans-serif
size=2> exeName =
"PythonService_d.exe"</FONT> <BR><FONT face=sans-serif size=2>
else:</FONT> <BR><FONT face=sans-serif size=2>
exeName = "PythonService.exe"</FONT> <BR><FONT
face=sans-serif size=2> ...</FONT> <BR><BR><FONT face=sans-serif
size=2>This function is called to find the executable for the Python service
to store it at registry when the Python service is installed. The call to
find("_d") returns with >0 in our case, because our path contains the
substring "_demonstrator". I don't understand what the meaning of this lines
is. Why is the decission for correct PythonService exe made on the substring
"_d"? This is not very save, I think.</FONT> <BR><BR><FONT face=sans-serif
size=2>Can anybody explain this?</FONT> <BR><BR><FONT face=sans-serif
size=2>An easy workaround is to avoid the substring "_d" in the path to the
Python script that should be installed as PythonService. But is it realy
intended to forbid "_d" substrings in paths for PythonServices when we don't
want to run in PythonService_d.exe? How can this be ensured in real world?
Maybe there should be another criteria for the decision which PythonService
exe is taken.</FONT> <BR><BR><FONT face=sans-serif size=2>Regards,</FONT>
<BR><FONT face=sans-serif size=2>Wolfgang</FONT>
<P>
<HR>
<P></P>_______________________________________________<BR>Python-win32 mailing
list<BR>Python-win32@python.org<BR>http://mail.python.org/mailman/listinfo/python-win32<BR></BLOCKQUOTE></BODY></HTML>