How can I prevent the Anti-virus from detecting my app as a virus or malware when another user tries to install it?

758 views Asked by At

recently I've made an automated file sorter based on file extension using Python and Tkinter GUI module, after I was done I compiled the the Python code into an executable using PyInstaller via windows terminal, then I put a "README" text file into the executable folder and compiled that folder as a setup executable using Inno Setup Compiler, it seems to work fine on my computer but when I try to send it to someone, the Anti-virus of the user detects it as a malware and blocks it or sets it in "Quarantine".

So I'd really appreciate it if I can resolve this problem so other users can benefit from it without any problems.

Thank you for your time <3

• Note: I am using Python 3.8 and customtkinter along with the normal Tkinter (both latest versions)

I didn't know how to resolve it and couldn't think of a better place to ask than here.

1

There are 1 answers

1
Serge Ballesta On BEST ANSWER

This is both an interesting question and a question without answer ;-)

You indeed have a real problem and correctly explain what happens. Unfortunately converting a Python program to a Windows executable will almost always raises anti-malware warnings. The underlying reason, is that your executable uses a bootstrap code, that has to prepare an environment for the embedded executable to execute the Python script. And most anti-malware tools choke when they see a program extract something from its data to execute it, because it is a well known malware pattern where a genuine program is wrapped into something that first tries to spread a virus and in the end execute the original code.

That means that I cannot propose any way to really solve your problem :-(

What can be done:

  • if you only give your program to friends, just explain them that it will be falsely detected - you even now can explain the reason - and that they have to set an exception in their anti-virus
  • if you want to distibute it wildly, and work in a major organization, contact the major anti-virus companies to explain how the program was built (they may require the source and the build instructions) so that they explicitely allow it
  • if neither of the previous ways are applicable, just explain the problem and provide the source code and build instructions to allow power users to build from source

I am aware that no of those workarounds is a nice solution, but it is the best I can give you...