更新
This commit is contained in:
@@ -4,16 +4,56 @@ import os
|
||||
from pathlib import Path
|
||||
|
||||
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
|
||||
from PyInstaller.utils.win32.versioninfo import (
|
||||
FixedFileInfo,
|
||||
StringFileInfo,
|
||||
StringStruct,
|
||||
StringTable,
|
||||
VarFileInfo,
|
||||
VarStruct,
|
||||
VSVersionInfo,
|
||||
)
|
||||
|
||||
|
||||
project_root = Path(SPECPATH)
|
||||
app_version = os.environ.get("WECOM_BUILD_VERSION", "1.0.0").strip() or "1.0.0"
|
||||
app_name = f"ZhenAI-WeCom-Assistant-v{app_version}"
|
||||
|
||||
# 完整的版本信息资源。没有它,EXE 在杀软启发式评分和 SmartScreen 提示里
|
||||
# 就是一个"来历不明"的匿名程序;有了它至少提示里能显示发布者与产品名。
|
||||
_version_parts = [int(p) for p in (app_version.split(".") + ["0", "0", "0"])[:4]]
|
||||
version_resource = VSVersionInfo(
|
||||
ffi=FixedFileInfo(
|
||||
filevers=tuple(_version_parts),
|
||||
prodvers=tuple(_version_parts),
|
||||
),
|
||||
kids=[
|
||||
StringFileInfo(
|
||||
[
|
||||
StringTable(
|
||||
"080404b0",
|
||||
[
|
||||
StringStruct("CompanyName", "甄养堂"),
|
||||
StringStruct("FileDescription", "甄AI客服 · 企业微信客服助手"),
|
||||
StringStruct("FileVersion", app_version),
|
||||
StringStruct("InternalName", app_name),
|
||||
StringStruct("LegalCopyright", "Copyright (C) 2026 甄养堂"),
|
||||
StringStruct("OriginalFilename", f"{app_name}.exe"),
|
||||
StringStruct("ProductName", "甄AI客服"),
|
||||
StringStruct("ProductVersion", app_version),
|
||||
],
|
||||
)
|
||||
]
|
||||
),
|
||||
VarFileInfo([VarStruct("Translation", [2052, 1200])]),
|
||||
],
|
||||
)
|
||||
|
||||
hidden_imports = [
|
||||
"app_version",
|
||||
"backend_client",
|
||||
"conversation_store",
|
||||
"dsh_agent",
|
||||
"gui_runtime",
|
||||
"mcp_bridge",
|
||||
"registration_store",
|
||||
@@ -32,6 +72,7 @@ a = Analysis(
|
||||
datas=[
|
||||
(str(project_root / "edge_light_theme"), "edge_light_theme"),
|
||||
(str(project_root / "assets" / "brand"), "assets/brand"),
|
||||
(str(project_root / "dsh_desk.cordis.yml"), "."),
|
||||
]
|
||||
# 昵称 OCR 的模型与配置:只收代码不收这些文件的话,打包后 RapidOCR
|
||||
# 初始化直接失败,会话身份静默退化。
|
||||
@@ -67,6 +108,7 @@ exe = EXE(
|
||||
codesign_identity=None,
|
||||
entitlements_file=None,
|
||||
icon=str(project_root / "assets" / "brand" / "zhenyangtang-icon.ico"),
|
||||
version=version_resource,
|
||||
)
|
||||
|
||||
coll = COLLECT(
|
||||
|
||||
Reference in New Issue
Block a user