feat: 发布 v3.5.0 版本
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user