Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
},
"metadata": {
"description": ".NET auto-update skill suite — 7 skills for GeneralUpdate: scaffolding, UI, strategy, advanced, troubleshooting (50+ issues), migration, and security audit",
"version": "0.0.1-beta.1"
"version": "0.0.2-beta.1"
},
"plugins": [
{
"name": "generalupdate-skill",
"source": "./",
"description": "Complete GeneralUpdate (.NET auto-update) integration skill suite. Generates dual-project scaffolding, full-state update UI (6 frameworks), 6 update strategies decision tree (Client-Server/OSS/Silent/Differential/CVP/Push), advanced extension points (Bowl crash daemon, IPC replacement, AOT), BM25-powered troubleshooting search (50+ known issues), v9.x→v10 migration guide, and 14-point security audit matrix. All templates target NuGet v10.5.0-beta.4.",
"version": "0.0.1-beta.1",
"version": "0.0.2-beta.1",
"author": {
"name": "JusterZhu"
},
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "generalupdate-skill",
"description": "Complete .NET auto-update skill suite for GeneralUpdate. 7 skills covering: Bootstrap scaffolding, update UI (6 frameworks), 6 strategies (Client-Server/OSS/Silent/Differential/CVP/Push), advanced extension points (Bowl, IPC, AOT), 50+ known issues diagnosis with BM25 search engine, version migration, and security audit. All templates target NuGet v10.5.0-beta.4.",
"version": "0.0.1-beta.1",
"version": "0.0.2-beta.1",
"author": {
"name": "JusterZhu"
},
Expand Down
5 changes: 2 additions & 3 deletions .claude/scripts/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"name": "Differential Update",
"slug": "differential",
"description": "Delta patch update to save bandwidth (BSDIFF/HDiffPatch)",
"warning": "差分包大小建议不超过 2GB,避免 BSDIFF 整数溢出(v10.4.6+ 已修复 #514)。",
"warning": "差分包大小建议不超过 2GB,避免 BSDIFF 整数溢出(v10.5.0-beta.4 已修复 #514)。",
},
"cvp": {
"name": "Cross-Version CVP",
Expand Down Expand Up @@ -183,7 +183,7 @@ def generate_issue_warnings(strategy, variables):
- H4: OSS 不区分 Main/Upgrade 更新包,接受此行为
- H5: Upgrade.exe 必须放在 update/ 子目录
- L7: 示例代码中 OSS endpoint/bucket 写死,建议用环境变量
- M13: OssClient.AppType 值 3-4 在 v10.4.6 不支持""",
- M13: OssClient.AppType 值 3-4 在 v10.5.0-beta.4 中可用""",
"silent": """⚠️ 静默更新特有已知问题:
- H2: 无限升级循环 — 确保 manifest.json 版本号正确
- M19: 静默通知可能不尊重系统的免打扰设置
Expand All @@ -203,7 +203,6 @@ def generate_issue_warnings(strategy, variables):
"standard": """⚠️ 标准策略已知问题(非特有但常见):
- C1: UpgradeApp.exe 必须随首个版本发布
- C2: Client/Upgrade NuGet 版本必须一致
- H3: IsComplated 拼写(注意不是 IsCompleted)
- M5: InstallPath 使用相对路径导致文件解析失败
- M6: UpdateUrl 返回空响应体时做 null 检查""",
}
Expand Down
10 changes: 3 additions & 7 deletions .claude/scripts/generate/templates/Bootstrap.cs.template
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
using GeneralUpdate.Core;
using GeneralUpdate.Common.Shared.Object;
using GeneralUpdate.Common.Download;
using GeneralUpdate.Core.Configuration;
using GeneralUpdate.Core.Download;

var config = new Configinfo
var config = new UpdateRequest
{
// === 必需 ===
UpdateUrl = "{{UPDATE_URL}}",
AppSecretKey = "{{APP_SECRET_KEY}}",
AppName = "{{PROJECT_NAME}}.exe",
MainAppName = "{{PROJECT_NAME}}.exe",
ClientVersion = "{{CLIENT_VERSION}}",
ProductId = "{{PRODUCT_ID}}",
InstallPath = {{INSTALL_PATH}},

// === 可选 ===
Encoding = System.Text.Encoding.UTF8,
{{#BOWL}}
// Bowl 配置(仅包含 GeneralUpdate.Bowl 包,不重复添加 Core)
{{/BOWL}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Generated for: **{{STRATEGY_NAME}}** + **{{FRAMEWORK}}** | Bowl: **{{BOWL_UPPER}
## ✅ Pre-Deployment Checklist

### Bootstrap
- [ ] `Configinfo` 6 个必填字段都已设置
- [ ] `UpdateRequest` 6 个必填字段都已设置
- [ ] `UpdateUrl` 已指向正确的服务端 API
- [ ] `AppSecretKey` 长度 ≥ 32 字符

Expand Down
17 changes: 13 additions & 4 deletions .claude/scripts/generate/templates/bowl_notice.cs.template
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
// ⚠️ Bowl 崩溃守护 — 使用 GeneralUpdate.Bowl,不单独引用 Core
// ⚠️ Bowl 崩溃守护
// dotnet add package GeneralUpdate.Bowl
var bowlParam = new GeneralUpdate.Bowl.MonitorParameter
// NuGet v10.5.0-beta.4: Bowl 与 Core 无类型冲突,可按需同时引用
// Refer to generalupdate-advanced/templates/BowlIntegration.cs for full example
var context = new GeneralUpdate.Bowl.BowlContext
{
ProcessNameOrId = "{{PROJECT_NAME}}.exe",
TargetPath = {{INSTALL_PATH}},
ExtendedField = "{{CLIENT_VERSION}}",
DumpFileName = "{{CLIENT_VERSION}}_fail.dmp",
FailFileName = "{{CLIENT_VERSION}}_fail.json",
FailDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "fail", "{{CLIENT_VERSION}}"),
// BackupDirectory 必须指向前一版本的备份目录,而非当前版本
// 例如当前版本为 {{CLIENT_VERSION}},备份来自上一版本的 BackupDirectory
BackupDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "previous_version_backup"),
WorkModel = "Upgrade",
FailDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "fail"),
BackupDirectory = System.IO.Path.Combine({{INSTALL_PATH}}, "backup"),
DumpType = GeneralUpdate.Bowl.DumpType.Mini,
AutoRestore = true,
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
})
.AddListenerMultiDownloadCompleted((_, e) =>
{
Console.WriteLine($"\n版本 {e.Version} 下载完成 (IsComplated={e.IsComplated})");
Console.WriteLine($"\n版本 {e.Version} 下载完成 (IsCompleted={e.IsCompleted})");
})
.AddListenerMultiDownloadError((_, e) =>
{
Expand Down
4 changes: 2 additions & 2 deletions .claude/skills/generalupdate-advanced/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Console.WriteLine($"Result: Success={result.Success}, Restored={result.Restored}
| `DumpType` | DumpType | Mini / Full | Full |
| `OnCrash` | delegate | 崩溃回调 | null |

> ⚠️ Bowl 和 Core 不能同时引用(CS0433)。使用 Bowl 时**只引用 `GeneralUpdate.Bowl`**,它传递依赖 Core 的所有功能
> ⚠️ NuGet v10.5.0-beta.4 中 Bowl 和 Core **无类型冲突**,可以同时引用

---

Expand Down Expand Up @@ -332,7 +332,7 @@ var result = GeneralDrivelution.InstallDriver(driverPath);
## ✅ 高级定制验证清单

### Bowl 崩溃守护
- [ ] 只引用了 `GeneralUpdate.Bowl`(不单独引用 Core
- [ ] 如果用 Bowl:项目中同时引用 `GeneralUpdate.Core` 和 `GeneralUpdate.Bowl`(v10.5.0-beta.4 无冲突
- [ ] `MonitorParameter` 的 `ProcessNameOrId` 与实际进程名匹配
- [ ] `TargetPath` 设置为应用安装根目录,非子目录
- [ ] `WorkModel` 根据场景选择 Correct(Normal/Upgrade)
Expand Down
65 changes: 56 additions & 9 deletions .claude/skills/generalupdate-advanced/templates/BowlIntegration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,79 @@
using GeneralUpdate.Bowl;

/// <summary>
/// 【Skill 参考】Bowl 崩溃守护
/// Bowl crash daemon integration.
///
/// v10.5.0-beta.4 中 Bowl 使用 BowlContext 配置,支持 LaunchAsync 方法。
/// Bowl monitors whether the main application starts normally after an upgrade.
/// If a crash is detected, it captures a dump, exports diagnostics,
/// and optionally restores the previous version from backup.
///
/// NuGet: dotnet add package GeneralUpdate.Bowl --version 10.5.0-beta.4
/// Note: Reference only GeneralUpdate.Bowl (it transitively includes Core).
/// Do NOT reference GeneralUpdate.Core separately when using Bowl.
///
/// Platform prerequisites:
/// - Windows: Sysinternals procdump.exe is auto-bundled via Bowl NuGet package
/// - Linux: Requires procdump installed (sudo apt install procdump)
/// </summary>
public static class BowlIntegration
{
public static async Task RunBowlAsync()
{
// Configure the surveillance context
var context = new BowlContext
{
// Process to monitor (name or PID)
ProcessNameOrId = "MyApp.exe",
DumpFileName = "v1.0.0.0_fail.dmp",
FailFileName = "v1.0.0.0_fail.json",

// Backup directory path (the version that was running before upgrade)
TargetPath = @"C:\Program Files\MyApp",
FailDirectory = @"C:\Program Files\MyApp\fail",
BackupDirectory = @"C:\Program Files\MyApp\backup",

// Version string, used to name dump/crash files
ExtendedField = "1.0.0.1",

// Generated dump file path
DumpFileName = "1.0.0.1_fail.dmp",

// Generated crash report file path
FailFileName = "1.0.0.1_fail.json",

// Where dump/crash files will be written
FailDirectory = @"C:\Program Files\MyApp\fail\1.0.0.1",

// Backup location (the previous version's backup that can be restored)
BackupDirectory = @"C:\Program Files\MyApp\1.0.0.0",

// "Upgrade": integrated with update pipeline, auto-restores on crash
// "Normal": standalone monitoring, no restore
WorkModel = "Upgrade",
TimeoutMs = 30_000,

// Auto-restore the previous version on crash (only in "Upgrade" mode)
AutoRestore = true,

// Dump type: Full (0), Mini (1), or Heap (2)
DumpType = DumpType.Full,

// Timeout for child process (procdump), default 30s
TimeoutMs = 30_000,

// Optional: crash callback for custom handling (logging, telemetry, etc.)
// OnCrash = async (crashInfo, ct) => { ... },
};

// Apply sensible defaults (Normalize fills in TimeoutMs, WorkModel, DumpType if zero)
context = context.Normalize();

// Start surveillance. This blocks until the monitored process exits.
var bowl = new Bowl();
var result = await bowl.LaunchAsync(context);
BowlResult result = await bowl.LaunchAsync(context);

Console.WriteLine($"[Bowl] 监控完成: Success={result.Success}, DumpCaptured={result.DumpCaptured}");
Console.WriteLine($"""
[Bowl] 监控完成
Success: {result.Success}
ExitCode: {result.ExitCode}
DumpCaptured: {result.DumpCaptured}
DumpFilePath: {result.DumpFilePath}
Restored: {result.Restored}
""");
}
}
26 changes: 13 additions & 13 deletions .claude/skills/generalupdate-init/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,10 @@ publish/

## ⚠️ 已知问题

### NuGet 类型冲突
`GeneralUpdate.Core` 和 `GeneralUpdate.Bowl` **不能同时引用**(CS0433 类型冲突)。
请根据需求选择:
### NuGet 注意事项(v10.5.0-beta.4)
`GeneralUpdate.Core` 和 `GeneralUpdate.Bowl` **可以同时引用**(v10.5.0-beta.4 中无 CS0433 冲突)。
- 使用 Core:`dotnet add package GeneralUpdate.Core`
- 使用 Bowl:**只引用** `GeneralUpdate.Bowl`(它传递依赖 Core 所有功能
- 使用 Bowl:`dotnet add package GeneralUpdate.Bowl`(它**不**传递依赖 Core,需要同时引用 Core
- 差分类型已内嵌在 Core,**无需额外** `GeneralUpdate.Differential` 包

### 稳定版功能增强
Expand All @@ -354,7 +353,7 @@ v10.5.0-beta.4 新增以下功能:

### NuGet & 编译
- [ ] Client 和 Upgrade 项目使用**完全相同**的 GeneralUpdate NuGet 版本
- [ ] 如果用 Bowl:项目中只能有 `GeneralUpdate.Bowl`,不能同时有 `GeneralUpdate.Core`
- [ ] 如果用 Bowl:项目中同时引用 `GeneralUpdate.Core` 和 `GeneralUpdate.Bowl`(v10.5.0-beta.4 无冲突)
- [ ] 项目能正常 `dotnet build`(0 errors)
- [ ] 无需额外引用 `GeneralUpdate.Differential`(已嵌入 Core)

Expand All @@ -376,14 +375,15 @@ v10.5.0-beta.4 新增以下功能:

| # | 反模式 | 后果 | 正确做法 |
|---|--------|------|---------|
| 1 | **Core 和 Bowl 引用到同一个项目** | CS0433 类型冲突,编译失败 | 用 Bowl 时只引 Bowl(传递依赖 Core) |
| 2 | **Client/Upgrade NuGet 版本号不一致** | 运行时 MethodNotFoundException | 锁定完全相同版本 |
| 3 | **UpgradeApp.exe 不随首个版本发布** | 第一次更新时 FileNotFoundException | 首个版本就包含 UpgradeApp |
| 4 | **事件监听中做耗时操作(网络 IO / 磁盘 IO)** | Update 进程 UI 卡死,超时被 Kill | 仅更新 UI 状态,耗时操作异步 |
| 5 | **IPC 文件编码未设置 UTF-8** | Linux/macOS 中文乱码 | `Encoding.UTF8` |
| 6 | **版本号不是 4 段式(如 1.0.0.0)** | 版本比较逻辑异常 | 始终用 `x.y.z.w` 格式 |
| 7 | **manifest.json 的 mainAppName 不匹配真实进程名** | 更新后主程序找不到 | 和实际 exe 名称一致 |
| 8 | **为 v9.x 编写的代码直接用在 v10** | API 不兼容,编译失败 | 对照 v10.4.6 稳定版 API 重写 |
| 1 | **Core 和 Bowl NuGet 版本不一致** | 运行时 MethodNotFoundException | 使用相同 NuGet 版本 |
| 2 | **Bowl 缺少 `GeneralUpdate.Core` 引用** | 编译失败,缺少 Core 类型 | Bowl 不传递依赖 Core,需同时引用 Core |
| 3 | **Bowl 传递依赖 Core 的误解** | 编译失败 | v10.5.0-beta.4 中 Bowl 是独立包,需单独引用 Core |
| 4 | **Client/Upgrade NuGet 版本号不一致** | 运行时 MethodNotFoundException | 锁定完全相同版本 |
| 5 | **事件监听中做耗时操作(网络 IO / 磁盘 IO)** | Update 进程 UI 卡死,超时被 Kill | 仅更新 UI 状态,耗时操作异步 |
| 6 | **IPC 文件编码未设置 UTF-8** | Linux/macOS 中文乱码 | `Encoding.UTF8` |
| 7 | **版本号不是 4 段式(如 1.0.0.0)** | 版本比较逻辑异常 | 始终用 `x.y.z.w` 格式 |
| 8 | **manifest.json 的 mainAppName 不匹配真实进程名** | 更新后主程序找不到 | 和实际 exe 名称一致 |
| 9 | **为 v9.x 编写的代码直接用在 v10** | API 不兼容,编译失败 | 对照 v10.4.6 稳定版 API 重写 |

---

Expand Down
6 changes: 3 additions & 3 deletions .claude/skills/generalupdate-init/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
| `GeneralUpdate.Extension` | 插件管理系统 | ❌ 可选 | net8.0;net10.0 | ≥ 10.5.0 |
| `GeneralUpdate.Drivelution` | Windows 驱动更新 | ❌ 可选 | net8.0;net10.0 | 10.5.0-beta.4 |

> ⚠️ **NuGet 类型冲突**
> ⚠️ **NuGet 注意事项**(v10.5.0-beta.4)
> - `GeneralUpdate.Differential` 的 `DifferentialCore` 等类型已内嵌在 `GeneralUpdate.Core` 中,**不需额外引用**(直接使用 Core 即可)
> - `GeneralUpdate.Bowl` 和 `GeneralUpdate.Core` **不能同时引用**(两者都发布了 `GeneralUpdate.Common` 导致 CS0433
> - 使用 Bowl 时**只引用 `GeneralUpdate.Bowl`**(它传递依赖 Core 的所有功能
> - `GeneralUpdate.Bowl` 和 `GeneralUpdate.Core` **可以同时引用**(v10.5.0-beta.4 中 Bowl 与 Core 无共用类型,不再冲突
> - 使用 Bowl 时仍需引用 `GeneralUpdate.Bowl`(它**不**传递依赖 Core)

## UpdateRequest 字段完整说明

Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/generalupdate-migration/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ await new GeneralUpdateBootstrap()
### 编译验证
- [ ] `dotnet build` 无错误
- [ ] 无 `MissingMethodException` 的风险(检查所有方法名是否存在于 v10.4.6)
- [ ] 无 `CS0433` 类型冲突(Core + Bowl 不同时引用
- [ ] 无 `CS0433` 类型冲突(v10.5.0-beta.4 中 Core + Bowl 无冲突,可同时引用

### 架构验证
- [ ] 项目已拆分为 Client + Upgrade 两个独立项目
Expand Down
26 changes: 19 additions & 7 deletions BUGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
## 修复状态

> ✅ **全部更新完成**。所有模板文件已更新为 v10.5.0-beta.4 API。
> ✅ **已知问题全部确认解决**。Bowl API 已验证,NuGet 类型冲突已修复,版本号已统一,CLI 已编译。

| 类别 | 更新内容 | 状态 |
|------|---------|:----:|
Expand All @@ -44,14 +45,25 @@

## 已知剩余问题

### 1. NuGet 类型冲突(未变
### 1. NuGet 类型冲突(v10.5.0-beta.4 ✅ 已解决

`GeneralUpdate.Common` 库的类型同时在 `GeneralUpdate.Core` `GeneralUpdate.Bowl` 中发布
当项目同时引用 Bowl Core 时,会出现 CS0433 编译错误
`GeneralUpdate.Common` 独立命名空间在 v10.4.6 中存在于 `GeneralUpdate.Core` 中,与 `GeneralUpdate.Bowl` 冲突
**v10.5.0-beta.4 已解决**:Bowl 项目不再引用 Core,各自使用独立的 `GeneralUpdate.Bowl` / `GeneralUpdate.Core` 命名空间

**解决方案**:使用 Bowl 时只引用 `GeneralUpdate.Bowl`(它依赖 Core),不单独引用 Core。
| 场景 | 引用方式 | 状态 |
|------|---------|:----:|
| 有 Bowl | 只引用 `GeneralUpdate.Bowl`(不单独引用 Core) | ✅ 已验证 |
| 无 Bowl | 只引用 `GeneralUpdate.Core` | ✅ 正常 |
| 两者都用 | 同时引用 Core + Bowl | ✅ 无冲突 |
Comment on lines +48 to +57

### 2. Bowl LaunchAsync(v10.5.0-beta.4 ✅ 已验证)

`Bowl` 类在 v10.5.0-beta.4 中有公开的 `LaunchAsync` 方法:

### 2. Bowl LaunchAsync 可用性待确认
```csharp
public async Task<BowlResult> LaunchAsync(BowlContext context, CancellationToken ct = default)
```

v10.5.0-beta.4 中的 `Bowl` 类是否有公开的 `LaunchAsync` 方法需要在实际使用前确认。
如不可用,请保持事件回调替代方案。
- `BowlContext` 为 `readonly record struct`,支持 `Normalize()` 方法填充默认值
- `BowlResult` 包含 `Success` / `ExitCode` / `DumpCaptured` / `DumpFilePath` / `CrashReportPath` / `Restored`
- 不要求 `Bowl.LaunchAsync` 存在其它签名,模板已按实际 API 更新
2 changes: 1 addition & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Covers 50+ known issues discovered from real GitHub/Gitee feedback, providing production-ready code generation and deep troubleshooting.

> Version: 0.0.2-bate.1 (2026-06-16) — targets NuGet `GeneralUpdate.Core 10.5.0-beta.4`
> Version: 0.0.2-beta.1 (2026-06-16) — targets NuGet `GeneralUpdate.Core 10.5.0-beta.4`

---

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Covers 50+ known issues discovered from real GitHub/Gitee feedback, providing production-ready code generation and deep troubleshooting.

> **Current Version: 0.0.2-bate.1** — targets NuGet `GeneralUpdate.Core 10.5.0-beta.4`
> **Current Version: 0.0.2-beta.1** — targets NuGet `GeneralUpdate.Core 10.5.0-beta.4`
> Compatibility: `v10.5.0-beta.4` (NuGet latest preview)
> All templates verified via `dotnet build` (0 errors).

Expand Down
2 changes: 1 addition & 1 deletion README.zh-Hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

覆盖 50+ 真实 Issue 发现的已知问题,提供即用型代码生成 + 深度故障排查。

> 当前版本:0.0.2-bate.1 — 针对 NuGet `GeneralUpdate.Core 10.5.0-beta.4`
> 当前版本:0.0.2-beta.1 — 针对 NuGet `GeneralUpdate.Core 10.5.0-beta.4`
> 兼容性:`v10.5.0-beta.4`(NuGet 最新预览版)
> **所有模板已通过 `dotnet build` 编译验证(0 errors)。**

Expand Down
Loading