From: Rav3nPL Date: Fri, 7 Dec 2012 19:30:14 +0000 (+0100) Subject: detect win64 X-Git-Tag: 10.0~23^2 X-Git-Url: https://git.novaco.in/?p=p2pool.git;a=commitdiff_plain;h=e32336b0fff0ae1a35fd2cb392786b57304d2cf6 detect win64 detect win64 and compile exe using bundle=3 (1 is not supported on win64). --- diff --git a/setup.py b/setup.py index 3067cd3..d8db77a 100644 --- a/setup.py +++ b/setup.py @@ -2,18 +2,22 @@ import os import shutil import sys import zipfile +import platform from distutils.core import setup import py2exe version = __import__('p2pool').__version__ +im64 = '64' in platform.architecture() if os.path.exists('INITBAK'): os.remove('INITBAK') os.rename(os.path.join('p2pool', '__init__.py'), 'INITBAK') try: open(os.path.join('p2pool', '__init__.py'), 'wb').write('__version__ = %r%s%sDEBUG = False%s' % (version, os.linesep, os.linesep, os.linesep)) - + bundle = 1 + if im64: + bundle = bundle + 2 sys.argv[1:] = ['py2exe'] setup(name='p2pool', version=version, @@ -33,7 +37,7 @@ try: console=['run_p2pool.py'], options=dict(py2exe=dict( - bundle_files=1, + bundle_files=bundle, dll_excludes=['w9xpopen.exe', "mswsock.dll", "MSWSOCK.dll"], includes=['twisted.web.resource', 'ltc_scrypt'], )), @@ -43,7 +47,11 @@ finally: os.remove(os.path.join('p2pool', '__init__.py')) os.rename('INITBAK', os.path.join('p2pool', '__init__.py')) -dir_name = 'p2pool_win32_' + version +win = '32' +if im64: + win = '64' + +dir_name = 'p2pool_win' + win + '_' + version if os.path.exists(dir_name): shutil.rmtree(dir_name)