Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion website/docs/doc/GeneralUpdate.Core.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ sidebar_position: 5
| `Cancel()` | 无 | `void` | UI 中提供"取消更新"按钮 | 触发内部 `CancellationTokenSource` |
| `SetConfig(UpdateRequest)` | `configInfo` — 更新配置对象 | `GeneralUpdateBootstrap` | 主程序内显式配置更新参数 | 会调用 `Validate()` 检查关键字段 |
| `SetConfig(string)` | `filePath` — JSON 配置文件路径 | `GeneralUpdateBootstrap` | 从文件读取更新配置 | 支持相对路径和绝对路径;UTF-8 JSON 格式 |
| `SetSource(...)` | `updateUrl`, `appSecretKey`, `reportUrl?`, `scheme?`, `token?` | `GeneralUpdateBootstrap` | 轻配置入口,配合 manifest 使用 | 只提供服务端入口和密钥,身份信息由 manifest 补齐 |
| `SetSource(...)` | `updateUrl`(更新检查 API 地址)<br>`appSecretKey`(应用密钥)<br>`reportUrl?`(可选上报地址)<br>`scheme?`(可选认证方案,如 `"Bearer"`)<br>`token?`(可选认证令牌)<br>`authScheme?`(可选认证方案枚举,默认 `Hmac`)<br>`basicUsername?`(可选 Basic 认证用户名)<br>`basicPassword?`(可选 Basic 认证密码)<br>`installPath?`(可选安装路径) | `GeneralUpdateBootstrap` | 轻配置入口,配合 manifest 使用 | 只提供服务端入口和密钥,身份信息由 manifest 补齐;支持 HMAC / Bearer / Basic 多种认证方式 |
| `SetOption(Option<T>, T)` | `option` — 选项键, `value` — 选项值 | `GeneralUpdateBootstrap` | 设置运行时选项 | 传入 `null` 给可空选项会移除当前设置 |
| `UseDiffPipeline(Action<DiffPipelineBuilder>)` | `configure` — 差分管道配置委托 | `GeneralUpdateBootstrap` | 替换或调整差分补丁管道 | 未调用时使用默认配置 |
| `AddListenerUpdateInfo(...)` | `EventHandler<UpdateInfoEventArgs>` | `GeneralUpdateBootstrap` | 接收服务端版本信息 | 无更新时也会触发(`Info.Code = 404`) |
Expand Down Expand Up @@ -197,6 +197,9 @@ sidebar_position: 5
| `SetDriverDirectory(string)` | `path` | `UpdateRequestBuilder` | 设置驱动目录 | — |
| `SetScheme(string)` | `scheme` | `UpdateRequestBuilder` | 设置认证方案 | — |
| `SetToken(string)` | `token` | `UpdateRequestBuilder` | 设置认证令牌 | — |
| `SetAuthScheme(AuthScheme)` | `authScheme` — 认证方案枚举 | `UpdateRequestBuilder` | 设置认证方案(Hmac / Bearer / ApiKey / Basic) | 默认 `Hmac` |
| `SetBasicUsername(string)` | `username` | `UpdateRequestBuilder` | 设置 Basic 认证用户名 | 需配合 `SetAuthScheme(AuthScheme.Basic)` |
| `SetBasicPassword(string)` | `password` | `UpdateRequestBuilder` | 设置 Basic 认证密码 | 需配合 `SetAuthScheme(AuthScheme.Basic)` |
| `SetFiles(List<string>)` | `files` | `UpdateRequestBuilder` | 设置跳过文件列表 | — |
| `SetFormats(List<string>)` | `formats` | `UpdateRequestBuilder` | 设置跳过扩展名列表 | — |
| `SetDirectories(List<string>)` | `dirs` | `UpdateRequestBuilder` | 设置跳过目录列表 | — |
Expand Down
6 changes: 3 additions & 3 deletions website/docs/doc/GeneralUpdate.Differential.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sidebar_position: 6

### 1.1 组件概述

