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?
You can use the --console option when running pyinstaller to create a console window. This will allow you to print out a message to the console before the actual application starts. Here is an example:
import time print("Initializing application...") time.sleep(5) # wait for 5 seconds# actual application code goes here
Then, when you run pyinstaller, you can use the --console option:
pyinstaller --onefile --console my_script.py
This will create a console window when the .exe is run, and the message "Initializing application..." will be displayed for 5 seconds before the actual application starts.
Alternatively, you could create a separate script to display the message, and then use the --hidden-import option in pyinstaller to include this script in the packaged .exe. This way, the message will be displayed before the main application is imported and run. Here is an example:
# initializing.pyprint("Initializing application...") time.sleep(5) # wait for 5 seconds
Copy code # main_application.py# actual application code goes here
Then, when running pyinstaller, you can use the --hidden-import option to include the initializing.py script:
pyinstaller --onefile --console --hidden-import=initializing main_application.py
This will create a console window when the .exe is run, and the message "Initializing application..." will be displayed for 5 seconds before the main application is imported and run.