-
Notifications
You must be signed in to change notification settings - Fork 20
/
setup_qml_py34.py
70 lines (56 loc) · 2.06 KB
/
setup_qml_py34.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# -*- coding: utf-8 -*-
import sys
import os
import shutil
import zipfile
from cx_Freeze import setup, Executable
import PyQt5
from setup_py34 import *
if __name__ == '__main__':
if sys.platform == 'win32':
base = 'Win32GUI'
else:
base = None
buildOptions = dict(
packages=[],
excludes=[],
includes=['PyQt5.QtNetwork','PyQt5.QtQml', 'PyQt5.QtWebKit','PyQt5.QtWebKit', "PyQt5.QtPrintSupport"],
icon="gui\skin\images\QFramer.ico",
)
executables = [
Executable(
'qmlmain.py',
base=base,
icon="gui\skin\images\QFramer.ico",
targetName="QFramer.exe",
appendScriptToExe=False,
appendScriptToLibrary=True,
)
]
for key in ['build', 'dist']:
path = os.sep.join([os.getcwd(), key])
delete_file_folder(path)
path_pyqt5 = PyQt5.__path__[0]
build_path = os.sep.join([os.getcwd(), 'build', 'exe.win32-3.4'])
sys.argv.append("build")
setup(
name='QFramer',
version='1.0',
description='Base on PyQt5',
options=dict(build_exe=buildOptions),
executables=executables
)
for item in ['application']:
shutil.copytree(os.sep.join([os.getcwd(), item]), os.sep.join([build_path, item]))
for item in ['qml']:
shutil.copytree(os.sep.join([path_pyqt5, item]), os.sep.join([build_path, item]))
# for item in ['qml']:
# copytree(os.sep.join([path_pyqt5, item]), os.sep.join([build_path]))
for item in ['msvcp100.dll']:
shutil.copyfile(os.sep.join([os.getcwd(), 'dll', item]), os.sep.join([build_path, item]))
for item in ['libEGL.dll','Qt5QuickParticles.dll']:
shutil.copyfile(os.sep.join([path_pyqt5, item]), os.sep.join([build_path, item]))
for item in [
'Qt5Multimedia.dll','Qt5MultimediaQuick_p.dll', 'Qt5MultimediaWidgets.dll',
'Qt5OpenGL.dll', 'Qt5Sensors.dll', 'Qt5WebKitWidgets.dll', 'QtWebProcess.exe']:
shutil.copyfile(os.sep.join([path_pyqt5, item]), os.sep.join([build_path, item]))