From 4267c8f85dd27a35d8dfce2516840c84abc63519 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 7 Oct 2009 16:42:59 -0600 Subject: [PATCH] Fix #3718 (ImageMagick) --- setup/installer/windows/freeze.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/setup/installer/windows/freeze.py b/setup/installer/windows/freeze.py index 6868903e72..dede19085a 100644 --- a/setup/installer/windows/freeze.py +++ b/setup/installer/windows/freeze.py @@ -6,13 +6,15 @@ __docformat__ = 'restructuredtext en' ''' Freeze app into executable using py2exe. ''' +import sys, os + QT_DIR = 'C:\\Qt\\4.5.2' LIBUSB_DIR = 'C:\\libusb' LIBUNRAR = 'C:\\Program Files\\UnrarDLL\\unrar.dll' -IMAGEMAGICK_DIR = 'C:\\ImageMagick' SW = r'C:\cygwin\home\kovid\sw' +IMAGEMAGICK = os.path.join(SW, 'build', 'ImageMagick-6.5.6', + 'VisualMagick', 'bin') -import sys def fix_module_finder(): # ModuleFinder can't handle runtime changes to __path__, but win32com uses them @@ -186,6 +188,15 @@ class BuildEXE(bc): for pat in ('*.dll', '*.sys', '*.cat', '*.inf'): for f in glob.glob(os.path.join(LIBUSB_DIR, pat)): shutil.copyfile(f, os.path.join(tdir, os.path.basename(f))) + # Copy ImageMagick + for pat in ('*.dll', '*.xml'): + for f in glob.glob(self.j(IMAGEMAGICK, pat)): + ok = True + for ex in ('magick++', 'x11.dll', 'xext.dll'): + if ex in f.lower(): ok = False + if not ok: continue + shutil.copy2(f, self.dll_dir) + print '\tAdding unrar' shutil.copyfile(LIBUNRAR, os.path.join(PY2EXE_DIR, os.path.basename(LIBUNRAR)))