#!/usr/bin/env python3
import subprocess
import sys
import os

def main():
    print("VOSHA Installer Alias")
    print("----------------------")
    
    # Priority: Try to open GUI installer if on Windows or if GUI is available
    gui_script = os.path.join(os.path.dirname(__file__), "installer_gui.py")
    
    try:
        # Check if we should try GUI (not if --cli is passed)
        if "--cli" not in sys.argv:
            print("Mencoba membuka GUI Installer...")
            subprocess.run([sys.executable, gui_script])
            return
    except Exception:
        pass
    
    # Fallback to CLI installation
    cli_script = os.path.join(os.path.dirname(__file__), "vosha.py")
    subprocess.run([sys.executable, cli_script, "pasang"])

if __name__ == "__main__":
    main()
