Ejemplo n.º 1
0
def package_windows(dev):
    if not ISWINDOWS:
        print("Qt packaging only works under Windows.")
        return
    from cx_Freeze import setup, Executable
    distdir = 'dist'
    if op.exists(distdir):
        shutil.rmtree(distdir)

    options = {
        'build_exe': {
            'includes': 'atexit',
            'excludes': ['tkinter'],
            'icon': 'images\\main_icon.ico',
            'include_msvcr': True,
        },
        'install_exe': {
            'install_dir': distdir,
        }
    }

    executables = [
        Executable(
            'run.py',
            base='Win32GUI',
            targetDir=distdir,
            targetName='moneyGuru.exe',
        )
    ]

    setup(
        script_args=['install'],
        options=options,
        executables=executables
    )

    if not dev:
        # Copy qt plugins
        plugin_dest = op.join('dist', 'qt4_plugins')
        plugin_names = ['accessible', 'codecs', 'iconengines', 'imageformats']
        copy_qt_plugins(plugin_names, plugin_dest)

    print("Copying forgotten DLLs")
    shutil.copy(find_in_path('msvcp110.dll'), distdir)
    print("Copying the rest")
    shutil.copytree('build\\help', 'dist\\help')
    shutil.copytree('build\\locale', 'dist\\locale')
    shutil.copytree('plugin_examples', 'dist\\plugin_examples')

    if not dev:
        # AdvancedInstaller.com has to be in your PATH
        # this is so we don'a have to re-commit installer.aip at every version change
        shutil.copy('qt\\installer.aip', 'installer_tmp.aip')
        print_and_do('AdvancedInstaller.com /edit installer_tmp.aip /SetVersion %s' % MoneyGuru.VERSION)
        print_and_do('AdvancedInstaller.com /build installer_tmp.aip -force')
        os.remove('installer_tmp.aip')
Ejemplo n.º 2
0
def package_windows():
    if not ISWINDOWS:
        print("Qt packaging only works under Windows.")
        return
    from cx_Freeze import setup, Executable
    distdir = 'dist'
    if op.exists(distdir):
        shutil.rmtree(distdir)

    options = {
        'build_exe': {
            'includes': 'atexit',
            'excludes': ['tkinter'],
            'icon': 'images\\main_icon.ico',
            'include_msvcr': True,
        },
        'install_exe': {
            'install_dir': distdir,
        }
    }

    executables = [
        Executable(
            'run.py',
            base='Win32GUI',
            targetDir=distdir,
            targetName='moneyGuru.exe',
        )
    ]

    setup(
        script_args=['install'],
        options=options,
        executables=executables
    )

    # Copy qt plugins
    plugin_dest = op.join('dist', 'qt4_plugins')
    plugin_names = ['accessible', 'codecs', 'iconengines', 'imageformats']
    copy_qt_plugins(plugin_names, plugin_dest)

    print("Copying forgotten DLLs")
    shutil.copy(find_in_path('msvcp110.dll'), distdir)
    print("Copying the rest")
    shutil.copytree('build\\help', 'dist\\help')
    shutil.copytree('build\\locale', 'dist\\locale')

    # AdvancedInstaller.com has to be in your PATH
    # this is so we don'a have to re-commit installer.aip at every version change
    shutil.copy('qt\\installer.aip', 'installer_tmp.aip')
    print_and_do('AdvancedInstaller.com /edit installer_tmp.aip /SetVersion %s' % MoneyGuru.VERSION)
    print_and_do('AdvancedInstaller.com /build installer_tmp.aip -force')
    os.remove('installer_tmp.aip')
