Skip to content

Commit e7ca6eb

Browse files
JusterZhuclaude
andcommitted
feat: deep refine all 5 skills with comprehensive coverage
General update of all skills based on thorough analysis of 50+ GitHub/Gitee issues, full code audit findings, and all 10 Hub samples: generalupdate-init: - 4 update scenes (None/UpgradeOnly/MainOnly/Both) - 3 configuration methods (SetSource/SetConfig/LoadFromConfiguration) - 5 HTTP auth methods (HMAC/Basic/Bearer/APIKey/Custom) - Complete API reference with all Options + events - Production deployment checklist - 8 known-issue workarounds integrated into templates generalupdate-ui (core highlight): - Full 11-state UI state machine (Idle→Checking→Found→Downloading→ Paused→Error→Applying→Success→Failed→RollingBack→AlreadyLatest) - Enhanced IDownloadService with CanCheck/CanStart/CanPause/CanRetry - RealDownloadService bridge (GeneralUpdate.Core → UI) - Framework-specific templates: SemiUrsa, LayUI, WPFDevelopers, AntdUI, MAUI generalupdate-strategy: - Decision tree for strategy selection - 6 strategies with full code examples - 4 mixed/cascading strategy combinations - Platform-specific behavior (Windows/Linux/Mac) - CVP + chain fallback architecture generalupdate-advanced: - All 10+ extension points documented - 4 IPC providers (encrypted file/named pipe/shared memory/auto-fallback) - Bowl crash daemon with full lifecycle - Download subsystem layered architecture - FileTree/Blacklist/Event system docs - AOT/trim compatibility generalupdate-troubleshoot: - 50+ symptoms classified C/H/M/L (8 Critical, 11 High, 20 Medium, 12 Low) - Every symptom traces to real issue/code-audit source - 6-step universal diagnostic workflow - Platform-specific checks - Quick diagnostic commands Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c38016e commit e7ca6eb

14 files changed

Lines changed: 2577 additions & 1014 deletions

File tree

.claude/skills/generalupdate-advanced/SKILL.md

Lines changed: 370 additions & 48 deletions
Large diffs are not rendered by default.

.claude/skills/generalupdate-init/SKILL.md

Lines changed: 318 additions & 74 deletions
Large diffs are not rendered by default.
Lines changed: 105 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,63 @@
11
# GeneralUpdate 参考手册
22

