baseDir = find_qbase_path()
    path = Path()

    if platform_windows():
        # DLLs
        path.add(os.path.join(baseDir, 'lib', 'dll'))

    # Folder of the executable
    path.add(os.path.dirname(sys.executable))
    # Bin folder
    path.add(os.path.join(baseDir, "bin"))

    path.commit()

qbaseFinder = QbaseFinder()
def find_qbase_path():
   return qbaseFinder.find()

fix_sys_path()
#update_environ_path()


# install the apport exception handler if available
try:
    import apport_python_hook
except ImportError:
    pass
else:
    apport_python_hook.install()

import sys
reload(sys)
sys.setdefaultencoding('utf-8')

try:
    import apport_python_hook
except ImportError:
    pass
else:
    apport_python_hook.install()