Ejemplo n.º 3
0
def package_windows(edition, dev):
    if not ISWINDOWS:
        print("Qt packaging only works under Windows.")
        return
    from cx_Freeze import setup, Executable
    from PyQt5.QtCore import QLibraryInfo
    add_to_pythonpath('.')
    app_version = get_module_version('core_{}'.format(edition))
    distdir = 'dist'

    if op.exists(distdir):
        shutil.rmtree(distdir)

    if not dev:
        # Copy qt plugins
        plugin_dest = distdir
        plugin_names = ['accessible', 'codecs', 'iconengines', 'imageformats']
        copy_qt_plugins(plugin_names, plugin_dest)

    # Since v4.2.3, cx_freeze started to falsely include tkinter in the package. We exclude it
    # explicitly because of that.
    options = {
        'build_exe': {
            'includes': 'atexit',
            'excludes': ['tkinter'],
            'bin_excludes': ['icudt51', 'icuin51.dll', 'icuuc51.dll'],
            'icon': 'images\\dg{0}_logo.ico'.format(edition),
            'include_msvcr': True,
        },
        'install_exe': {
            'install_dir': 'dist',
        }
    }

    executables = [
        Executable(
            'run.py',
            base='Win32GUI',
            targetDir=distdir,
            targetName={'se': 'dupeGuru', 'me': 'dupeGuru ME', 'pe': 'dupeGuru PE'}[edition] + '.exe',
        )
    ]

    setup(
        script_args=['install'],
        options=options,
        executables=executables
    )

    print("Removing useless files")
    # Debug info that cx_freeze brings in.
    for fn in glob.glob(op.join(distdir, '*', '*.pdb')):
        os.remove(fn)
    print("Copying forgotten DLLs")
    qtlibpath = QLibraryInfo.location(QLibraryInfo.LibrariesPath)
    shutil.copy(op.join(qtlibpath, 'libEGL.dll'), distdir)
    shutil.copy(find_in_path('msvcp110.dll'), distdir)
    print("Copying the rest")
    help_path = op.join('build', 'help')
    print("Copying {} to dist\\help".format(help_path))
    shutil.copytree(help_path, op.join(distdir, 'help'))
    locale_path = op.join('build', 'locale')
    print("Copying {} to dist\\locale".format(locale_path))
    shutil.copytree(locale_path, op.join(distdir, 'locale'))

    # AdvancedInstaller.com has to be in your PATH
    # this is so we don'a have to re-commit installer.aip at every version change
    installer_file = 'installer.aip'
    installer_path = op.join('qt', edition, installer_file)
    shutil.copy(installer_path, 'installer_tmp.aip')
    print_and_do('AdvancedInstaller.com /edit installer_tmp.aip /SetVersion %s' % app_version)
    print_and_do('AdvancedInstaller.com /build installer_tmp.aip -force')
    os.remove('installer_tmp.aip')
    if op.exists('installer_tmp.back.aip'):
        os.remove('installer_tmp.back.aip')
Ejemplo n.º 4
0
def package_windows(edition, dev):
    if not ISWINDOWS:
        print("Qt packaging only works under Windows.")
        return
    from cx_Freeze import setup, Executable
    from PyQt5.QtCore import QLibraryInfo
    add_to_pythonpath('.')
    app_version = get_module_version('core_{}'.format(edition))
    distdir = 'dist'

    if op.exists(distdir):
        shutil.rmtree(distdir)

    if not dev:
        # Copy qt plugins
        plugin_dest = distdir
        plugin_names = ['accessible', 'codecs', 'iconengines', 'imageformats']
        copy_qt_plugins(plugin_names, plugin_dest)

    # Since v4.2.3, cx_freeze started to falsely include tkinter in the package. We exclude it explicitly because of that.
    options = {
        'build_exe': {
            'includes': 'atexit',
            'excludes': ['tkinter'],
            'bin_excludes': ['icudt51', 'icuin51.dll', 'icuuc51.dll'],
            'icon': 'images\\dg{0}_logo.ico'.format(edition),
            'include_msvcr': True,
        },
        'install_exe': {
            'install_dir': 'dist',
        }
    }

    executables = [
        Executable(
            'run.py',
            base='Win32GUI',
            targetDir=distdir,
            targetName={'se': 'dupeGuru', 'me': 'dupeGuru ME', 'pe': 'dupeGuru PE'}[edition] + '.exe',
        )
    ]

    setup(
        script_args=['install'],
        options=options,
        executables=executables
    )

    print("Removing useless files")
    # Debug info that cx_freeze brings in.
    for fn in glob.glob(op.join(distdir, '*', '*.pdb')):
        os.remove(fn)
    print("Copying forgotten DLLs")
    qtlibpath = QLibraryInfo.location(QLibraryInfo.LibrariesPath)
    shutil.copy(op.join(qtlibpath, 'libEGL.dll'), distdir)
    shutil.copy(find_in_path('msvcp110.dll'), distdir)
    print("Copying the rest")
    help_path = op.join('build', 'help')
    print("Copying {} to dist\\help".format(help_path))
    shutil.copytree(help_path, op.join(distdir, 'help'))
    locale_path = op.join('build', 'locale')
    print("Copying {} to dist\\locale".format(locale_path))
    shutil.copytree(locale_path, op.join(distdir, 'locale'))

    # AdvancedInstaller.com has to be in your PATH
    # this is so we don'a have to re-commit installer.aip at every version change
    installer_file = 'installer.aip'
    installer_path = op.join('qt', edition, installer_file)
    shutil.copy(installer_path, 'installer_tmp.aip')
    print_and_do('AdvancedInstaller.com /edit installer_tmp.aip /SetVersion %s' % app_version)
    print_and_do('AdvancedInstaller.com /build installer_tmp.aip -force')
    os.remove('installer_tmp.aip')
    if op.exists('installer_tmp.back.aip'):
        os.remove('installer_tmp.back.aip')