-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwin-build.py
38 lines (30 loc) · 914 Bytes
/
win-build.py
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
import os
import subprocess
import shutil
def build_executable():
print("Building LaraLog executable...")
# Clean up previous builds
for path in ['build', 'dist']:
if os.path.exists(path):
shutil.rmtree(path)
# Build command with fixed options
cmd = [
'pyinstaller',
'--noconfirm',
'--onefile',
'--windowed',
'--name=LaraLog',
'lara_log_watcher.py'
]
try:
subprocess.run(cmd, check=True)
# Clean up spec file
if os.path.exists('LaraLog.spec'):
os.remove('LaraLog.spec')
print("\nBuild completed!")
print("Executable: dist/LaraLog.exe")
except Exception as e:
print(f"\nError: {e}")
print("Make sure PyInstaller is installed (pip install pyinstaller)")
if __name__ == '__main__':
build_executable()