diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2010-01-15 13:36:33 -0800 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2010-01-15 13:36:33 -0800 |
commit | e761ba064a2b5960efdfc94bb5baef85a7ec1a0a (patch) | |
tree | de9970a791adf551b9cfa65a0013118d33c77554 /scripts/install.py | |
parent | 56af8f1639a13adeb6f34e9988489aa5757a3184 (diff) | |
parent | 4c4c68a3408c85e49d365c31be93e006be612ab1 (diff) |
Merge for EXT-1874, EXT-3800, EXT-4133
Diffstat (limited to 'scripts/install.py')
-rwxr-xr-x | scripts/install.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/install.py b/scripts/install.py index 78b8880b95..7368af0b37 100755 --- a/scripts/install.py +++ b/scripts/install.py @@ -793,8 +793,13 @@ def _getuser(): import getpass return getpass.getuser() except ImportError: - import win32api - return win32api.GetUserName() + import ctypes + MAX_PATH = 260 # according to a recent WinDef.h + name = ctypes.create_unicode_buffer(MAX_PATH) + namelen = ctypes.c_int(len(name)) # len in chars, NOT bytes + if not ctypes.windll.advapi32.GetUserNameW(name, ctypes.byref(namelen)): + raise ctypes.WinError() + return name.value def _default_installable_cache(): """In general, the installable files do not change much, so find a |