**GeneralUpdate.Differential** 是 GeneralUpdate 的二进制差分组件,专注解决"一个旧文件 + 一个补丁文件 = 一个新文件"的问题。它提供可替换的文件级差分算法(BSDIFF 4.0 / Streaming HDiff)、补丁压缩抽象(BZip2 / Deflate / Brotli 预留)和 BSDIFF 兼容补丁读写能力。
**GeneralUpdate.Differential** 是 GeneralUpdate 的二进制差分组件,专注解决"一个旧文件 + 一个补丁文件 = 一个新文件"的问题。它提供可替换的文件级差分算法(BSDIFF 4.0 / Streaming HDiff)、补丁压缩抽象(BZip2 / Deflate,源码中预留 .NET 6+ Brotli)和 BSDIFF 兼容补丁读写能力。

目录级对比、批量补丁生成、并行调度、删除文件处理和更新流程编排由 `GeneralUpdate.Core` 的 `DiffPipeline` 或 `GeneralUpdate.Tools` 承担。

Expand All @@ -21,7 +21,7 @@ sidebar_position: 6
| 文件级差分生成 | `CleanAsync(oldFile, newFile, patchFile)` — 对比新旧文件生成 `.patch` 补丁 |
| 文件级差分应用 | `DirtyAsync(oldFile, newFile, patchFile)` — 旧文件 + 补丁 → 新文件 |
| 可替换差分算法 | `BsdiffDiffer`(BSDIFF 4.0,后缀排序)和 `StreamingHdiffDiffer`(块哈希索引) |
| 可替换压缩格式 | BZip2 (0x00)、Deflate (0x01),源码中预留 .NET 6+ Brotli (0x02) |
| 可替换压缩格式 | BZip2 (0x00)、Deflate (0x01),源码中通过 `#if NET6_0_OR_GREATER` 条件编译预留 Brotli (0x02) |
| BSDIFF 兼容格式 | 写入 33 字节扩展头(32 字节 BSDIFF40 + 1 字节压缩格式),兼容 32 字节旧头 |
| 线程安全 | 内置 differ 和压缩提供器均支持并发调用 |

Expand Down Expand Up @@ -93,7 +93,7 @@ Differential 本身是底层库,不提供配置类。所有参数通过构造
| --- | --- | --- | --- |
| `BZip2CompressionProvider` | `0x00` | 完全可用 | BSDIFF 旧补丁兼容,解压成本较高 |
| `DeflateCompressionProvider` | `0x01` | 完全可用 | 解压速度更友好,适合客户端批量应用 |
| `BrotliCompressionProvider` | `0x02` | 仅 .NET 6+ 编译(源码预留) | 生产不建议使用 |
| `BrotliCompressionProvider` | `0x02` | 仅 .NET 6+ 编译(源码中为完整实现,通过 `#if NET6_0_OR_GREATER` 条件编译) | 当前 `netstandard2.0` 包中不包含,生产不建议使用 |

