<br><font size=2 face="sans-serif">Hi</font>
<br>
<br><font size=2 face="sans-serif">We have the following problem when we try to install a Python script as Win32 service:</font>
<br>
<br><font size=2 face="sans-serif">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 size=2 face="sans-serif">def LocatePythonServiceExe(exeName = None):</font>
<br><font size=2 face="sans-serif"> # Try and find the specified EXE somewhere. If specifically registered,</font>
<br><font size=2 face="sans-serif"> # use it. Otherwise look down sys.path, and the global PATH environment.</font>
<br><font size=2 face="sans-serif"> if exeName is None:</font>
<br><font size=2 face="sans-serif"> if win32service.__file__.find("_d")>=0:</font>
<br><font size=2 face="sans-serif"> exeName = "PythonService_d.exe"</font>
<br><font size=2 face="sans-serif"> else:</font>
<br><font size=2 face="sans-serif"> exeName = "PythonService.exe"</font>
<br><font size=2 face="sans-serif"> ...</font>
<br>
<br><font size=2 face="sans-serif">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 size=2 face="sans-serif">Can anybody explain this?</font>
<br>
<br><font size=2 face="sans-serif">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 size=2 face="sans-serif">Regards,</font>
<br><font size=2 face="sans-serif">Wolfgang</font>