9

I used pyinstaller to create exe file and sent it to some friends. it is harmless, but because it's --onefile the windows defender alert about it. the user need to allow permission to activate it, and it works. but with inconvenience. Any solution how to make sure windows defender won't alert about it from the start?

Omri
  • 673
  • 4
  • 9
  • 25

1 Answers1

10

It is necessary to exclude from check from all PC using that program by the following procedure.

Add an exclusion to Windows Security

  1. Go to Start > Settings > Update & Security > Windows Security > Virus & threat protection.
  2. Under Virus & threat protection settings, select Manage settings, and then under Exclusions, select Add or remove exclusions.
  3. Select Add an exclusion, and then select from files, folders, file types, or process. The exclusion will apply to subfolders within a folder as well.

In Addition:

For example, searching with "pyinstaller virus" in StackOverflow will find many articles.
pyinstaller virus

It seems that there is a similar article just recently.
Windows Defender detecting Python EXE as Trojan

As mentioned in this article, it has already been reported to developers of pyinstaller. There are various introductions of alternative means other than pyinstaller.
Virus warnings after trying to run .py program converted to an .exe file

AVG (and other antiviruses) reports exe file as containing virus #603
Freezing Your Code
This is introduced in the article below. What is Nuitka

However, it seems that none of them is safe after all.
Py2Exe detected as virus. Alternatives?

There seems to be workaround to recompile PyInstaller's bootloader "runw.exe".
Program made with PyInstaller now seen as a Trojan Horse by AVG
how to recompile the bootloader of Pyinstaller

kunif
  • 4,060
  • 2
  • 10
  • 30
  • 4
    thank you for the response. The issue is on OTHER computers, not just my computer. Any advice to do with pyinstaller or the code itself so other computers that download my app will not show the defender alert? – Omri Feb 17 '19 at 15:09
  • 3
    @Omri, Unfortunately not. The PyInstaller.exe virus misidentification problem occurs many times from long ago like the FAQ. It should have been informed to PyInstaller developers, but it seems that they have not been modified. Please consider switching to other programs such as cx_Freeze or py2exe. – kunif Feb 17 '19 at 15:23
  • @kunif Thank you. Excluding the .exe did not help. But excluding the folder containing the .exe worked! – LetzerWille Sep 19 '20 at 12:17