import os
import sys
from subprocess import Popen

sys.path.append("../share/solfege")
from src import winlang

if os.path.isfile("../python/python.exe"):
    from_src_dir = False
else:
    from_src_dir = True

lang = winlang.win32_get_langenviron()
if lang and (lang != 'system default'):
    os.environ['LANGUAGE'] = lang

if from_src_dir:
    os.environ['PATH'] = r"c:\GTK\bin;c:\GTK\lib"
    python = r"C:\python25\pythonw.exe"
else:
    python = r"..\python\pythonw.exe"

Popen([python, "solfege"] + sys.argv[1:])
