-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.spec
More file actions
133 lines (125 loc) · 3.38 KB
/
build.spec
File metadata and controls
133 lines (125 loc) · 3.38 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# -*- mode: python ; coding: utf-8 -*-
"""
Protector ISAPI Manager - PyInstaller Spec (Windows + macOS)
Protector Sistemas
"""
import os
import sys
import platform
import customtkinter
# Caminhos
ctk_path = os.path.dirname(customtkinter.__file__)
is_mac = platform.system() == "Darwin"
# Ícone por plataforma
if is_mac:
icon_path = os.path.join('assets', 'icon.icns')
if not os.path.exists(icon_path):
icon_path = os.path.join('assets', 'icon.ico')
else:
icon_path = os.path.join('assets', 'icon.ico')
has_icon = os.path.exists(icon_path)
a = Analysis(
['app.py'],
pathex=[],
binaries=[],
datas=[
(ctk_path, 'customtkinter/'),
('core/', 'core/'),
('assets/', 'assets/'),
('version.py', '.'),
('build_info.py', '.'),
('terminais.json', '.') if os.path.exists('terminais.json') else ('version.py', '.'),
],
hiddenimports=[
'customtkinter',
'requests',
'openpyxl',
'reportlab',
'reportlab.lib.pagesizes',
'reportlab.lib.styles',
'reportlab.lib.units',
'reportlab.platypus',
'reportlab.platypus.paragraph',
'reportlab.platypus.tables',
'reportlab.platypus.doctemplate',
'reportlab.platypus.flowables',
'reportlab.lib.colors',
'reportlab.graphics',
'PIL',
'PIL.Image',
'PIL.ImageTk',
'PIL.ImageOps',
'PIL._tkinter_finder',
'tkinter',
'tkinter.ttk',
'tkinter.filedialog',
'tkinter.messagebox',
'xml.etree.ElementTree',
'json',
'hashlib',
'subprocess',
'platform',
'dataclasses',
'webbrowser',
'packaging',
'packaging.version',
'core.updater',
'core.backup',
'core.session',
'core.models',
'core.reports',
'core.isapi_client',
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
'matplotlib', 'scipy', 'pandas', 'numpy.f2py',
'test', 'unittest', 'pydoc',
],
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data)
# Versão Windows (file_version_info.txt é Windows-only)
version_file = None
if not is_mac and os.path.exists('file_version_info.txt'):
version_file = 'file_version_info.txt'
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='Protector_ISAPI_Manager',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=not is_mac, # UPX não funciona bem no macOS
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=is_mac, # necessário para macOS .app
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=icon_path if has_icon else None,
version=version_file,
)
# macOS: criar .app bundle
if is_mac:
app = BUNDLE(
exe,
name='Protector ISAPI Manager.app',
icon=icon_path if has_icon else None,
bundle_identifier='br.com.protectorsistemas.isapi-manager',
info_plist={
'CFBundleName': 'Protector ISAPI Manager',
'CFBundleDisplayName': 'Protector ISAPI Manager',
'CFBundleVersion': '4.1.4',
'CFBundleShortVersionString': '4.1.4',
'NSHighResolutionCapable': True,
'LSMinimumSystemVersion': '10.15',
},
)