Windows Service with Python 3.5 and pyinstaller
- Python 3.5.x
- Visual C++ Build Tools 2015
- PyInstaller 3.2
(env)$ python -V
Python 3.5.2
(env)$ pip freeze
PyInstaller==3.2
(env)$ pyinstaller -F --hidden-import=win32timezone WindowsService.py
(env) dist\WindowsService.exe install
Installing service TestService
Service installed
(env) dist\WindowsService.exe start
Starting service TestService
(env) dist\WindowsService.exe stop
(env) dist\WindowsService.exe remove
It works, but you could tell me why in the event log Service Control Manager generates an alert with id 7039.
"A service process other than the one started by the Service Control Manager connected when the TestService service started. The Service Control Manager started the 6112 process and the 6480 process connected.
Note that if the service is configured to start inside a debugger, this behavior is expected. "