GeneralUpdate-Samples
June 4, 2026 ยท View on GitHub
GeneralUpdate-Samples
Usage Examples and Quick Start Repository for GeneralUpdate
๐ Table of Contents
- Overview
- Key Features
- Repository Structure
- Quick Start
- Interactive Sample Browser
- Sample Catalog
- UI Framework Samples
- Related Repositories
- Documentation
- Requirements
- Contributing
- Support
- License
๐ Overview
GeneralUpdate-Samples is the official sample repository for the GeneralUpdate project, an Apache 2.0 licensed, cross-platform application automatic update component built on .NET. This repository provides a unified interactive sample browser (Hub) that lets you explore and test every major feature through a clean console menu โ no manual project setup required.
GeneralUpdate supports a wide range of update mechanisms:
- โ Resume Download
- โ Version-by-Version Update
- โ Binary Differential Update
- โ Incremental Update
- โ Forced Update
- โ Multi-Branch Update
- โ OSS (Object Storage Service) Updates
- โ Rollback and Backup
- โ AOT (Ahead-of-Time) Compilation Support
- โ Driver Update (via Drivelution)
๐ฏ Key Features
This repository provides self-contained, runnable samples for all major features of GeneralUpdate:
| Feature | Sample | Description |
|---|---|---|
| Full Update | CompleteUpdateSample | Version discovery โ download โ apply. The classic client-server upgrade flow |
| Silent Update | SilentUpdateSample | Background polling with pre-exit preparation for zero-user-interaction upgrades |
| OSS Update | OssSample | Simplified update using a file server and versions.json โ no server-side app needed |
| Binary Differential | DifferentialSample | Generate and apply binary patches between versions to minimize download size |
| Push Notification | PushSample | Real-time update notifications powered by SignalR |
| Process Guardian | BowlSample | Crash detection, dump file export, and automatic recovery |
| Plugin System | ExtensionSample | Custom plugin installation, management, and compatibility checking |
| Driver Update | ImDiskQuickInstallSample | Driver package installation and update using ImDisk |
| Compression | CompressSample | Format-agnostic compression, decompression, and integrity verification |
๐ Repository Structure
GeneralUpdate-Samples/
โโโ src/ # Source code and samples
โ โโโ Hub/ # Interactive sample browser (main entry point)
โ โ โโโ Program.cs # Menu loop, server lifecycle, sample discovery
โ โ โโโ AppConfig.cs # Configuration model (appsettings.json)
โ โ โโโ Samples/ # Individual sample implementations
โ โ โโโ ISample.cs # Sample interface (auto-discovered by Hub)
โ โ โโโ CompleteUpdateSample.cs
โ โ โโโ SilentUpdateSample.cs
โ โ โโโ OssSample.cs
โ โ โโโ DifferentialSample.cs
โ โ โโโ PushSample.cs
โ โ โโโ BowlSample.cs
โ โ โโโ ExtensionSample.cs
โ โ โโโ ImDiskQuickInstallSample.cs
โ โ โโโ CompressSample.cs
โ โโโ Server/ # Minimal API server for update delivery
โ โ โโโ Program.cs # Verification, report & file download endpoints
โ โ โโโ DTOs/ # Request/response data transfer objects
โ โ โโโ wwwroot/packages/ # Update package storage
โ โโโ content/ # Intermediate version content (v1.0.0.1, v1.0.0.2)
โ โโโ content_client/ # Client app base content (v1.0.0.0, v2.0.0.0)
โ โโโ content_upgrade/ # Upgrade app base content (v1.0.0.0, v2.0.0.0)
โ โโโ ImDiskDriver/ # ImDisk driver binaries (for driver update demo)
โ โโโ gen_packages.ps1 # Script to generate test update packages
โ โโโ Run.cmd # Windows launcher (double-click to start)
โ โโโ Run.ps1 # PowerShell launcher with -BuildLibs support
โ โโโ GeneralUpdate-Samples.slnx # Solution file (new .slnx format)
โโโ UI/ # UI framework integration samples
โ โโโ AntdUI/ # AntdUI framework sample (WinForms)
โ โโโ LayUI/ # LayUI framework sample (WPF)
โ โโโ SemiUrsa/ # Semi Ursa sample (Avalonia, cross-platform)
โ โโโ WPFDevelopers/ # WPF with custom developer controls
โโโ website/ # Official website source (Docusaurus)
โโโ .github/workflows/ # CI/CD pipelines
โ โโโ dotnet.yml # .NET build workflow
โ โโโ az-swa-deploy.yml # Azure Static Web App deployment (docs site)
โโโ imgs/ # Documentation images
โโโ global.json # .NET SDK version pinning
โโโ Directory.Build.props # Shared MSBuild properties
โโโ LICENSE # Apache 2.0 License
โโโ README.md # This file
๐ Quick Start
Prerequisites
- .NET 10.0 SDK or later
- Windows, Linux, or macOS (Windows recommended for driver and UI samples)
One-Click Launch
-
Clone the repository
git clone https://github.com/GeneralLibrary/GeneralUpdate-Samples.git cd GeneralUpdate-Samples/src -
Run the interactive sample browser
On Windows (double-click or terminal):
Run.cmdOn any platform (PowerShell):
.\Run.ps1For contributors who need to rebuild component DLLs from source:
.\Run.ps1 -BuildLibs -
What happens next:
- The Hub builds and starts the Server automatically
- An interactive menu appears with numbered samples
- Select a sample by number to run it
- The Hub manages server lifecycle: starts before each server-dependent sample, stops afterward
- Type
0orqto exit
Generating Test Packages
Before running update-dependent samples for the first time, generate test packages:
cd src
.\gen_packages.ps1
This creates update packages in src/Server/wwwroot/packages/ with a versions.json manifest.
๐ฅ๏ธ Interactive Sample Browser
The Hub (src/Hub/) is the central entry point. Instead of launching separate projects manually, you interact with a single console menu:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ GeneralUpdate ็คบไพๆต่งๅจ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1. ๅฎๆดๆดๆฐ โ ็ๆฌๅ็ฐโไธ่ฝฝโๅบ็จ
2. ้้ปๆดๆฐ โ ๅๅฐ่ฝฎ่ฏขยท้ๅบๅๅๅค
3. OSS ๆจกๅผ โ ๅฏน่ฑกๅญๅจๆดๆฐ
4. ไบ่ฟๅถๅทฎๅ โ ็ๆยทๅบ็จยทๆ ก้ช
5. SignalR ๆจ้ โ ๅฎๆถๆถๆฏๆฅๆถ
6. ่ฟ็จๅฎๆค โ ๅดฉๆบ็ๆงยทDumpๅฏผๅบ
7. ๆไปถ็ณป็ป โ ๅฎ่ฃ
ยท็ฎก็ยทๅ
ผๅฎนๆง
8. Driver Update
9. ๅ็ผฉๅทฅๅ
ท โ ๅ็ผฉยท่งฃๅยทๆ ก้ช
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
0. ้ๅบ (Exit)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Architecture
- Samples implement
ISampleand are auto-discovered via reflection โ no wiring needed - Server lifecycle is automatic:
RequiresServer = truesamples get an isolated Server process started/stopped on demand - Clean paths are reset before each run, ensuring reproducible demos
- Configuration is centralized in
src/Hub/appsettings.json
Key Code (CompleteUpdateSample)
var request = new UpdateRequest
{
UpdateUrl = $"{config.ServerUrl}/Upgrade/Verification",
ReportUrl = $"{config.ServerUrl}/Upgrade/Report",
AppSecretKey = config.AppSecretKey,
InstallPath = mockAppDir,
ClientVersion = config.ClientVersion,
MainAppName = config.MainAppName,
ProductId = config.ProductId
};
var bootstrap = new GeneralUpdateBootstrap()
.SetConfig(request)
.SetOption(Option.AppType, AppType.Client)
.AddListenerUpdateInfo((_, e) => { /* handle version discovery */ })
.AddListenerMultiDownloadStatistics((_, e) => { /* handle progress */ })
.AddListenerMultiDownloadCompleted((_, e) => { /* handle completion */ })
.AddListenerException((_, e) => { /* handle errors */ });
await bootstrap.LaunchAsync();
๐ฆ Sample Catalog
| # | Sample | Requires Server | What It Demonstrates |
|---|---|---|---|
| 1 | Full Update | โ | Complete update pipeline: version check โ download โ apply. Simulates a v1.0.0.0 app upgrading to v2.0.0.0 with file additions, modifications, and deletions |
| 2 | Silent Update | โ | Background polling with configurable intervals. Polls for updates without user interaction, prepares on app exit |
| 3 | OSS Update | โ | Object storage update mode using versions.json on a file server. Supports AOT compilation scenarios |
| 4 | Binary Differential | โ | Patch generation between two version folders. Identifies changed, new, and deleted files. Validates patch application with SHA256 |
| 5 | SignalR Push | โ | Real-time update push via a self-hosted SignalR Hub. Demonstrates client-server messaging for instant update notifications |
| 6 | Process Guardian | โ | Bowl integration: crash monitoring, automatic dump file export, system information collection, and driver enumeration |
| 7 | Plugin System | โ | Extension plugin installation lifecycle: download โ extract โ validate โ install. Demonstrates compatibility checking and plugin management |
| 8 | Driver Update | โ | ImDisk virtual disk driver installation. Demonstrates GeneralUpdate.Drivelution for driver package deployment |
| 9 | Compression | โ | Format-agnostic compression and decompression. Tests data integrity with random content verification across all supported compression formats |
๐จ UI Framework Samples
The UI/ directory contains integration examples for popular UI frameworks:
| Framework | Path | Type | Platform |
|---|---|---|---|
| AntdUI | UI/AntdUI/Upgrade/ | WinForms with modern Ant Design components | Windows |
| LayUI | UI/LayUI/Upgrade/ | WPF with LayUI styling | Windows |
| SemiUrsa | UI/SemiUrsa/ | Avalonia with Semi design system | Cross-platform |
| WPFDevelopers | UI/WPFDevelopers/Upgrade/ | WPF with custom developer controls | Windows |
Each UI sample demonstrates how to integrate GeneralUpdate's upgrade workflow with specific UI frameworks and design patterns.
๐ Related Repositories
The GeneralUpdate ecosystem consists of multiple repositories:
| Repository | Description | Links |
|---|---|---|
| GeneralUpdate | Core automatic update component | GitHub โข Gitee โข GitCode |
| GeneralUpdate.Maui | MAUI updates (Android platform) | GitHub โข Gitee |
| GeneralUpdate.Tools | Patch creation and packaging tools | GitHub โข Gitee |
| GeneralUpdate-Samples | Usage examples (this repository) | GitHub โข Gitee |
๐ Documentation
Official Documentation
- ๐ Official Website: https://www.justerzhu.cn/
- ๐ Quick Start Guide: https://www.justerzhu.cn/docs/quickstart/quickstart
- ๐ฅ Video Tutorial: Bilibili
Documentation in this Repository
The website/ directory contains the full documentation source built with Docusaurus:
cd website
# Install dependencies
npm install
# Start local development server
npm run start
# Build for production
npm run build
Documentation Structure:
website/docs/doc/- Component documentationwebsite/docs/quickstart/- Quick start guideswebsite/docs/guide/- Advanced guideswebsite/docs/releaselog/- Release noteswebsite/i18n/- Internationalization (English, Chinese)
๐ป Requirements
Runtime Requirements
- .NET 10.0 Runtime or later
- Operating Systems: Windows, Linux, macOS, Android (with MAUI)
- Supported Platforms: x64, ARM64, LoongArch
Supported Frameworks
- .NET 8.0+
- .NET Framework 4.6.1+
Supported UI Frameworks
- WPF (Windows Presentation Foundation)
- WinForms (Windows Forms)
- Avalonia (Cross-platform)
- MAUI (Android)
- WinUI 3
- Console Applications
Tested Operating Systems
- โ Windows 10/11
- โ Windows Server 2016+
- โ Linux (Ubuntu, Debian, CentOS)
- โ macOS (including M1/M2)
- โ Android (via MAUI)
- โ Kylin V10 (ARM and x64)
- โ UOS (Union Operating System)
- โ Huawei EulerOS
- โ Loongson (LoongArch)
๐ค Contributing
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch
git checkout -b feature/your-feature-name - Commit your changes
git commit -am 'Add some feature' - Push to the branch
git push origin feature/your-feature-name - Open a Pull Request
Guidelines
- Add new samples by implementing
ISample(seesrc/Hub/Samples/ISample.cs) - Give your sample a unique
Indexnumber and descriptiveName - Set
RequiresServerappropriately - Specify
CleanPathsto ensure reproducible runs - Follow existing code style and patterns
- Update documentation as needed
๐ฌ Support
Free Support
- ๐ Issues: GitHub Issues
- ๐ฌ Discussion Group: QQ Group 748744489 (GeneralUpdate Discussion)
- ๐ ๏ธ Technical Exchange: QQ Group 341349660 (.NET Technical Exchange)
Contact
- ๐ง Email: zhuzhen723723@outlook.com
- ๐ Official Website: https://www.justerzhu.cn/
Commercial Support
For customized development, technical consultation, or sponsorship opportunities, please contact the author via email or official website.
๐ License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Copyright 2025 Juster Zhu
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
๐ Acknowledgments
Special thanks to all contributors and the community for their support and contributions to the GeneralUpdate project.
Project Maintainer
- Juster Zhu - Initial work and maintenance - GitHub
โญ If you find this project useful, please consider giving it a star! โญ
Updates limitless, upgrades boundless.