#!/usr/bin/env python3
"""
Bigg Adventure Patcher Build Script
Packages bigg_adventure_patcher.py into a standalone Windows .exe using PyInstaller
"""

import os
import subprocess
import sys

def build():
    print("Building standalone Bigg Adventure Patcher executable...")
    cmd = [
        sys.executable, "-m", "PyInstaller",
        "--onefile",
        "--noconsole",
        "--name=Bigg_Adventure_Patcher",
        "bigg_adventure_patcher.py"
    ]
    try:
        subprocess.check_call(cmd)
        print("\nBuild complete! Standalone executable created at:")
        print(os.path.abspath("dist/Bigg_Adventure_Patcher.exe"))
    except Exception as e:
        print(f"\nBuild failed: {e}")
        print("Ensure pyinstaller is installed: pip install pyinstaller")

if __name__ == "__main__":
    build()
