summaryrefslogtreecommitdiff
path: root/scripts/install.py
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-01-14 19:45:12 -0500
committerLoren Shih <seraph@lindenlab.com>2010-01-14 19:45:12 -0500
commit056d2a82698406641e4930f7adf2fe31664c9266 (patch)
treeddc678144c67e5467d07c2aebe4740cde6901630 /scripts/install.py
parent04f1a83b2e0517fb9f3730a31941d79adf603059 (diff)
parente7b69ec8f8a69a437f821fb1c6b6ebeea80e28cc (diff)
automated merge viewer2.0->viewer2.0
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