Permalink
Browse files

Merge pull request #3 from poizan42/fix-environment

Fix _putenv putting garbage in the environment
  • Loading branch information...
2 parents 45dc4a3 + 072e49c commit 1fc5c954428e1df579feb77e1bbebfa13f2602e1 @dieterv committed on GitHub Jul 8, 2016
Showing with 2 additions and 1 deletion.
  1. +2 −1 wix/overlays/runtime/__init__.py
@@ -6,6 +6,7 @@
from ctypes import windll
from ctypes import cdll
+from ctypes import c_wchar_p
from ctypes.util import find_msvcrt
@@ -33,7 +34,7 @@ def _putenv(name, value):
# Update the copy maintained by Windows (so SysInternals Process Explorer sees it)
try:
- result = windll.kernel32.SetEnvironmentVariableW(name, value)
+ result = windll.kernel32.SetEnvironmentVariableW(c_wchar_p(name), c_wchar_p(value))
if result == 0: raise Warning
except Exception:
if sys.flags.verbose:

0 comments on commit 1fc5c95

Please sign in to comment.