Commit 23c85945 authored by Adam Groszer's avatar Adam Groszer

Windows fix: use cli-64.exe/cli.exe depending on 64/32 bit

parent 23391efa
......@@ -4,6 +4,10 @@ Change History
1.6.4 (unreleased)
==================
- Windows fix: use cli-64.exe/cli.exe depending on 64/32 bit
and try cli.exe if cli-64.exe is not found,
fixing 9c6be7ac6d218f09e33725e07dccc4af74d8cf97
- Windows fix: `buildout init` was broken, re.sub does not like a single backslash
- fixed all builds on travis-ci
......
......@@ -1462,7 +1462,15 @@ def _write_script(full_name, contents, logged_type):
script_name += '-script.py'
# Generate exe file and give the script a magic name.
exe = full_name + '.exe'
new_data = pkg_resources.resource_string('setuptools', 'cli-64.exe' if is_64 else 'cli-32.exe')
if is_64:
resource = 'cli-64.exe'
else:
resource = 'cli.exe'
try:
new_data = pkg_resources.resource_string('setuptools', resource)
except IOError:
# setuptools has just cli.exe, no matter if 64/32 bit
new_data = pkg_resources.resource_string('setuptools', 'cli.exe')
if not os.path.exists(exe) or (open(exe, 'rb').read() != new_data):
# Only write it if it's different.
open(exe, 'wb').write(new_data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment