-2

I wrote a small program in python using pandas and tkinter, among other libraries. The program has a simple gui and comes with a csv file, it was converted into a .exe file using pyinstaller. I'd like to share it with some people, but it gets flagged as a virus by their firewall which makes them skeptical about opening the file. Most firewalls and antiviruses, my own included, don't flag it as a threat, but I'd rather not face this issue at all.

incase you're wondering why I used a .exe file, I can't send the code as a .py file as the people I'm sending this program to have limited knowledge of programming and I'd rather not make them go through anything complicated. Are there any specific changes I can make to the code to make it acceptable to the firewall?

Any help will be really appreciated!

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Mekaill
  • 11
  • If you zip the exe, then what? – OneCricketeer Sep 24 '21 at 12:10
  • 1
    This is hard to fix. WIndows will mark all "unknown" .exe files as viruses – mousetail Sep 24 '21 at 12:12
  • Does this answer your question? [Program made with PyInstaller now seen as a Trojan Horse by AVG](https://stackoverflow.com/questions/43777106/program-made-with-pyinstaller-now-seen-as-a-trojan-horse-by-avg) – esqew Sep 24 '21 at 12:15

2 Answers2

3

It'll be flagged by their antivirus, not a firewall. (Firewalls filter raw ip traffic.)

This is simply a fact of life if you use something like pyinstaller. Antiviruses look for dodgy executables, and an executable which contains a runtime (python) and code to run with it is a pretty good definition of one class of dodgy executable. So it's going to get flagged.

You can try to 'beat' the antivirus by zipping or whatever, but that only makes your code more suspicious to the end user if it does get flagged. You can try to work around a particular antvirus package as noted in the linked question, but it's an uphill battle and you will not cover them all. Or you can just be up front about what's happening.

Personally I would only ever send the source, and tell people they need to install python. It's probably not what you want to hear, but it does remove the problem.

Most windows users are happy with install wizards and associate them with new software, so another approach is to make an installer with something like NSIS which installs python if it's not present, and then puts your scripts somewhere with a batch file to run it. If you do this you need to be upfront about what the installer is doing (i.e. installing a 3rd-party, but widely respected package).

2e0byo
  • 5,305
  • 1
  • 6
  • 26
-2

via: Program made with PyInstaller now seen as a Trojan Horse by AVG

"Pyinstaller comes with pre-compiled bootloader binaries for different OSs. I suggest compile them by yourself on your machine. Make sure everything is consistent on your machine. For Windows 64bit, install Python 64bit. Download PyInstaller 64bit for Windows. Make sure Visual Studio (VS) corresponding to your Python is installed, check below:

https://wiki.python.org/moin/WindowsCompilers

Compile the bootloader of Pyinstaller on your machine with VS. It automatically updates the run.exe, runw.exe, run_d.exe, runw_d.exe in DownloadedPyinstallerFolder\PyInstaller\bootloader\Windows-64bit. Check below for more info on how to compile the bootloader:

https://pyinstaller.readthedocs.io/en/stable/bootloader-building.html

At the end install Pyinstaller. Within Pyinstaller directory run

python setup.py install"

(credits: https://stackoverflow.com/users/11627616/mahmoud-hossam)

  • 1
    If an answer on another question addresses this question adequately, flag it as a duplicate instead of copy/pasting the answer here. This improves the quality of the content on the site by reducing the number of places an answer must be updated in light of new information (if and when necessary). – esqew Sep 24 '21 at 12:20
  • I wanted to do that, but I do not have 'flag' button under main post, most likely because my account is new :/ – Marek Żytko Sep 24 '21 at 12:24