tahoe-lafs/windows/tahoe.py

19 lines
830 B
Python
Raw Normal View History

from allmydata.util import pkgresutil # override the pkg_resources zip provider for py2exe deployment
pkgresutil.install() # this is done before nevow is imported by depends
import depends # import dependencies so that py2exe finds them
_junk = depends # appease pyflakes
2010-06-07 01:02:15 +00:00
import sys
from ctypes import WINFUNCTYPE, POINTER, byref, c_wchar_p, c_int, windll
from allmydata.scripts import runner
2010-06-07 01:02:15 +00:00
GetCommandLineW = WINFUNCTYPE(c_wchar_p)(("GetCommandLineW", windll.kernel32))
CommandLineToArgvW = WINFUNCTYPE(POINTER(c_wchar_p), c_wchar_p, POINTER(c_int)) \
(("CommandLineToArgvW", windll.shell32))
argc = c_int(0)
argv = CommandLineToArgvW(GetCommandLineW(), byref(argc))
argv_utf8 = [argv[i].encode('utf-8') for i in xrange(1, argc.value)]
rc = runner(argv_utf8, install_node_control=False)
sys.exit(rc)