fix: make MT5_BASE configurable via environment variable

MT5_BASE env var overrides the default Wine path, supporting non-default
installations and other platforms.
This commit is contained in:
ZhijuCen
2026-06-24 17:20:19 +08:00
parent dd90d42537
commit 44f32f601f
+3 -2
View File
@@ -14,13 +14,14 @@ Usage:
"""
import argparse
import os
import shutil
import subprocess
import sys
from pathlib import Path
# Default MT5 paths
MT5_BASE = Path.home() / ".wine/drive_c/Program Files/MetaTrader 5"
# MT5 paths — override via MT5_BASE env var if not default Wine location
MT5_BASE = Path(os.environ.get("MT5_BASE", Path.home() / ".wine/drive_c/Program Files/MetaTrader 5"))
MQL5_DIR = MT5_BASE / "MQL5"
# Type → directory mapping