summaryrefslogtreecommitdiff
path: root/scripts/install.py
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2010-01-15 13:34:41 +0200
committerMike Antipov <mantipov@productengine.com>2010-01-15 13:34:41 +0200
commit502254e97086ba6b76dca498039a273d620f2bc4 (patch)
tree6772604b7bf86a2dd5d98b2aa2468d8ef254471f /scripts/install.py
parent84f6c7bc0453c1c9231fbe7ba88f47110187f7a9 (diff)
parent3cf98103561d79a6758bbb57662e1dc2e4a5198c (diff)
Automated merge with https://hg.aws.productengine.com/secondlife/viewer-2-0/
--HG-- branch : product-engine
Diffstat (limited to 'scripts/install.py')
-rwxr-xr-xscripts/install.py9
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