feat: 发布 v3.5.0 版本

This commit is contained in:
huangzhenpc
2025-02-14 16:15:04 +08:00
parent 8b2fbef54a
commit b11452aea8
7 changed files with 369 additions and 164 deletions

View File

@@ -29,7 +29,15 @@ class VersionManager:
def _get_current_version(self) -> str:
"""获取当前版本号"""
try:
version_file = self.root_path / "version.txt"
# 首先尝试从打包后的路径读取
if getattr(sys, 'frozen', False):
# 如果是打包后的程序
base_path = Path(sys._MEIPASS)
else:
# 如果是开发环境
base_path = self.root_path
version_file = base_path / "version.txt"
if not version_file.exists():
logging.error(f"版本文件不存在: {version_file}")
return "0.0.0"