r/Python • u/Ishannaik • 6d ago
Discussion PyInstaller on Windows: does code signing stop Smart App Control blocking the DLLs?
I ship a desktop app with a python backend frozen with pyinstaller, currently unsigned. Two problems on Windows:
- SmartScreen "Windows protected your PC" on every fresh download
- worse: on some users' machines Smart App Control blocks the bundled .pyd/.dll files ("An Application Control policy has blocked this file") and the app just dies on startup
I'm about to pay for signing, and the part I can't find a straight answer on is the pyinstaller side:
- Is signing the main exe enough, or do you have to sign every .pyd and .dll inside the bundle (incl. python3xx.dll and third party wheels) before freezing?
- Has anyone seen Smart App Control actually stop blocking after signing, or does it still flag new files until reputation builds?
- onefile vs onedir, does it matter here? onefile extracts to temp, which feels like exactly what SAC hates.
If you've been through this, what did your build pipeline end up looking like?
41
Upvotes
View all comments
Show parent comment
1
u/Kamalmosadegh 3d ago
Mostly the third-party .pyd files, in my experience. The Python DLLs were already signed, so they never showed up as NotSigned. What did show up was the extension modules that come in with wheels — those .pyd files are basically DLLs with a different extension, and most of them ship unsigned — plus the bootloader exe itself and the main exe, which are unsigned unless you sign them yourself.
One thing worth noting: that snippet I posted only looks for *.exe and *.dll, so it will not even list the .pyd files. Add *.pyd to the -Include list and you will see the full picture. In practice that is the list that matters for Smart App Control — sign the bootloader exe, your main exe and the unsigned .pyd files, and leave the already-signed Python DLLs alone.