pyinstaller / pyinstaller

Freeze (package) Python programs into stand-alone executables
http://www.pyinstaller.org
Other
11.8k stars 1.94k forks source link

My --onefile exe is getting anti-Virus False positive flags and is disabled by windows. #6754

Closed XcomReborn closed 2 years ago

XcomReborn commented 2 years ago

I have the following project :

https://github.com/XcomReborn/COH_Opponent_Bot

I build the program according to the build.bat file:

pyinstaller --clean --onefile --windowed --icon=Icons/coh.ico COHOpponentBot.py

This produces a file that works but when I virus scan it I always get many false positives at least (4).

https://www.virustotal.com/gui/file/29083d7672726e39e0e5de6fff0b2d304d682fce5675c44aa85979540c5e9b3e?nocache=1

I have tried everything I can think of including. Building pyinstaller on my own machine in visual studio from source. As was suggested in this article:

https://python.plainenglish.io/pyinstaller-exe-false-positive-trojan-virus-resolved-b33842bd3184

I followed the above article step by step but in the end it actually gave MORE false postives.

https://www.virustotal.com/gui/file/5a3b0e8fa15b9c38c132e06de5d5fed4313fd7adb10264ab59cd6b95c17a2802?nocache=1

The big problem with this is I am trying to distribute this file and when it is opened on other windows 10 computers they often flag it and automatically close and quarentine the file.

Any ideas ?

I have also tried py2exe which doesn't do a good single file job and has similar false positive problems. I even tried using nuitka module/library but that didn't produce nice results either.

Legorooj commented 2 years ago

The only way you can avoid getting false positives is to sign your executable, which requires paying for a certificate.

The false positives occur because some people use PyInstaller for malware, and PyInstaller's bootloader is the only guaranteed common piece between them all.