Skip to content

Feature/unified sample hub#73

Merged
JusterZhu merged 6 commits into
mainfrom
feature/unified-sample-hub
Jun 3, 2026
Merged

Feature/unified sample hub#73
JusterZhu merged 6 commits into
mainfrom
feature/unified-sample-hub

Conversation

@JusterZhu

Copy link
Copy Markdown
Collaborator

No description provided.

JusterZhu and others added 3 commits June 1, 2026 19:08
The server registers both /Upgrade/Verification and /Update/Verification
but only /Update/Report for status reporting. Add /Upgrade/Report so
clients using the /Upgrade/* URL variant can report update status.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Add Architecture.md: system architecture, update flow, component relationships
- Add Pipeline.md: middleware pipeline deep dive, BSDiff/HDiffPatch algorithms
- Add Security.md: TLS, auth (Bearer/API Key/HMAC), AES-256-CBC IPC encryption
- Add Configuration.md: complete config reference for all components
- Add FAQ.md: 24 frequently asked questions with code examples
- Enhance PacketTool.md: add Simulate Update and Config Generator documentation
- Enhance Packaging.md: expand from 2 links to comprehensive deployment guide
- All new docs include English translations (i18n/en/)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ractive CLI

Consolidate all 9 individual sample projects into a single Hub console
application with an interactive menu. Each sample demonstrates a different
GeneralUpdate component API end-to-end.

**New:**
- src/Hub/ — unified sample launcher with interactive menu
- src/Hub/Samples/ — all 9 samples as ISample implementations
- src/Hub/AppConfig.cs — JSON configuration model
- src/Hub/appsettings.json — server & product configuration
- src/Run.cmd / src/Run.ps1 — one-click launcher scripts
- src/gen_packages.ps1 — test package generator
- src/content_client/ — test data for Differential sample
- src/content_upgrade/ — test data for Upgrade packages
- src/content/ — intermediate version test data
- Directory.Build.props — shared build properties
- global.json — .NET 10 SDK pinning

**Samples & their GeneralUpdate API usage:**
1. CompleteUpdate — GeneralUpdateBootstrap (AppType.Client)
2. SilentUpdate — GeneralUpdateBootstrap (AppType.Client, silent)
3. OSS — GeneralUpdateBootstrap (AppType.OssClient)
4. Differential — DiffPipelineBuilder + BsdiffDiffer
5. Push — UpgradeHubService (SignalR push client)
6. Bowl — BowlContext (process monitor/dump)
7. Extension — GeneralExtensionHost (plugin system)
8. Drivelution — GeneralDrivelution (driver management)
9. Compress — CompressProvider (zip compress/decompress)

**Removed:** old individual sample projects (Bowl, Client, Compress,
Diff, Drivelution, Extension, OSS, Push, Upgrade) — all consolidated
under src/Hub/.

**Fixed:**
- Removed unnecessary PackageReferences already provided by ASP.NET Core
- Added OperatingSystem.IsWindows() guard in DrivelutionSample (CA1416)
- Cleaned up unused GuLibsPath property in Directory.Build.props

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 2, 2026 15:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates the repo’s scattered sample projects into a single interactive “Hub” runner and expands the documentation set (Architecture/Configuration/Pipeline/Security/FAQ/Packaging) for both English i18n and Chinese docs.

Changes:

  • Added src/Hub interactive sample menu with multiple end-to-end component demos (update flow, silent updates, OSS mode, SignalR push, Bowl, Drivelution, etc.).
  • Added/expanded Docusaurus guides (Architecture, Configuration, Pipeline, Security, FAQ, Packaging) and enhanced PacketTool docs.
  • Removed legacy standalone sample projects/scripts/IDE artifacts and added new launch + package generation scripts plus repo-wide .NET build settings.

Reviewed changes

Copilot reviewed 83 out of 135 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
website/i18n/en/docusaurus-plugin-content-docs/current/guide/Security.md New English security guide content.
website/i18n/en/docusaurus-plugin-content-docs/current/guide/Pipeline.md New English pipeline guide content.
website/i18n/en/docusaurus-plugin-content-docs/current/guide/Packaging.md Reworked English packaging/deployment guide.
website/i18n/en/docusaurus-plugin-content-docs/current/guide/FAQ.md New English FAQ.
website/i18n/en/docusaurus-plugin-content-docs/current/guide/Configuration.md New English configuration reference.
website/i18n/en/docusaurus-plugin-content-docs/current/guide/Architecture.md New English architecture guide.
website/i18n/en/docusaurus-plugin-content-docs/current/doc/GeneralUpdate.PacketTool.md Updated English Tools doc (adds Simulate Update + Config Generator sections).
website/docs/guide/Pipeline.md New Chinese pipeline guide.
website/docs/guide/Packaging.md Reworked Chinese packaging/deployment guide.
website/docs/guide/FAQ.md New Chinese FAQ.
website/docs/doc/GeneralUpdate.PacketTool.md Updated Chinese Tools doc (adds Simulate Update + Config Generator sections).
src/Upgrade/UpgradeSample.sln Removed legacy Upgrade sample solution.
src/Upgrade/UpgradeSample.csproj Removed legacy Upgrade sample project.
src/Upgrade/Program.cs Removed legacy Upgrade sample entrypoint.
src/Upgrade/build.bat Removed legacy Upgrade build script.
src/Upgrade/.vs/UpgradeSample/v17/DocumentLayout.json Removed IDE artifact.
src/Upgrade/.idea/.idea.UpgradeSample/.idea/vcs.xml Removed IDE artifact.
src/Upgrade/.idea/.idea.UpgradeSample/.idea/inspectionProfiles/Project_Default.xml Removed IDE artifact.
src/Upgrade/.idea/.idea.UpgradeSample/.idea/indexLayout.xml Removed IDE artifact.
src/Upgrade/.idea/.idea.UpgradeSample/.idea/avalonia.xml Removed IDE artifact.
src/Upgrade/.idea/.idea.UpgradeSample/.idea/.name Removed IDE artifact.
src/Upgrade/.idea/.idea.UpgradeSample/.idea/.gitignore Removed IDE artifact.
src/start.cmd Removed old multi-script runner.
src/Server/wwwroot/packages/versions.json Updated sample package index JSON.
src/Server/Program.cs Adds /Upgrade/Report route alias to existing report handler.
src/Run.ps1 New PowerShell Hub launcher (optional local DLL rebuild).
src/Run.cmd New Windows cmd wrapper for Run.ps1.
src/Push/PushSample.sln Removed legacy Push sample solution.
src/Push/PushSample.csproj Removed legacy Push sample project.
src/Push/Program.cs Removed legacy Push sample entrypoint.
src/Push/.idea/.idea.PushSample/.idea/vcs.xml Removed IDE artifact.
src/Push/.idea/.idea.PushSample/.idea/indexLayout.xml Removed IDE artifact.
src/Push/.idea/.idea.PushSample/.idea/encodings.xml Removed IDE artifact.
src/Push/.idea/.idea.PushSample/.idea/.name Removed IDE artifact.
src/Push/.idea/.idea.PushSample/.idea/.gitignore Removed IDE artifact.
src/process.bat Removed old process cleanup script.
src/OSS/OSSUpgradeSample/Program.cs Removed legacy OSS upgrade sample.
src/OSS/OSSUpgradeSample/OSSUpgradeSample.sln Removed legacy OSS upgrade solution.
src/OSS/OSSUpgradeSample/OSSUpgradeSample.csproj Removed legacy OSS upgrade project.
src/OSS/OSSUpgradeSample/build.bat Removed legacy OSS upgrade build script.
src/OSS/OSSUpgradeSample/.idea/.idea.OSSUpgradeSample/.idea/vcs.xml Removed IDE artifact.
src/OSS/OSSUpgradeSample/.idea/.idea.OSSUpgradeSample/.idea/indexLayout.xml Removed IDE artifact.
src/OSS/OSSUpgradeSample/.idea/.idea.OSSUpgradeSample/.idea/encodings.xml Removed IDE artifact.
src/OSS/OSSUpgradeSample/.idea/.idea.OSSUpgradeSample/.idea/.gitignore Removed IDE artifact.
src/OSS/OSSClientSample/Program.cs Removed legacy OSS client sample.
src/OSS/OSSClientSample/OSSClientSample.sln Removed legacy OSS client solution.
src/OSS/OSSClientSample/OSSClientSample.csproj Removed legacy OSS client project.
src/OSS/OSSClientSample/build.bat Removed legacy OSS client build script.
src/OSS/OSSClientSample/.idea/.idea.OSSClientSample/.idea/vcs.xml Removed IDE artifact.
src/OSS/OSSClientSample/.idea/.idea.OSSClientSample/.idea/indexLayout.xml Removed IDE artifact.
src/OSS/OSSClientSample/.idea/.idea.OSSClientSample/.idea/encodings.xml Removed IDE artifact.
src/OSS/.idea/.idea.OSSSample/.idea/vcs.xml Removed IDE artifact.
src/OSS/.idea/.idea.OSSSample/.idea/indexLayout.xml Removed IDE artifact.
src/OSS/.idea/.idea.OSSSample/.idea/encodings.xml Removed IDE artifact.
src/OSS/.idea/.idea.OSSSample/.idea/.name Removed IDE artifact.
src/OSS/.idea/.idea.OSSSample/.idea/.gitignore Removed IDE artifact.
src/oss_start.cmd Removed old OSS runner.
src/Hub/Samples/SilentUpdateSample.cs New Hub sample: silent polling mode.
src/Hub/Samples/PushSample.cs New Hub sample: SignalR push demo (self-hosted hub).
src/Hub/Samples/OssSample.cs New Hub sample: OSS-mode update demo.
src/Hub/Samples/ISample.cs New interface for Hub sample discovery.
src/Hub/Samples/ExtensionSample.cs New Hub sample: extension install/catalog demo.
src/Hub/Samples/DrivelutionSample.cs New Hub sample: driver validation/install/uninstall demo.
src/Hub/Samples/DifferentialSample.cs New Hub sample: diff clean/dirty/verify demo.
src/Hub/Samples/CompressSample.cs New Hub sample: compress/decompress/verify demo.
src/Hub/Samples/CompleteUpdateSample.cs New Hub sample: full update flow demo against local server.
src/Hub/Samples/BowlSample.cs New Hub sample: crash dump + diagnostics export demo.
src/Hub/Program.cs New Hub menu runner and server lifecycle management.
src/Hub/libs/Applications/Windows/export.bat New helper script: export driver/system/eventlog data.
src/Hub/libs/Applications/Linux/install.sh New helper script: install rpm/deb packages.
src/Hub/Hub.csproj New Hub project (NuGet vs local DLL toggle).
src/Hub/appsettings.json Hub default config (local server URL, IDs, app names).
src/Hub/AppConfig.cs Hub config model.
src/gen_packages.ps1 New script to generate test packages + versions.json.
src/Extension/ExtensionSample/ExtensionSample.sln Removed legacy Extension sample solution.
src/Extension/ExtensionSample/ExtensionSample.csproj Removed legacy Extension sample project.
src/Drivelution/DrivelutionSample/Program.cs Removed legacy Drivelution sample entrypoint.
src/Drivelution/DrivelutionSample/DrivelutionSample.sln Removed legacy Drivelution sample solution.
src/Drivelution/DrivelutionSample/DrivelutionSample.csproj Removed legacy Drivelution sample project.
src/dotnet10_scripts/upgrade.cs Removed legacy dotnet-script sample.
src/Diff/Program.cs Removed legacy diff sample entrypoint.
src/Diff/DiffSample.sln Removed legacy diff sample solution.
src/Diff/DiffSample.csproj Removed legacy diff sample project.
src/Diff/.idea/.idea.DiffSample/.idea/vcs.xml Removed IDE artifact.
src/Diff/.idea/.idea.DiffSample/.idea/indexLayout.xml Removed IDE artifact.
src/Diff/.idea/.idea.DiffSample/.idea/encodings.xml Removed IDE artifact.
src/Diff/.idea/.idea.DiffSample/.idea/.name Removed IDE artifact.
src/Diff/.idea/.idea.DiffSample/.idea/.gitignore Removed IDE artifact.
src/content_client/v2.0.0.0/new_feature.dat New sample payload content for package generation/tests.
src/content_client/v2.0.0.0/config/settings.ini New sample payload content.
src/content_client/v2.0.0.0/appdata.json New sample payload content.
src/content_client/v1.0.0.0/old_feature.dat New sample payload content.
src/content_client/v1.0.0.0/config/settings.ini New sample payload content.
src/content_client/v1.0.0.0/appdata.json New sample payload content.
src/Compress/CompressSample/Program.cs Removed legacy compress sample entrypoint.
src/Compress/CompressSample/CompressSample.sln Removed legacy compress sample solution.
src/Compress/CompressSample/CompressSample.csproj Removed legacy compress sample project.
src/Compress/CompressSample/.idea/.idea.CompressSample/.idea/vcs.xml Removed IDE artifact.
src/Compress/CompressSample/.idea/.idea.CompressSample/.idea/indexLayout.xml Removed IDE artifact.
src/Compress/CompressSample/.idea/.idea.CompressSample/.idea/encodings.xml Removed IDE artifact.
src/Compress/CompressSample/.idea/.idea.CompressSample/.idea/.gitignore Removed IDE artifact.
src/Client/Program.cs Removed legacy client sample entrypoint.
src/Client/ClientSample.sln Removed legacy client sample solution.
src/Client/ClientSample.csproj Removed legacy client sample project.
src/Client/build.bat Removed legacy client build script.
src/Client/.idea/.idea.ClientSample/.idea/vcs.xml Removed IDE artifact.
src/Client/.idea/.idea.ClientSample/.idea/indexLayout.xml Removed IDE artifact.
src/Client/.idea/.idea.ClientSample/.idea/avalonia.xml Removed IDE artifact.
src/Client/.idea/.idea.ClientSample/.idea/.name Removed IDE artifact.
src/Client/.idea/.idea.ClientSample/.idea/.gitignore Removed IDE artifact.
src/Bowl/BowlSample/Program.cs Removed legacy bowl sample entrypoint.
src/Bowl/BowlSample/BowlSample.sln Removed legacy bowl sample solution.
src/Bowl/BowlSample/BowlSample.csproj Removed legacy bowl sample project.
src/Bowl/BowlSample/.idea/.idea.BowlSample/.idea/vcs.xml Removed IDE artifact.
src/Bowl/BowlSample/.idea/.idea.BowlSample/.idea/indexLayout.xml Removed IDE artifact.
src/Bowl/BowlSample/.idea/.idea.BowlSample/.idea/encodings.xml Removed IDE artifact.
src/Bowl/BowlSample/.idea/.idea.BowlSample/.idea/.gitignore Removed IDE artifact.
global.json Pins .NET SDK version for the repo.
Directory.Build.props Sets repo-wide C# compiler defaults (nullable, implicit usings, langversion).
cmd.txt Removed legacy setup notes file.
Files not reviewed (41)
  • src/Bowl/BowlSample/.idea/.idea.BowlSample/.idea/.gitignore: Language not supported
  • src/Bowl/BowlSample/.idea/.idea.BowlSample/.idea/encodings.xml: Language not supported
  • src/Bowl/BowlSample/.idea/.idea.BowlSample/.idea/indexLayout.xml: Language not supported
  • src/Bowl/BowlSample/.idea/.idea.BowlSample/.idea/vcs.xml: Language not supported
  • src/Client/.idea/.idea.ClientSample/.idea/.gitignore: Language not supported
  • src/Client/.idea/.idea.ClientSample/.idea/.name: Language not supported
  • src/Client/.idea/.idea.ClientSample/.idea/avalonia.xml: Language not supported
  • src/Client/.idea/.idea.ClientSample/.idea/indexLayout.xml: Language not supported
  • src/Client/.idea/.idea.ClientSample/.idea/vcs.xml: Language not supported
  • src/Compress/CompressSample/.idea/.idea.CompressSample/.idea/.gitignore: Language not supported
  • src/Compress/CompressSample/.idea/.idea.CompressSample/.idea/encodings.xml: Language not supported
  • src/Compress/CompressSample/.idea/.idea.CompressSample/.idea/indexLayout.xml: Language not supported
  • src/Compress/CompressSample/.idea/.idea.CompressSample/.idea/vcs.xml: Language not supported
  • src/Diff/.idea/.idea.DiffSample/.idea/.gitignore: Language not supported
  • src/Diff/.idea/.idea.DiffSample/.idea/.name: Language not supported
  • src/Diff/.idea/.idea.DiffSample/.idea/encodings.xml: Language not supported
  • src/Diff/.idea/.idea.DiffSample/.idea/indexLayout.xml: Language not supported
  • src/Diff/.idea/.idea.DiffSample/.idea/vcs.xml: Language not supported
  • src/OSS/.idea/.idea.OSSSample/.idea/.gitignore: Language not supported
  • src/OSS/.idea/.idea.OSSSample/.idea/.name: Language not supported
  • src/OSS/.idea/.idea.OSSSample/.idea/encodings.xml: Language not supported
  • src/OSS/.idea/.idea.OSSSample/.idea/indexLayout.xml: Language not supported
  • src/OSS/.idea/.idea.OSSSample/.idea/vcs.xml: Language not supported
  • src/OSS/OSSClientSample/.idea/.idea.OSSClientSample/.idea/encodings.xml: Language not supported
  • src/OSS/OSSClientSample/.idea/.idea.OSSClientSample/.idea/indexLayout.xml: Language not supported
  • src/OSS/OSSClientSample/.idea/.idea.OSSClientSample/.idea/vcs.xml: Language not supported
  • src/OSS/OSSUpgradeSample/.idea/.idea.OSSUpgradeSample/.idea/.gitignore: Language not supported
  • src/OSS/OSSUpgradeSample/.idea/.idea.OSSUpgradeSample/.idea/encodings.xml: Language not supported
  • src/OSS/OSSUpgradeSample/.idea/.idea.OSSUpgradeSample/.idea/indexLayout.xml: Language not supported
  • src/OSS/OSSUpgradeSample/.idea/.idea.OSSUpgradeSample/.idea/vcs.xml: Language not supported
  • src/Push/.idea/.idea.PushSample/.idea/.gitignore: Language not supported
  • src/Push/.idea/.idea.PushSample/.idea/.name: Language not supported
  • src/Push/.idea/.idea.PushSample/.idea/encodings.xml: Language not supported
  • src/Push/.idea/.idea.PushSample/.idea/indexLayout.xml: Language not supported
  • src/Push/.idea/.idea.PushSample/.idea/vcs.xml: Language not supported
  • src/Upgrade/.idea/.idea.UpgradeSample/.idea/.gitignore: Language not supported
  • src/Upgrade/.idea/.idea.UpgradeSample/.idea/.name: Language not supported
  • src/Upgrade/.idea/.idea.UpgradeSample/.idea/avalonia.xml: Language not supported
  • src/Upgrade/.idea/.idea.UpgradeSample/.idea/indexLayout.xml: Language not supported
  • src/Upgrade/.idea/.idea.UpgradeSample/.idea/inspectionProfiles/Project_Default.xml: Language not supported
  • src/Upgrade/.idea/.idea.UpgradeSample/.idea/vcs.xml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3 to +12
# 获取脚本的实际名称
SCRIPT_NAME=$(basename "\$0")

# 检查是否提供了参数
if [ "$#" -ne 1 ]; then
echo "Usage: $SCRIPT_NAME <package-file>"
exit 1
fi

PACKAGE_FILE=\$1
Comment thread src/Hub/Program.cs Outdated
Comment on lines +71 to +77
if (!int.TryParse(line, out var index) || index < 1 || index > _samples.Count)
{
Console.WriteLine(" 无效选项,请重新选择");
continue;
}

await RunSampleAsync(_samples[index - 1]);
Comment thread src/Run.ps1 Outdated
# ── Optional: Rebuild component DLLs from source ──
if ($BuildLibs) {
Write-Host "[BuildLibs] Building components and copying DLLs..." -ForegroundColor Cyan
$sourceRoot = "C:\github code\GeneralUpdate\src\c#"
Comment thread src/gen_packages.ps1
PacketName = $PacketName
Hash = $hash
Version = $Version
Url = "$baseUrl`File/Download/$hash"
Comment thread src/gen_packages.ps1
Comment on lines +42 to +50
# Client v2.0.0.0 (AppType=1)
Write-Host "=== Client (AppType=1) ===" -ForegroundColor Green
$clientV2 = Join-Path $srcDir "content_client\v2.0.0.0"
New-Package -SourceDir $clientV2 -PacketName "packet_${timestamp}_full_client_2.0.0.0" -Version "2.0.0.0" -AppType 1

# Upgrade v2.0.0.0 (AppType=2)
Write-Host "=== Upgrade (AppType=2) ===" -ForegroundColor Green
$upgradeV2 = Join-Path $srcDir "content_upgrade\v2.0.0.0"
New-Package -SourceDir $upgradeV2 -PacketName "packet_${timestamp}_full_upgrade_2.0.0.0" -Version "2.0.0.0" -AppType 2
@@ -1,70 +1,104 @@
[
[
Comment on lines +134 to +135

### Data Flow
JusterZhu and others added 3 commits June 3, 2026 13:49
…nput conflict

- Program.cs: drain server stdout/stderr to prevent pipe buffer deadlock
  that blocked HTTP download request handling (~2 min timeout)
- CompleteUpdateSample: add UpdatePath to find Hub.exe in Both scenario,
  add MultiDownloadCompleted listener for success feedback
- SilentUpdateSample: wait for poll completion then call TryLaunchUpgrade,
  exit process after launch to prevent duplicate console input
- OssSample: use full UpdateRequest with UpdatePath+UpdateAppName so
  OssClient can locate Hub.exe in temp install directory
- libs: update GeneralUpdate.Core.dll with ClientStrategy launch banner
  and SilentPollOrchestrator improved log message

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Remove non-existent ClientSample.sln and UpgradeSample.sln references
- Add .NET 10 SDK setup for Hub project (net10.0)
- Build ServerSample.sln with .NET 8
- Build Hub with UseNuGet=true (local DLLs not available in CI)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Program.cs: find sample by ISample.Index instead of array position
  to handle non-contiguous indices correctly
- Run.ps1: replace hard-coded GeneralUpdate source path with
  auto-detect sibling repo + -GeneralUpdateSrc parameter
- dotnet.yml: remove Hub build from CI (NuGet packages not synced
  with latest source), ServerSample build only for now

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@JusterZhu JusterZhu merged commit a253ff7 into main Jun 3, 2026
1 check passed
@JusterZhu JusterZhu deleted the feature/unified-sample-hub branch June 3, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants