From e457ad766fdac2f95418bf12869abf2006e4d5b9 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 12 Feb 2026 15:13:19 +0000
Subject: [PATCH 1/7] Initial plan
From 4009fa5720ff0cbce05ca9292b0c51b284fb6144 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 12 Feb 2026 15:21:44 +0000
Subject: [PATCH 2/7] Enhanced documentation for all four core components with
bilingual content
Co-authored-by: JusterZhu <11714536+JusterZhu@users.noreply.github.com>
---
website/docs/doc/GeneralUpdate.Bowl.md | 423 ++++++----
website/docs/doc/GeneralUpdate.ClientCore.md | 765 +++++++++++++++---
website/docs/doc/GeneralUpdate.Core.md | 639 ++++++++++++++-
.../docs/doc/GeneralUpdate.Differential.md | 494 +++++++++--
4 files changed, 1960 insertions(+), 361 deletions(-)
diff --git a/website/docs/doc/GeneralUpdate.Bowl.md b/website/docs/doc/GeneralUpdate.Bowl.md
index 6cfe08b..5af0825 100644
--- a/website/docs/doc/GeneralUpdate.Bowl.md
+++ b/website/docs/doc/GeneralUpdate.Bowl.md
@@ -2,59 +2,237 @@
sidebar_position: 3
---
-### Definition
+# GeneralUpdate.Bowl
-Namespace: GeneralUpdate.Bowl
+## 组件概览 | Component Overview
-Assembly: GeneralUpdate.Bowl.dll
+**GeneralUpdate.Bowl** 是一个独立的进程监控组件,在升级流程结束前启动,负责启动主客户端应用程序并监控其运行状态。该组件提供了完整的崩溃监控和诊断能力,当被监控的应用程序发生异常时,会自动导出Dump文件、驱动信息、系统信息和事件日志,帮助开发者快速定位问题。
-This component is an independent process launched before the end of the upgrade process. It starts the main client application and monitors its normal operation before the process ends.
+**GeneralUpdate.Bowl** is an independent process monitoring component that launches before the end of the upgrade process. It is responsible for starting the main client application and monitoring its running status. This component provides comprehensive crash monitoring and diagnostic capabilities. When the monitored application encounters an exception, it automatically exports Dump files, driver information, system information, and event logs to help developers quickly locate issues.
-```c#
+**命名空间 | Namespace:** `GeneralUpdate.Bowl`
+**程序集 | Assembly:** `GeneralUpdate.Bowl.dll`
+
+```csharp
public sealed class Bowl
```
+---
+
+## 核心特性 | Core Features
+
+### 1. 进程监控 | Process Monitoring
+- 实时监控目标应用程序的运行状态 | Real-time monitoring of target application status
+- 自动检测进程崩溃和异常退出 | Automatic detection of process crashes and abnormal exits
+
+### 2. 崩溃诊断 | Crash Diagnostics
+- 自动生成Dump文件(.dmp)用于崩溃分析 | Automatic generation of Dump files (.dmp) for crash analysis
+- 导出详细的系统和驱动信息 | Export detailed system and driver information
+- 收集Windows系统事件日志 | Collect Windows system event logs
+
+### 3. 版本化管理 | Version Management
+- 按版本号分类存储故障信息 | Store failure information categorized by version number
+- 支持升级和正常两种工作模式 | Support both upgrade and normal working modes
+
+---
+
+## 快速开始 | Quick Start
+
+### 安装 | Installation
+
+通过 NuGet 安装 GeneralUpdate.Bowl:
+
+Install GeneralUpdate.Bowl via NuGet:
+
+```bash
+dotnet add package GeneralUpdate.Bowl
+```
+
+### 初始化与使用 | Initialization and Usage
+以下示例展示了如何使用 Bowl 组件监控应用程序:
-### Example
+The following example demonstrates how to use the Bowl component to monitor an application:
-The following example defines a method that includes the use of Bowl.
+```csharp
+using GeneralUpdate.Bowl;
+using GeneralUpdate.Bowl.Strategys;
-```c#
var installPath = AppDomain.CurrentDomain.BaseDirectory;
var lastVersion = "1.0.0.3";
var processInfo = new MonitorParameter
{
- ProcessNameOrId = "JsonTest.exe",
+ ProcessNameOrId = "YourApp.exe",
DumpFileName = $"{lastVersion}_fail.dmp",
FailFileName = $"{lastVersion}_fail.json",
TargetPath = installPath,
FailDirectory = Path.Combine(installPath, "fail", lastVersion),
BackupDirectory = Path.Combine(installPath, lastVersion),
- WorkModel = "Normal"
+ WorkModel = "Normal" // 使用 Normal 模式独立监控 | Use Normal mode for standalone monitoring
};
Bowl.Launch(processInfo);
```
-### Capture
+---
+
+## 核心 API 参考 | Core API Reference
+
+### Launch 方法 | Launch Method
+
+启动进程监控功能。
+
+Start the process monitoring functionality.
+
+**方法签名 | Method Signature:**
+
+```csharp
+public static void Launch(MonitorParameter? monitorParameter = null)
+```
+
+**参数 | Parameters:**
+
+#### MonitorParameter 类 | MonitorParameter Class
+
+```csharp
+public class MonitorParameter
+{
+ ///
+ /// 被监控的目录
+ /// Directory being monitored
+ ///
+ public string TargetPath { get; set; }
+
+ ///
+ /// 导出异常信息的目录
+ /// Directory where captured exception information is exported
+ ///
+ public string FailDirectory { get; set; }
+
+ ///
+ /// 备份目录
+ /// Backup directory
+ ///
+ public string BackupDirectory { get; set; }
+
+ ///
+ /// 被监控进程的名称或ID
+ /// Name or ID of the process being monitored
+ ///
+ public string ProcessNameOrId { get; set; }
+
+ ///
+ /// Dump 文件名
+ /// Dump file name
+ ///
+ public string DumpFileName { get; set; }
+
+ ///
+ /// 升级包版本信息(.json)文件名
+ /// Upgrade package version information (.json) file name
+ ///
+ public string FailFileName { get; set; }
+
+ ///
+ /// 工作模式:
+ /// - Upgrade: 升级模式,主要用于与 GeneralUpdate 配合使用,内部逻辑处理,默认模式启动时请勿随意修改
+ /// - Normal: 正常模式,可独立使用监控单个程序,程序崩溃时导出崩溃信息
+ ///
+ /// Work Mode:
+ /// - Upgrade: Upgrade mode, primarily used in conjunction with GeneralUpdate for internal logic handling.
+ /// Do not modify arbitrarily when the default mode is activated.
+ /// - Normal: Normal mode, can be used independently to monitor a single program.
+ /// Exports crash information when the program crashes.
+ ///
+ public string WorkModel { get; set; } = "Upgrade";
+}
+```
+
+---
+
+## 实际使用示例 | Practical Usage Examples
+
+### 示例 1:独立模式监控应用 | Example 1: Standalone Mode Application Monitoring
+
+```csharp
+using GeneralUpdate.Bowl;
+using GeneralUpdate.Bowl.Strategys;
+
+// 配置监控参数 | Configure monitoring parameters
+var installPath = AppDomain.CurrentDomain.BaseDirectory;
+var currentVersion = "1.0.0.5";
+
+var monitorConfig = new MonitorParameter
+{
+ ProcessNameOrId = "MyApplication.exe",
+ DumpFileName = $"{currentVersion}_crash.dmp",
+ FailFileName = $"{currentVersion}_crash.json",
+ TargetPath = installPath,
+ FailDirectory = Path.Combine(installPath, "crash_reports", currentVersion),
+ BackupDirectory = Path.Combine(installPath, "backups", currentVersion),
+ WorkModel = "Normal" // 独立监控模式 | Standalone monitoring mode
+};
+
+// 启动监控 | Start monitoring
+Bowl.Launch(monitorConfig);
+```
+
+### 示例 2:结合 GeneralUpdate 使用 | Example 2: Use with GeneralUpdate
-If a crash is detected, the following files will be generated in the running directory:
+```csharp
+using GeneralUpdate.Bowl;
+using GeneralUpdate.Bowl.Strategys;
-- 📒 Dump file (1.0.0.*_fail.dmp)
-- 📒 Upgrade package version information (1.0.0.*_fail.json)
-- 📒 Driver information (driverInfo.txt)
-- 📒 Operating system/hardware information (systeminfo.txt)
-- 📒 System event log (systemlog.evtx)
+// 在升级完成后启动 Bowl 监控 | Start Bowl monitoring after upgrade completion
+var installPath = AppDomain.CurrentDomain.BaseDirectory;
+var upgradedVersion = "2.0.0.1";
-These will be exported to the "fail" directory, categorized by version number.
+var upgradeMonitor = new MonitorParameter
+{
+ ProcessNameOrId = "UpdatedApp.exe",
+ DumpFileName = $"{upgradedVersion}_fail.dmp",
+ FailFileName = $"{upgradedVersion}_fail.json",
+ TargetPath = installPath,
+ FailDirectory = Path.Combine(installPath, "fail", upgradedVersion),
+ BackupDirectory = Path.Combine(installPath, upgradedVersion),
+ WorkModel = "Upgrade" // 升级模式 | Upgrade mode
+};
-
+Bowl.Launch(upgradeMonitor);
+```
-#### (1) x.0.0.*_fail.dmp
+---
-
+## 崩溃信息捕获 | Crash Information Capture
-#### (2) x.0.0.*_fail.json
+当检测到崩溃时,以下文件将在运行目录中生成:
+
+When a crash is detected, the following files will be generated in the running directory:
+
+- 📒 **Dump 文件** (`x.0.0.*_fail.dmp`) | **Dump file** (`x.0.0.*_fail.dmp`)
+- 📒 **升级包版本信息** (`x.0.0.*_fail.json`) | **Upgrade package version information** (`x.0.0.*_fail.json`)
+- 📒 **驱动信息** (`driverInfo.txt`) | **Driver information** (`driverInfo.txt`)
+- 📒 **操作系统/硬件信息** (`systeminfo.txt`) | **Operating system/hardware information** (`systeminfo.txt`)
+- 📒 **系统事件日志** (`systemlog.evtx`) | **System event log** (`systemlog.evtx`)
+
+这些文件将按版本号分类导出到 "fail" 目录中。
+
+These files will be exported to the "fail" directory, categorized by version number.
+
+
+
+### 1. Dump 文件 | Dump File
+
+Dump 文件包含崩溃时刻的内存快照,可用于调试分析:
+
+The Dump file contains a memory snapshot at the moment of crash, which can be used for debugging analysis:
+
+
+
+### 2. 版本信息文件 | Version Information File
+
+JSON 格式的详细崩溃报告,包含参数配置和 ProcDump 输出:
+
+Detailed crash report in JSON format, including parameter configuration and ProcDump output:
```json
{
@@ -96,147 +274,100 @@ These will be exported to the "fail" directory, categorized by version number.
}
```
-#### (3) driverInfo.txt
+### 3. 驱动信息文件 | Driver Information File
-```json
-Module Name Display Name Description Driver Type Start Mode State Status Accept Stop Accept Pause Paged Pool Code(Bytes) BSS(Bytes) Link Date Path Init(Bytes)
-============ ====================== ====================== ============= ========== ========== ========== =========== ============ ========== ========== ======= ====================== ================================================ ==========
-360AntiAttac 360Safe Anti Attack Se 360Safe Anti Attack Se Kernel System Running OK TRUE FALSE 4,096 36,864 0 9/29/2022 3:45:03 PM C:\Windows\system32\Drivers\360AntiAttack64.sys 4,096
-360AntiHacke 360Safe Anti Hacker Se 360Safe Anti Hacker Se Kernel System Running OK TRUE FALSE 4,096 139,264 0 11/27/2023 3:43:37 PM C:\Windows\system32\Drivers\360AntiHacker64.sys 8,192
-360AntiHijac 360Safe Anti Hijack Se 360Safe Anti Hijack Se Kernel System Running OK TRUE FALSE 4,096 73,728 0 5/8/2024 12:19:52 PM C:\Windows\system32\Drivers\360AntiHijack64.sys 4,096
-360AntiSteal 360Safe Anti Steal Fil 360Safe Anti Steal Fil Kernel System Running OK TRUE FALSE 4,096 20,480 0 4/18/2024 3:58:04 PM C:\Windows\system32\Drivers\360AntiSteal64.sys 8,192
-360Box64 360Box mini-filter dri 360Box mini-filter dri File System System Running OK TRUE FALSE 0 225,280 0 8/7/2024 11:50:19 AM C:\Windows\system32\DRIVERS\360Box64.sys 12,288
-
-//...
+包含系统中所有驱动程序的详细信息:
+
+Contains detailed information about all drivers in the system:
+
+```text
+Module Name Display Name Description Driver Type Start Mode State Status
+============ ====================== ====================== ============= ========== ========== ==========
+360AntiAttac 360Safe Anti Attack Se 360Safe Anti Attack Se Kernel System Running OK
+360AntiHacke 360Safe Anti Hacker Se 360Safe Anti Hacker Se Kernel System Running OK
+// ...更多驱动信息 | ...more driver information
```
-#### (4) systeminfo.txt
+### 4. 系统信息文件 | System Information File
-```json
+完整的操作系统和硬件配置信息:
+
+Complete operating system and hardware configuration information:
+
+```text
Host Name: ****
-OS Name: Microsoft Windows 11 Pro
-OS Version: 10.0.2*** Build 22***
-OS Manufacturer: Microsoft Corporation
-OS Configuration: Standalone Workstation
-OS Build Type: Multiprocessor Free
-Registered Owner: ****@outlook.com
-Registered Organization:
-Product ID: ****-80000-***00-A****
-Original Install Date: 11/16/2023, 9:56:28 PM
-System Boot Time: 11/26/2024, 9:37:51 PM
-System Manufacturer: ASUS
-System Model: System Product Name
-System Type: x64-based PC
-Processor(s): Installed 1 Processor(s).
- [01]: Intel** Family * Model *** Stepping * GenuineIntel ~**** Mhz
-BIOS Version: American Megatrends Inc. 1402, 4/1/2022
-Windows Directory: C:\Windows
-System Directory: C:\Windows\system32
-Boot Device: \Device\Ha*****olume1
-System Locale: zh-cn;Chinese (China)
-Input Locale: zh-cn;Chinese (China)
-Time Zone: (UTC+08:00) **,**,*******,****
-Total Physical Memory: 16,194 MB
-Available Physical Memory: 1,795 MB
-Virtual Memory: Max Size: 25,410 MB
-Virtual Memory: Available: 9,438 MB
-Virtual Memory: In Use: 15,972 MB
-Page File Location(s): D:\****file.sys
-Domain: WORKGROUP
-Logon Server: \\****
-Hotfix(s):: 6 Hotfix(s) Installed.
- [01]: KB504****
- [02]: KB502****
- [03]: KB503****
- [04]: KB503****
- [05]: KB504****
- [06]: KB504****
-Network Card(s): 3 NIC(s) Installed.
- [01]: Intel(R) Ethernet Connection (**) I***-V
- Connection Name: Ethernet
- DHCP Enabled: Yes
- DHCP Server: 192.168.**.**
- IP Address
- [01]: 192.168.**.**
- [02]: ***::2640:***:****:****
- [02]: VMware Virtual Ethernet Adapter for VMnet1
- Connection Name: VMware Network Adapter VMnet1
- DHCP Enabled: Yes
- DHCP Server: 192.168.**.**
- IP Address
- [01]: 192.168.**.**
- [02]: ***::9b3:***,***:****
- [03]: VMware Virtual Ethernet Adapter for VMnet8
- Connection Name: VMware Network Adapter VMnet8
- DHCP Enabled: Yes
- DHCP Server: 192.168.**.**
- IP Address
- [01]: 192.***,***:****
- [02]: fe80::***:***:***:****
-Hyper-V Requirements: A hypervisor has been detected. Features required for Hyper-V will not be displayed.
-
-//...
+OS Name: Microsoft Windows 11 Pro
+OS Version: 10.0.*** Build 22***
+System Manufacturer: ASUS
+System Model: System Product Name
+Processor(s): Intel** Family * Model ***
+Total Physical Memory: 16,194 MB
+// ...更多系统信息 | ...more system information
```
-#### (5) systemlog.evtx
+### 5. 系统事件日志 | System Event Log
-
+Windows 事件查看器格式的系统日志(.evtx 文件):
-### Notes
+System log in Windows Event Viewer format (.evtx file):
-Bowl provides runtime monitoring capabilities and exports relevant error information.
+
-#### Methods
+---
-| Method | Description |
-| -------- | ---------------- |
-| Launch() | Start monitoring |
+## 注意事项与警告 | Notes and Warnings
-### 🌼Launch()
+### ⚠️ 重要提示 | Important Notes
-**Launch Function**
+1. **工作模式选择 | Work Mode Selection**
+ - `Upgrade` 模式:专门用于与 GeneralUpdate 框架集成,包含内部逻辑处理
+ - `Normal` 模式:可独立使用,适合监控任何 .NET 应用程序
+ - `Upgrade` mode: Specifically for integration with GeneralUpdate framework, includes internal logic processing
+ - `Normal` mode: Can be used independently, suitable for monitoring any .NET application
-```c#
-Launch(MonitorParameter? monitorParameter = null);
-```
+2. **权限要求 | Permission Requirements**
+ - Bowl 需要足够的权限来生成 Dump 文件和读取系统信息
+ - 建议以管理员权限运行需要监控的应用程序
+ - Bowl requires sufficient permissions to generate Dump files and read system information
+ - It is recommended to run the monitored application with administrator privileges
-**Parameters**
+3. **磁盘空间 | Disk Space**
+ - Dump 文件可能占用大量磁盘空间(通常 50-200 MB)
+ - 确保 FailDirectory 所在磁盘有足够的可用空间
+ - Dump files may consume significant disk space (typically 50-200 MB)
+ - Ensure sufficient available space on the disk where FailDirectory is located
-```c#
-public class MonitorParameter
-{
- // Directory being monitored
- public string TargetPath { get; set; }
-
- // Directory where captured exception information is exported
- public string FailDirectory { get; set; }
-
- // Backup directory
- public string BackupDirectory { get; set; }
-
- // Name or ID of the process being monitored
- public string ProcessNameOrId { get; set; }
-
- // Dump file name
- public string DumpFileName { get; set; }
-
- // Upgrade package version information (.json) file name
- public string FailFileName { get; set; }
+4. **依赖项 | Dependencies**
+ - Bowl 使用 ProcDump 工具生成 Dump 文件,该工具已内置在组件中
+ - 无需额外安装依赖项
+ - Bowl uses the ProcDump tool to generate Dump files, which is built into the component
+ - No additional dependencies need to be installed
- ///
- /// Upgrade: upgrade mode. This mode is primarily used in conjunction with GeneralUpdate for internal use. Please do not modify it arbitrarily when the default mode is activated.
- /// Normal: Normal mode, This mode can be used independently to monitor a single program. If the program crashes, it will export the crash information.
- ///
- public string WorkModel { get; set; } = "Upgrade";
-}
-```
+### 💡 最佳实践 | Best Practices
+
+- **版本号管理**:为每个版本使用独立的故障目录,便于问题追踪
+- **日志清理**:定期清理旧版本的故障信息,避免磁盘空间耗尽
+- **测试验证**:在生产环境部署前,在测试环境验证监控功能
+- **Version Management**: Use separate failure directories for each version for easier issue tracking
+- **Log Cleanup**: Regularly clean up failure information from old versions to avoid disk space exhaustion
+- **Testing**: Verify monitoring functionality in a test environment before production deployment
+
+---
+
+## 适用平台 | Applicable Platforms
+
+| 产品 Product | 版本 Version |
+| ------------------ | ----------------- |
+| .NET | 5, 6, 7, 8, 9 |
+| .NET Framework | 4.6.1 |
+| .NET Standard | 2.0 |
+| .NET Core | 2.0 |
+| ASP.NET | Any |
+
+---
-### Applicable To
+## 相关资源 | Related Resources
-| Product | Version |
-| -------------- | ------------- |
-| .NET | 5, 6, 7, 8, 9 |
-| .NET Framework | 4.6.1 |
-| .NET Standard | 2.0 |
-| .NET Core | 2.0 |
-| ASP.NET | Any |
\ No newline at end of file
+- **示例代码**:[查看 GitHub 示例](https://github.com/GeneralLibrary/GeneralUpdate-Samples/tree/main/src/Bowl) | [View GitHub Examples](https://github.com/GeneralLibrary/GeneralUpdate-Samples/tree/main/src/Bowl)
+- **视频教程**:[观看 Bilibili 教程](https://www.bilibili.com/video/BV1c8iyYZE7P) | [Watch Bilibili Tutorial](https://www.bilibili.com/video/BV1c8iyYZE7P)
+- **主仓库**:[GeneralUpdate 项目](https://github.com/GeneralLibrary/GeneralUpdate) | [GeneralUpdate Project](https://github.com/GeneralLibrary/GeneralUpdate)
\ No newline at end of file
diff --git a/website/docs/doc/GeneralUpdate.ClientCore.md b/website/docs/doc/GeneralUpdate.ClientCore.md
index 5a9a29f..005337f 100644
--- a/website/docs/doc/GeneralUpdate.ClientCore.md
+++ b/website/docs/doc/GeneralUpdate.ClientCore.md
@@ -2,129 +2,670 @@
sidebar_position: 4
---
-### Definition
+# GeneralUpdate.ClientCore
-Namespace: GeneralUpdate.ClientCore
+## 组件概览 | Component Overview
-Assembly: GeneralUpdate.ClientCore.dll
+**GeneralUpdate.ClientCore** 是 GeneralUpdate 框架的核心组件之一,提供了丰富的客户端更新功能。该组件运行在主应用程序中,负责检查更新、下载更新包、验证完整性,并在完成后启动升级助手(GeneralUpdate.Core)来执行实际的文件替换操作。ClientCore 的设计理念是让主程序能够安全地检查和准备更新,而不影响当前运行状态。
+**GeneralUpdate.ClientCore** is one of the core components of the GeneralUpdate framework, providing rich client-side update functionalities. This component runs in the main application and is responsible for checking updates, downloading update packages, validating integrity, and then launching the upgrade assistant (GeneralUpdate.Core) to perform actual file replacement operations upon completion. The design philosophy of ClientCore is to enable the main program to safely check and prepare updates without affecting the current running state.
+**命名空间 | Namespace:** `GeneralUpdate.ClientCore`
+**程序集 | Assembly:** `GeneralUpdate.ClientCore.dll`
-GeneralUpdate.ClientCore is one of the core components, offering a wide range of primary functionalities. Its essence is similar to Core, but it has a different role: ClientCore is used in the main program, where it assists in updates and upgrades and then closes the main program to launch the upgrade assistant.
-
-```c#
+```csharp
public class GeneralClientBootstrap : AbstractBootstrap
```
+---
+
+## 核心特性 | Core Features
+
+### 1. 多版本下载管理 | Multi-Version Download Management
+- 支持同时下载多个版本的更新包 | Support downloading multiple version update packages simultaneously
+- 断点续传和下载速度限制 | Resume download and download speed limiting
+- 实时下载进度和统计信息 | Real-time download progress and statistics
+
+### 2. 灵活的配置选项 | Flexible Configuration Options
+- 黑名单机制(文件、格式、目录)| Blacklist mechanism (files, formats, directories)
+- 自定义更新策略和操作 | Custom update strategies and operations
+- 支持二进制差异更新和全量更新 | Support binary differential updates and full updates
+
+### 3. 完整的事件通知 | Comprehensive Event Notifications
+- 下载进度、完成、错误事件 | Download progress, completion, and error events
+- 支持用户自定义跳过更新选项 | Support user-defined skip update options
+- 异常和错误全程监控 | Exception and error monitoring throughout the process
+
+### 4. 多平台支持 | Multi-Platform Support
+- Windows、Linux、macOS 平台支持 | Windows, Linux, macOS platform support
+- 自动平台检测和策略选择 | Automatic platform detection and strategy selection
+
+
+
+---
+
+## 快速开始 | Quick Start
+
+### 安装 | Installation
+
+通过 NuGet 安装 GeneralUpdate.ClientCore:
+
+Install GeneralUpdate.ClientCore via NuGet:
+
+```bash
+dotnet add package GeneralUpdate.ClientCore
+```
+
+### 初始化与使用 | Initialization and Usage
+
+以下示例展示了如何在主程序中配置和启动更新检查:
+
+The following example demonstrates how to configure and launch update checking in the main program:
+
+```csharp
+using System.Text;
+using GeneralUpdate.ClientCore;
+using GeneralUpdate.Common.Download;
+using GeneralUpdate.Common.Internal;
+using GeneralUpdate.Common.Internal.Bootstrap;
+using GeneralUpdate.Common.Shared.Object;
+
+try
+{
+ Console.WriteLine($"主程序初始化,{DateTime.Now}!");
+
+ // 配置更新参数 | Configure update parameters
+ var configinfo = new Configinfo
+ {
+ // 更新验证 API 地址 | Update verification API address
+ UpdateUrl = "http://127.0.0.1:5000/Upgrade/Verification",
+ // 更新报告 API 地址 | Update report API address
+ ReportUrl = "http://127.0.0.1:5000/Upgrade/Report",
+ // 主应用程序名称 | Main application name
+ MainAppName = "ClientSample.exe",
+ // 升级程序名称 | Upgrade program name
+ AppName = "UpgradeSample.exe",
+ // 当前客户端版本 | Current client version
+ ClientVersion = "1.0.0.0",
+ // 升级端版本 | Upgrade client version
+ UpgradeClientVersion = "1.0.0.0",
+ // 安装路径 | Installation path
+ InstallPath = Thread.GetDomain().BaseDirectory,
+ // 产品 ID(用于多产品分支管理)| Product ID (for multi-product branch management)
+ ProductId = "2d974e2a-31e6-4887-9bb1-b4689e98c77a",
+ // 应用密钥(用于服务器验证)| App secret key (for server verification)
+ AppSecretKey = "dfeb5833-975e-4afb-88f1-6278ee9aeff6"
+ };
+
+ // 启动更新流程 | Launch update process
+ await new GeneralClientBootstrap()
+ // 监听下载统计信息 | Listen for download statistics
+ .AddListenerMultiDownloadStatistics(OnMultiDownloadStatistics)
+ // 监听单个下载完成 | Listen for single download completion
+ .AddListenerMultiDownloadCompleted(OnMultiDownloadCompleted)
+ // 监听所有下载完成 | Listen for all downloads completion
+ .AddListenerMultiAllDownloadCompleted(OnMultiAllDownloadCompleted)
+ // 监听下载错误 | Listen for download errors
+ .AddListenerMultiDownloadError(OnMultiDownloadError)
+ // 监听异常 | Listen for exceptions
+ .AddListenerException(OnException)
+ // 设置配置 | Set configuration
+ .SetConfig(configinfo)
+ // 设置选项 | Set options
+ .Option(UpdateOption.DownloadTimeOut, 60)
+ .Option(UpdateOption.Encoding, Encoding.Default)
+ // 启动异步更新 | Launch async update
+ .LaunchAsync();
+
+ Console.WriteLine($"主程序已启动,{DateTime.Now}!");
+}
+catch (Exception e)
+{
+ Console.WriteLine(e.Message + "\n" + e.StackTrace);
+}
+
+// 事件处理方法 | Event handler methods
+void OnMultiDownloadStatistics(object arg1, MultiDownloadStatisticsEventArgs arg2)
+{
+ var version = arg2.Version as VersionInfo;
+ Console.WriteLine($"下载版本:{version.Version},速度:{arg2.Speed}," +
+ $"剩余时间:{arg2.Remaining},进度:{arg2.ProgressPercentage}%");
+}
+
+void OnMultiDownloadCompleted(object arg1, MultiDownloadCompletedEventArgs arg2)
+{
+ var version = arg2.Version as VersionInfo;
+ Console.WriteLine(arg2.IsComplated ?
+ $"版本 {version.Version} 下载完成!" :
+ $"版本 {version.Version} 下载失败!");
+}
+
+void OnMultiAllDownloadCompleted(object arg1, MultiAllDownloadCompletedEventArgs arg2)
+{
+ Console.WriteLine(arg2.IsAllDownloadCompleted ?
+ "所有下载任务已完成!" :
+ $"下载任务失败!失败数量:{arg2.FailedVersions.Count}");
+}
+
+void OnMultiDownloadError(object arg1, MultiDownloadErrorEventArgs arg2)
+{
+ var version = arg2.Version as VersionInfo;
+ Console.WriteLine($"版本 {version.Version} 下载错误:{arg2.Exception}");
+}
+
+void OnException(object arg1, ExceptionEventArgs arg2)
+{
+ Console.WriteLine($"更新异常:{arg2.Exception}");
+}
+```
+
+---
+
+## 核心 API 参考 | Core API Reference
+
+### GeneralClientBootstrap 类方法 | GeneralClientBootstrap Class Methods
+
+#### LaunchAsync 方法 | LaunchAsync Method
+
+异步启动更新流程。
+
+Launch the update process asynchronously.
+
+```csharp
+public async Task LaunchAsync()
+```
+
+#### SetConfig 方法 | SetConfig Method
+
+设置更新配置信息。
+
+Set update configuration information.
+
+```csharp
+public GeneralClientBootstrap SetConfig(Configinfo configinfo)
+```
+
+#### Option 方法 | Option Method
+
+设置更新选项。
+
+Set update options.
+
+```csharp
+public GeneralClientBootstrap Option(UpdateOption option, object value)
+```
+
+#### SetBlacklist 方法 | SetBlacklist Method
+
+设置更新黑名单,指定不需要更新的文件。
+
+Set update blacklist to specify files that should not be updated.
+
+```csharp
+public GeneralClientBootstrap SetBlacklist(List blackFiles = null,
+ List blackFormats = null)
+```
+
+#### AddListenerMultiDownloadStatistics 方法 | AddListenerMultiDownloadStatistics Method
+
+监听下载统计信息(速度、进度、剩余时间等)。
+
+Listen for download statistics (speed, progress, remaining time, etc.).
+
+```csharp
+public GeneralClientBootstrap AddListenerMultiDownloadStatistics(
+ Action