import subprocess
import os

from config.constants import FIVEMURL

class FiveMLauncher:
    def __init__(self, fivem_path: str):
        self.fivem_path = os.path.expandvars(fivem_path)

    @staticmethod
    def launch():
        """
        if not os.path.exists(self.fivem_path):
            raise FileNotFoundError("❌ FiveM.exe introuvable")

        subprocess.Popen(self.fivem_path, shell=True)
        """

        #subprocess.Popen(f"explorer {FIVEMURL}")
        subprocess.Popen(r'explorer fivem://connect/prod.la-taniere.fun')
