I am using PyInstaller to bundle my multi-module Python app into a one-file
exe. The entry point for this app is a module extending win32serviceutil.ServiceFramework
-- so this is meant to run as a Windows service. Problem arises when I try to furnish a user configurable logger ini file with this app. In my main module, I set up the logger thus,
log_file_path = path.join(path.dirname(path.abspath(__file__)), 'logging.conf')
logging.config.fileConfig(log_file_path)
My PyInstaller command is the following:
pyinstaller -F <main-file>.py -n <exe-name> --hidden-import=win32timezone --add-data "logging.conf;."
Once packaged, I install the produced exe as a service and it successfully registers as a Windows service. However when I attempt to start it, it fails.
The interesting bit is that an empty log file is created in my configured location. So this implies that 1) The application did read my config file, and 2) There's no permissions issue here. Has anyone tried to set up something like this that could help shed light on what I might be missing?