3-
## NuGet 包版本对照表
4-
5-
下载页面:[nuget.org/profiles/GeneralLibrary](https://www.nuget.org/profiles/GeneralLibrary)
6-
7-
| 包名 | 用途 | 是否必需 | .NET版本要求 |
8-
|------|------|---------|-------------|
9-
| `GeneralUpdate.Core` | 核心引擎(Bootstrap/策略/下载/IPC/事件) | ✅ 是 | .NET 8+ |
10-
| `GeneralUpdate.Differential` | BSDIFF/HDiffPatch差分补丁 | ❌ 可选 | .NET 8+ |
11-
| `GeneralUpdate.Bowl` | 进程崩溃监控、MiniDump、自动回滚 | ❌ 可选 | .NET 8+ |
12-
| `GeneralUpdate.Extension` | 插件管理 | ❌ 可选 | .NET 8+ |
13-
| `GeneralUpdate.Drivelution` | Windows驱动更新 | ❌ 可选 | .NET 8+ |
14-
| `GeneralUpdate.Avalonia.Android` | Avalonia Android更新 | ❌ 可选 | .NET 10+ |
15-
| `GeneralUpdate.Maui.Android` | MAUI Android更新 | ❌ 可选 | .NET 10+ |
16-
17-
## UpdateRequest 字段速查
18-
19-
| 字段 | 类型 | 必需 | 说明 |
20-
|------|------|------|------|
21-
| `UpdateUrl` | string || 服务器版本验证 API 地址 |
22-
| `AppSecretKey` | string || HMAC 认证密钥 |
23-
| `InstallPath` | string | ⚠️ | 应用安装目录(未设置则从 manifest 读取) |
24-
| `UpdatePath` | string | ⚠️ | Upgrade.exe 所在路径 |
25-
| `ClientVersion` | string | ⚠️ | 当前版本号(4段式) |
26-
| `MainAppName` | string | ⚠️ | 主程序文件名(含.exe) |
27-
| `UpdateAppName` | string | ⚠️ | 升级程序文件名(含.exe) |
28-
| `ProductId` | string | ⚠️ | 产品标识 |
29-
| `ReportUrl` | string || 状态上报地址 |
30-
| `BasicUsername` | string || Basic 认证用户名 |
31-
| `BasicPassword` | string || Basic 认证密码 |
32-
33-
> ⚠️ = 可通过 `generalupdate.manifest.json` 自动发现,非必需手动传入
34-
35-
## Option 选项速查
3+
## NuGet 包
4+
5+
所有包的最新版本:[nuget.org/profiles/GeneralLibrary](https://www.nuget.org/profiles/GeneralLibrary)
6+
7+
| 包名 | 用途 | 必需 | .NET 版本 | 典型版本 |
8+
|------|------|------|-----------|---------|
9+
| `GeneralUpdate.Core` | 核心引擎(Bootstrap/策略/下载/IPC/事件) | ✅ 是 | net8.0;net10.0 | ≥ 5.0.0 |
10+
| `GeneralUpdate.Differential` | BSDIFF/HDiffPatch 差分补丁 | ❌ 可选 | net8.0;net10.0 | ≥ 5.0.0 |
11+
| `GeneralUpdate.Bowl` | 进程崩溃监控、MiniDump、自动回滚 | ❌ 可选 | net8.0;net10.0 | ≥ 1.0.0 |
12+
| `GeneralUpdate.Extension` | 插件管理系统 | ❌ 可选 | net8.0;net10.0 | ≥ 1.0.0 |
13+
| `GeneralUpdate.Drivelution` | Windows 驱动更新 | ❌ 可选 | net8.0;net10.0 | ≥ 1.0.0 |
14+
| `GeneralUpdate.Avalonia.Android` | Avalonia Android 更新 | ❌ 可选 | net10.0-android | ≥ 1.0.0 |
15+
| `GeneralUpdate.Maui.Android` | MAUI Android 更新 | ❌ 可选 | net10.0-android | ≥ 1.0.0 |
16+
17+
## UpdateRequest 字段完整说明
18+
19+
| 字段 | 类型 | 必需 | 默认 | 说明 |
20+
|------|------|:----:|------|------|
21+
| `UpdateUrl` | string ||| 版本验证 API 地址(必填) |
22+
| `AppSecretKey` | string ||| HMAC 认证 + IPC 加密密钥(必填) |
23+
| `InstallPath` | string | ⚠️ | manifest | 应用安装目录 |
24+
| `UpdatePath` | string | ⚠️ | manifest | Upgrade.exe 所在目录 |
25+
| `ClientVersion` | string | ⚠️ | manifest | 当前版本号(4段式) |
26+
| `MainAppName` | string | ⚠️ | manifest | 主程序文件名(含.exe) |
27+
| `UpdateAppName` | string | ⚠️ | manifest | 升级程序文件名(含.exe) |
28+
| `ProductId` | string | ⚠️ | manifest | 产品标识 |
29+
| `ReportUrl` | string ||| 状态上报 API 地址 |
30+
| `UpdateLogUrl` | string ||| 更新日志 API 地址 |
31+
| `BasicUsername` | string ||| Basic Auth 用户名 |
32+
| `BasicPassword` | string ||| Basic Auth 密码 |
33+
34+
> ⚠️ = 可通过 `generalupdate.manifest.json` 自动发现
35+
36+
## Option 选项完整列表
3637

3738
| Option | 类型 | 默认值 | 说明 |
3839
|--------|------|--------|------|
39-
| `AppType` | AppType | `Client` | 应用角色 |
40+
| `AppType` | AppType | Client | 应用角色 |
4041
| `MaxConcurrency` | int | 3 | 并行下载数 |
41-
| `PatchEnabled` | bool | `false` | 启用差分(需Differential包) |
42-
| `BackupEnabled` | bool | `false`(v5+) | 更新前备份 |
43-
| `Silent` | bool | `false` | 静默后台轮询 |
44-
| `SilentPollIntervalMinutes` | int | 60 | 静默轮询间隔 |
45-
| `Format` | CompressionFormat | `Zip` | 压缩格式 |
46-
| `Encoding` | CompressionEncoding | `Default` | 压缩编码 |
47-
| `DownloadTimeout` | int | 60 | 下载超时(秒) |
48-
| `HooksEnabled` | bool | `true` | 启用生命周期Hooks |
49-
| `EnableResume` | bool | `true` | 断点续传 |
42+
| `PatchEnabled` | bool | false | 启用差分更新(需安装 Differential 包) |
43+
| `BackupEnabled` | bool | false (v5+) | 更新前备份 |
44+
| `Silent` | bool | false | 静默后台轮询 |
45+
| `SilentPollIntervalMinutes` | int | 60 | 静默轮询间隔(分钟) |
46+
| `Format` | CompressionFormat | Zip | 压缩格式 |
47+
| `Encoding` | CompressionEncoding | Default | 压缩编码 |
48+
| `DownloadTimeout` | int | 60 | HTTP 下载超时(秒) |
49+
| `MaxRetryCount` | int | 3 | 下载重试次数 |
50+
| `EnableResume` | bool | true | 断点续传 |
51+
| `VerifyChecksum` | bool | true | 下载后 SHA256 校验 |
52+
| `AutoCleanTemp` | bool | false | 自动清理临时目录 |
53+
| `HooksEnabled` | bool | true | 启用生命周期 Hooks |
5054

5155
## 后端 API 协议
5256

53-
### 版本验证接口
57+
### 版本验证
5458

5559
```
56-
POST {UpdateUrl}/Upgrade/Verification
60+
POST {UpdateUrl}
5761
Content-Type: application/json
5862
5963
{
@@ -66,52 +70,87 @@ Content-Type: application/json
6670
}
6771
```
6872

69-
### 成功响应
70-
73+
成功响应:
7174
```json
7275
{
76+
"code": 200,
77+
"message": "",
7378
"body": [
7479
{
7580
"id": "guid",
7681
"version": "1.1.0.0",
7782
"url": "https://storage/packages/v1.1.0.0.zip",
7883
"hash": "sha256-hex",
7984
"size": 1048576,
80-
"name": "update-v1.1.0.0.zip",
85+
"name": "update.zip",
8186
"appType": 0,
8287
"isCrossVersion": false,
8388
"fromVersion": null,
8489
"isForcibly": false,
8590
"publishDate": "2026-01-01T00:00:00Z",
86-
"description": "更新说明"
91+
"description": "修复了若干 Bug"
8792
}
88-
],
89-
"code": 200,
90-
"message": ""
93+
]
9194
}
9295
```
9396

94-
### 状态上报接口
97+
### 状态上报
9598

9699
```
97100
POST {ReportUrl}
98101
Content-Type: application/json
99102
100103
{
101-
"recordId": "upgrade-record-guid",
102-
"type": 1, // 1=主动拉取, 2=服务端推送
103-
"status": 0, // 0=更新中, 1=成功, 2=失败
104-
"message": ""
104+
"recordId": "升级记录 ID",
105+
"type": 1,
106+
"status": 0,
107+
"message": "更新成功"
105108
}
106109
```
107110

108-
## 支持的 UI 框架
111+
## appsettings.json 模板
112+
113+
```json
114+
{
115+
"GeneralUpdate": {
116+
"UpdateUrl": "https://your-server.com/Upgrade/Verification",
117+
"ReportUrl": "https://your-server.com/Upgrade/Report",
118+
"AppSecretKey": "your-secret-key-here",
119+
"InstallPath": "",
120+
"UpdatePath": "update",
121+
"ClientVersion": "1.0.0.0",
122+
"UpgradeClientVersion": "1.0.0.0",
123+
"MainAppName": "MyApp.exe",
124+
"UpdateAppName": "UpgradeApp.exe",
125+
"ProductId": "my-product-001",
126+
"MaxConcurrency": 3,
127+
"PatchEnabled": false,
128+
"BackupEnabled": true,
129+
"DownloadTimeout": 60
130+
}
131+
}
132+
```
109133

110-
| 框架 | 技术栈 | UI技能支持 |
111-
|------|--------|-----------|
112-
| WPF + LayUI.Wpf | .NET 6+ / .NET 8 | ✅ 生成LayUI风格更新窗口 |
113-
| WPF + WPFDevelopers | .NET 8 | ✅ 生成WPFDevelopers风格 |
114-
| WinForms + AntdUI | .NET 9+ Windows | ✅ 生成AntdUI风格(暗黑模式+本地化) |
115-
| Avalonia + Semi.Ursa | .NET 8 | ✅ 生成SemiUrsa风格(Client+Upgrade双视图) |
116-
| .NET MAUI | .NET 10+ Android | ✅ 生成MAUI更新页面 |
117-
| 原生WPF/WinForms | 任何版本 | ✅ 生成通用更新窗口 |
134+
## 框架兼容性矩阵
135+
136+
| 框架 | 最低版本 | AOT 兼容 | SignalR 支持 |
137+
|------|---------|---------|------------|
138+
| WPF (.NET Framework) | .NET 8 || ✅ (JSON协议) |
139+
| WPF (.NET Core) | .NET 8 |||
140+
| WinForms | .NET 8 |||
141+
| Avalonia | .NET 8 |||
142+
| MAUI | .NET 10 || ❌ (无 SignalR) |
143+
| 控制台 | .NET 8 |||
144+
| Linux 桌面 | .NET 8 |||
145+
| macOS 桌面 | .NET 8 |||
146+
147+
## 常见问题快速链接
148+
149+
| 问题 | 参考文件 |
150+
|------|---------|
151+
| "Method not found" NuGet 版本冲突 | `/generalupdate-troubleshoot` Q2 |
152+
| 静默模式不生效 | `/generalupdate-troubleshoot` Q7 |
153+
| 版本号更新后错误 | `/generalupdate-troubleshoot` Q13 |
154+
| Linux 下无权限 | `/generalupdate-troubleshoot` Q17 |
155+
| 升级进程没启动 | `/generalupdate-troubleshoot` Q1 |
156+
| IPC 加密文件问题 | `/generalupdate-troubleshoot` Q5 |

0 commit comments

Comments
 (0)