mirror of
https://github.com/kennethreitz-archive/pyinstaller.git
synced 2026-06-18 22:50:57 +00:00
670b7459f6
Fix onedir mode when the executable is not executed from the current directory. git-svn-id: http://svn.pyinstaller.org/trunk@699 8dd32b29-ccff-0310-8a9a-9233e24343b1
16 lines
593 B
Python
16 lines
593 B
Python
# Qt4 plugins are bundled as data files (see hooks/hook-PyQt4*),
|
|
# within a "qt4_plugins" directory.
|
|
# We add a runtime hook to tell Qt4 where to find them.
|
|
import os
|
|
d = "qt4_plugins"
|
|
if "_MEIPASS2" in os.environ:
|
|
d = os.path.join(os.environ["_MEIPASS2"], d)
|
|
else:
|
|
d = os.path.join(os.path.dirname(sys.argv[0]), d)
|
|
|
|
# We cannot use QT_PLUGIN_PATH here, because it would not work when
|
|
# PyQt4 is compiled with a different CRT from Python (eg: it happens
|
|
# with Riverbank's GPL package).
|
|
from PyQt4.QtCore import QCoreApplication
|
|
QCoreApplication.addLibraryPath(os.path.abspath(d))
|