I have an .exe I'm packaging using pyinstaller and it works like a charm. However when the .exe is clicked, I have to wait nearly 10 seconds while staring at a blank console window for the actual application to start.
From my research I've surmised that this is because of --onefile, and all the various files packaged in need to be unpacked before any code is run. I'm not concerned about the 10 second wait, but new users often need support because they think the program isn't working (reasonably so).
My ask is incredibly simple, but I can't figure out a way to do it: Is there anyway to get pyinstaller to run a tiny script BEFORE UNPACKING to just post a status blurb to the console, so users know that it's working?
As far as I know it is currently not possible to display custom messages before unpacking to let the user know the application is working. Source
There are a few workarounds to let the user know the program is working.
Display the console window
Displaying the console window after launching the application will output the status of the PyInstaller Bootloader while it is being opened.
To display the console, use the
--console
flag (or edit the .spec file to containconsole = True
) when bundling your applicationEnable debug mode
To enable debug mode, use the
--debug
flag (or edit the .spec file to containdebug = True
)Example