So I want to give this app I developed to my friend. I've tried a lot of ways (Gmail, WhatsApp, etc.), but his Windows antivirus keeps deleting the file automatically. I know he could just disable the antivirus, but I'm going to eventually give to give this to a lot of people, and I don't want to have them disable their antiviruses.
NOTE: The file is a .exe file, obviously
EDIT: You know those installer files for apps, maybe I could make one of those
EDIT 2: Here's the idea for the app: It's very simple, it connects to my device, and if I'm running the server.py file on my device, the server.py file accepts the connection and we can send messages to each other. Here's the code: client.py (the one I'm giving as .exe):
import socket s = socket.socket() host = '[REDACTED]' port = 12345 print('Connecting to ', host, port) s.connect((host, port)) while True: msg = input('CLIENT >> ') s.send(msg.encode()) msg = str(s.recv(1024)) print('SERVER >> ', str(msg)) server.py:
import socket, colorama, os os.system('cls') s = socket.socket() host = '' port = 12345 print('Server started!') print('Waiting for clients...') s.bind((host, port)) s.listen(5) c, addr = s.accept() print('Got connection from', addr) while True: try: msg = c.recv(1024) print(addr, ' >> ', str(msg)) msg = input('SERVER >> ') c.send(msg.encode()) except: print(colorama.Fore.RED + 'Connection closed!' + colorama.Style.RESET_ALL) print('Waiting for clients...') s.listen(5) c, addr = s.accept() print('Got connection from', addr) EDIT 3: How come installers which are .exe file (eg. VisualStudioCodeSetup.exe): Aren't flagged by anti-viruses?
141 Answer
If the exe is produced by py2exe, it isn't really a 'compiled' executable. It is a 'packaged' file in which the original Python bytecode is added to a cut-down Python interpreter so that a user does not have to have Python installed. Another script packager is called Autoit, which does a similar thing. Packagers are often used by 'script kiddies' to produce malicious applications ('malware') and not often used by professional programmers. For these reasons, many antivirus systems flag them as suspicious. Often a packager will use a compression or 'packing' format such as UPX, and this in itself can trigger antivirus action. I myself have used them for home-use, and I can alter the settings of my antivirus protection to allow them. If they get quarantined, I can flag them as OK. If your friends are using (e.g.) school-issued laptops, or they have parental controls, they may not be able to alter their antivirus settings without the permisson or help of the 'system administrator' (school, parent, etc).