forked from sportorg/pysport
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuilder.py
95 lines (85 loc) · 2.43 KB
/
builder.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import sys
import os
from cx_Freeze import setup, Executable
from sportorg import config
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
include_files = [
config.LOCALE_DIR,
config.TEMPLATE_DIR,
config.IMG_DIR,
config.SOUND_DIR,
config.STYLE_DIR,
config.base_dir('sportorg'),
config.base_dir('docs'),
config.base_dir('LICENSE'),
config.base_dir('changelog.en.md'),
config.base_dir('changelog.ru.md'),
config.base_dir('configs'),
]
includes = ['atexit', 'codecs']
excludes = ['Tkinter']
build_exe_options = {
'includes': includes,
'excludes': excludes,
'packages': ['idna', 'requests', 'encodings', 'asyncio'],
'include_files': include_files,
'include_msvcr': True,
'silent': 1
}
shortcut_table = [
("DesktopShortcut", # Shortcut
"DesktopFolder", # Directory_
config.NAME, # Name
"TARGETDIR", # Component_
"[TARGETDIR]SportOrgPlus.exe", # Target
None, # Arguments
None, # Description
None, # Hotkey
None, # Icon
None, # IconIndex
None, # ShowCmd
'TARGETDIR' # WkDir
),
#("StartupShortcut", # Shortcut
# "StartupFolder", # Directory_
# config.NAME, # Name
# "TARGETDIR", # Component_
# "[TARGETDIR]SportOrgPlus.exe", # Target
# None, # Arguments
# None, # Description
# None, # Hotkey
# None, # Icon
# None, # IconIndex
# None, # ShowCmd
# 'TARGETDIR' # WkDir
# ),
]
bdist_msi_options = {
#'initial_target_dir': r'[ProgramFilesFolder]\%s' % config.NAME,
'all_users': False,
'data': {'Shortcut': shortcut_table}
}
options = {
'build_exe': build_exe_options,
'bdist_msi': bdist_msi_options
}
executables = [
Executable(
'SportOrgPlus.pyw',
base=base,
icon=config.icon_dir('sportorg.ico'),
copyright='GNU GENERAL PUBLIC LICENSE {}'.format(config.NAME)
)
]
version = os.getenv('VERSION', '')
if not version:
version = str(config.VERSION)
setup(
name=config.NAME,
version=version,
description=config.NAME,
options=options,
executables=executables
)