-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.py
More file actions
43 lines (37 loc) · 1.2 KB
/
build.py
File metadata and controls
43 lines (37 loc) · 1.2 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
import PyInstaller.__main__
import os
import shutil
import sys
# Define separator based on OS
sep = ';' if os.name == 'nt' else ':'
print("🚀 Starting Build Process...")
# Clean previous build
if os.path.exists('dist'):
print("🧹 Cleaning dist folder...")
shutil.rmtree('dist')
if os.path.exists('build'):
print("🧹 Cleaning build folder...")
shutil.rmtree('build')
print("📦 Running PyInstaller...")
PyInstaller.__main__.run([
'run.py',
'--name=InfinityLoader',
'--onefile',
'--noconsole',
f'--icon={os.path.abspath("logo.ico")}', # Use absolute path
f'--add-data=static{sep}static', # Embed static folder
'--hidden-import=uvicorn.loops',
'--hidden-import=uvicorn.loops.auto',
'--hidden-import=uvicorn.protocols',
'--hidden-import=uvicorn.protocols.http',
'--hidden-import=uvicorn.protocols.http.auto',
'--hidden-import=uvicorn.lifespan',
'--hidden-import=uvicorn.lifespan.on',
'--hidden-import=uvicorn.lifespan.on',
'--hidden-import=engineio.async_drivers.asgi',
'--hidden-import=app',
'--hidden-import=app.main',
'--clean',
'--noconfirm'
])
print("\n✅ Build Complete! Check the 'dist' folder for 'InfinityLoader.exe'")