-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuilder.py
More file actions
30 lines (22 loc) · 760 Bytes
/
builder.py
File metadata and controls
30 lines (22 loc) · 760 Bytes
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
import PyInstaller.__main__
from pathlib import Path
def build():
project_dir = Path(__file__).parent
args = [
str(project_dir / 'screeny' / 'main.py'),
'--onefile',
'--windowed',
'--name=Screeny',
'--hidden-import=PIL',
'--hidden-import=keyboard',
f'--distpath={project_dir / "dist"}',
f'--workpath={project_dir / "build"}',
f'--specpath={project_dir}',
]
icon_path = project_dir / 'screeny' / 'assets' / 'icon.ico'
if icon_path.exists():
args.append(f'--icon={icon_path}')
PyInstaller.__main__.run(args)
print(f"\n✓ Build complete! Executable: {project_dir / 'dist' / 'Screeny.exe'}")
if __name__ == '__main__':
build()