-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
45 lines (38 loc) · 1.05 KB
/
setup.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
import os
import shutil
import PyInstaller.__main__
dir_PyCharm = os.path.abspath('../')
dir_path = os.path.abspath('./src')
build = os.path.join(dir_PyCharm, 'build\\')
dir_name = os.path.basename(os.path.abspath('../'))
dst = os.path.join('C:/Temp', dir_name)
if os.path.isdir(dst):
shutil.rmtree(dst)
shutil.copytree(dir_path, dst)
# Shuffle order script
PyInstaller.__main__.run([
dst + 'ShuffleOrder.py',
'--distpath', dst,
'--workpath', build,
'--specpath', build,
#'--noconsole',
'-F'
])
# Main script
PyInstaller.__main__.run([
dst + 'ChangeBackground.py',
'-n', 'Background_Changer',
'--icon', os.path.join(dir_path, 'Background_Changer.ico'),
'--distpath', dir_path,
'--workpath', build,
'--specpath', build,
#'--noconsole',
'--hidden-import', 'PYTHONCOM',
'-F'
#'--debug=imports',
#'--add-data', dst + 'db_template.db;.',
#'--add-data', dst + 'GetBackgrounds.py;.',
#'--add-data', dst + 'Settings_template.cfg;.',
#'--add-data', dst + 'ShuffleOrder.exe;.'
])
shutil.rmtree(dst)