Commits

Anonymous committed 1deadad

Use QtCore.QCoreApplication.libraryPaths() to get imageformats location (fixes #20 and amends PR #11)

Comments (0)

Files changed (1)

cx_Freeze/hooks.py

     """There is a chance that GUI will use some image formats
     add the image format plugins
     """
-    dir0 = os.path.dirname(module.file)
-    dir = os.path.join(dir0, "plugins", "imageformats")
-    finder.IncludeFiles(dir, "imageformats")
+    from PyQt4 import QtCore
+    libpaths = QtCore.QCoreApplication.libraryPaths()
+    for path in libpaths:
+        dir = os.path.join(str(path), 'imageformats')
+        if os.path.exists(dir):
+            finder.IncludeFiles(dir, "imageformats")
+            return
 
 def load_scipy(finder, module):
     """the scipy module loads items within itself in a way that causes