feat: 版本管理支持多入口文件、安装选项(桌面快捷方式/开始菜单/自动运行/默认安装目录)

This commit is contained in:
Trae AI
2026-06-18 18:15:51 +08:00
parent 9ea0ef4536
commit 77a2dd468f
6 changed files with 364 additions and 176 deletions
+33 -23
View File
@@ -114,17 +114,22 @@ func handleAppCheckUpdate(c *gin.Context) {
}
result := gin.H{
"has_update": true,
"latest_version": latestVersion.Version,
"download_url": downloadURL,
"file_size": downloadSize,
"file_hash": downloadHash,
"entry_file": latestVersion.EntryFile,
"update_notes": latestVersion.Description,
"update_strategy": latestVersion.UpdateStrategy,
"update_type": latestVersion.UpdateType,
"update_method": latestVersion.UpdateMethod,
"changelog": latestVersion.Changelog,
"has_update": true,
"latest_version": latestVersion.Version,
"download_url": downloadURL,
"file_size": downloadSize,
"file_hash": downloadHash,
"entry_file": latestVersion.EntryFile,
"entry_files": latestVersion.EntryFiles,
"create_desktop_shortcut": latestVersion.CreateDesktopShortcut,
"create_start_menu": latestVersion.CreateStartMenu,
"auto_run": latestVersion.AutoRun,
"default_install_dir": latestVersion.DefaultInstallDir,
"update_notes": latestVersion.Description,
"update_strategy": latestVersion.UpdateStrategy,
"update_type": latestVersion.UpdateType,
"update_method": latestVersion.UpdateMethod,
"changelog": latestVersion.Changelog,
}
// 同时返回补丁包信息(如果有),供客户端增量更新使用
@@ -250,18 +255,23 @@ func handleAppCheckUpdate(c *gin.Context) {
// 构建返回结果
result := map[string]interface{}{
"has_update": true,
"current_version": clientVersion,
"latest_version": latestVersion.Version,
"download_url": downloadURL,
"file_size": downloadSize,
"file_hash": downloadHash,
"entry_file": latestVersion.EntryFile,
"update_notes": latestVersion.Description,
"update_strategy": updateStrategy,
"update_type": latestVersion.UpdateType,
"update_method": latestVersion.UpdateMethod,
"changelog": latestVersion.Changelog,
"has_update": true,
"current_version": clientVersion,
"latest_version": latestVersion.Version,
"download_url": downloadURL,
"file_size": downloadSize,
"file_hash": downloadHash,
"entry_file": latestVersion.EntryFile,
"entry_files": latestVersion.EntryFiles,
"create_desktop_shortcut": latestVersion.CreateDesktopShortcut,
"create_start_menu": latestVersion.CreateStartMenu,
"auto_run": latestVersion.AutoRun,
"default_install_dir": latestVersion.DefaultInstallDir,
"update_notes": latestVersion.Description,
"update_strategy": updateStrategy,
"update_type": latestVersion.UpdateType,
"update_method": latestVersion.UpdateMethod,
"changelog": latestVersion.Changelog,
}
// 如果是补丁更新,添加补丁信息