### 3.2 实例方法

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,11 @@ sidebar_position: 5
| `ProductId` | `string` | — | Optional | — | Product identifier for multi-product servers |
| `UpdatePath` | `string` | `InstallPath` | Optional | Valid directory path | Upgrade process location |
| `Bowl` | `string` | `null` | Optional | Valid filename | Auxiliary process name to close before update |
| `Scheme` | `string` | `null` | Optional | `"Bearer"` etc. | Auth scheme |
| `Scheme` | `string` | `null` | Optional | `"Bearer"` etc. | Auth scheme (used with `Token`) |
| `Token` | `string` | `null` | Optional | — | Auth token |
| `AuthScheme` | `AuthScheme` | `Hmac` | Optional | `Hmac`, `Bearer`, `Basic` | Auth scheme enum; `Hmac` for GeneralSpacestation server-side signed auth |
| `BasicUsername` | `string` | `null` | Optional | — | HTTP Basic auth username (requires `AuthScheme = Basic`) |
| `BasicPassword` | `string` | `null` | Optional | — | HTTP Basic auth password (requires `AuthScheme = Basic`) |
Comment on lines 99 to +105
| `Files` | `List<string>` | `null` | Optional | — | Files to skip during update |
| `Formats` | `List<string>` | `null` | Optional | — | Extensions to skip during update |
| `Directories` | `List<string>` | `null` | Optional | — | Directories to skip during update |
Expand Down Expand Up @@ -135,7 +138,7 @@ sidebar_position: 5
| `Cancel()` | None | `void` | UI "Cancel Update" button | Triggers internal `CancellationTokenSource` |
| `SetConfig(UpdateRequest)` | `configInfo` | `GeneralUpdateBootstrap` | Explicit update configuration | Calls `Validate()` on key fields |
| `SetConfig(string)` | `filePath` — JSON config file path | `GeneralUpdateBootstrap` | Read config from file | Supports relative/absolute paths; UTF-8 JSON |
| `SetSource(...)` | `updateUrl`, `appSecretKey`, `reportUrl?`, `scheme?`, `token?` | `GeneralUpdateBootstrap` | Lightweight entry with manifest | Identity info filled by manifest |
| `SetSource(...)` | `updateUrl` (version check API URL)<br>`appSecretKey` (app secret key)<br>`reportUrl?` (optional report URL)<br>`scheme?` (optional auth scheme, e.g., `"Bearer"`)<br>`token?` (optional auth token)<br>`authScheme?` (optional auth scheme enum, default `Hmac`)<br>`basicUsername?` (optional Basic auth username)<br>`basicPassword?` (optional Basic auth password)<br>`installPath?` (optional install path) | `GeneralUpdateBootstrap` | Lightweight entry with manifest | Identity info filled by manifest; supports HMAC / Bearer / Basic auth methods |
| `SetOption(Option<T>, T)` | `option` — key, `value` — value | `GeneralUpdateBootstrap` | Set runtime options | Pass `null` to reset nullable options |
| `UseDiffPipeline(Action<DiffPipelineBuilder>)` | `configure` — delegate | `GeneralUpdateBootstrap` | Replace or tune diff pipeline | Default used if not called |
| `AddListenerUpdateInfo(...)` | `EventHandler<UpdateInfoEventArgs>` | `GeneralUpdateBootstrap` | Receive server version info | Also fires when no update available |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Directory-level comparison, batch patch generation, parallel scheduling, deleted
| File-Level Diff Generation | `CleanAsync(oldFile, newFile, patchFile)` — compare old & new files to generate `.patch` |
| File-Level Diff Application | `DirtyAsync(oldFile, newFile, patchFile)` — old file + patch → new file |
| Pluggable Diff Algorithms | `BsdiffDiffer` (BSDIFF 4.0, suffix sort) and `StreamingHdiffDiffer` (block hash indexing) |
| Pluggable Compression | BZip2 (0x00), Deflate (0x01), .NET 6+ Brotli (0x02) reserved in source |
| Pluggable Compression | BZip2 (0x00), Deflate (0x01), .NET 6+ Brotli (0x02) available via conditional compilation |
| BSDIFF Compatible Format | 33-byte extended header (32-byte BSDIFF40 + 1-byte compression format), 32-byte legacy compatible |
| Thread Safety | Built-in differ and compression providers support concurrent calls |

Expand Down Expand Up @@ -87,7 +87,7 @@ Differential is a low-level library with no configuration classes. All parameter
| --- | --- | --- | --- |
| `BZip2CompressionProvider` | `0x00` | Fully available | Legacy BSDIFF compatible, higher decompression cost |
| `DeflateCompressionProvider` | `0x01` | Fully available | Faster decompression, better for client batch apply |
| `BrotliCompressionProvider` | `0x02` | .NET 6+ only (source reserved) | Not recommended for production |
| `BrotliCompressionProvider` | `0x02` | .NET 6+ only (full implementation in source behind `#if NET6_0_OR_GREATER` conditional compilation) | Not included in current `netstandard2.0` package; not recommended for production |

### 3.2 Instance Methods

Expand Down
Loading
Loading