Beta_cartrigesg_bd Beta v0.13

This commit is contained in:
2026-08-05 17:33:13 +03:00
parent 15d5e780ee
commit 532b327e1a
4 changed files with 99 additions and 12 deletions

View File

@@ -1,6 +1,8 @@
# -*- mode: python ; coding: utf-8 -*-
import os
import sys
from pathlib import Path
project_root = (
os.path.abspath(os.path.dirname(__file__))
@@ -8,15 +10,44 @@ project_root = (
else os.path.abspath(os.getcwd())
)
def find_tcl_runtime_directory(environment_name, directory_prefix, marker_file):
configured_path = os.environ.get(environment_name)
if configured_path and os.path.isfile(os.path.join(configured_path, marker_file)):
return os.path.abspath(configured_path)
tcl_root = Path(sys.base_prefix) / "tcl"
for candidate in sorted(tcl_root.glob(f"{directory_prefix}*"), reverse=True):
if (candidate / marker_file).is_file():
return str(candidate.resolve())
return None
datas = [
(os.path.join(project_root, "picture", "ICON", "icon_client.png"), "picture/ICON"),
(os.path.join(project_root, "picture", "Client", "Connect", "connected.png"), "picture/Client/Connect"),
(os.path.join(project_root, "picture", "Client", "Connect", "no-connection.png"), "picture/Client/Connect"),
]
if os.name == "nt":
tcl_library = find_tcl_runtime_directory("TCL_LIBRARY", "tcl", "init.tcl")
tk_library = find_tcl_runtime_directory("TK_LIBRARY", "tk", "tk.tcl")
if not tcl_library or not tk_library:
raise RuntimeError(
"Tcl/Tk data directories were not found. "
"Install Python with Tcl/Tk support or set TCL_LIBRARY and TK_LIBRARY."
)
datas.extend([
(tcl_library, "_tcl_data"),
(tk_library, "_tk_data"),
])
a = Analysis(
["client_agent_v2.py"],
pathex=[project_root],
binaries=[],
datas=[
(os.path.join(project_root, "picture", "ICON", "icon_client.png"), "picture/ICON"),
(os.path.join(project_root, "picture", "Client", "Connect", "connected.png"), "picture/Client/Connect"),
(os.path.join(project_root, "picture", "Client", "Connect", "no-connection.png"), "picture/Client/Connect"),
],
datas=datas,
hiddenimports=["pystray", "pystray._win32", "PIL.Image", "PIL.ImageTk"],
hookspath=[],
hooksconfig={},
@@ -32,15 +63,13 @@ pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
exclude_binaries=True,
name="Inv_web Client",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx=False,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
@@ -49,3 +78,13 @@ exe = EXE(
entitlements_file=None,
icon=os.path.join(project_root, "picture", "ICON", "icon_client.ico"),
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=False,
upx_exclude=[],
name="Inv_web Client",
)