Usage Examples and Quick Start Repository for GeneralUpdate
- Overview
- Key Features
- Repository Structure
- Quick Start
- Sample Projects
- UI Framework Samples
- Related Repositories
- Documentation
- Requirements
- Contributing
- Support
- License
GeneralUpdate-Samples is the official sample repository for the GeneralUpdate project, which is an open-source cross-platform application automatic update component based on .NET Standard 2.0. This repository provides comprehensive code examples, demonstrations, and quick start guides to help developers understand and integrate automatic update functionality into their applications.
GeneralUpdate supports various update mechanisms including:
- β 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
This repository provides working examples for all major features of GeneralUpdate:
| Feature | Description | Sample Location |
|---|---|---|
| Standard Update | Traditional client-server update mechanism | src/Client, src/Server, src/Upgrade |
| OSS Update | Simplified update using file server and version.json | src/OSS |
| Differential Update | Binary patch generation and application | src/Diff |
| Process Monitoring | Crash detection and diagnostic information export | src/Bowl |
| Push Updates | Real-time update notifications using SignalR | src/Push |
| Compression | Compression capability testing and debugging | src/Compress |
| Driver Update | Driver package update capabilities | src/Drivelution |
| Extension | Custom extension development examples | src/Extension |
GeneralUpdate-Samples/
βββ src/ # Source code and samples
β βββ Client/ # Main client application sample
β βββ Server/ # Server application (Minimal API)
β βββ Upgrade/ # Upgrade assistant sample
β βββ OSS/ # OSS update samples
β β βββ OSSClientSample/ # OSS client sample
β β βββ OSSUpgradeSample/ # OSS upgrade sample
β βββ Bowl/ # Process crash monitoring sample
β βββ Diff/ # Differential patch generation sample
β βββ Compress/ # Compression capability sample
β βββ Push/ # Update push notification sample
β βββ Drivelution/ # Driver update sample
β βββ Extension/ # Extension development sample
β βββ start.cmd # Standard update demo launcher
β βββ oss_start.cmd # OSS update demo launcher
βββ UI/ # UI framework integration samples
β βββ AntdUI/ # AntdUI framework sample
β βββ LayUI/ # LayUI framework sample
β βββ SemiUrsa/ # Semi Ursa (Avalonia) sample
β βββ WPFDevelopers/ # WPF framework sample
βββ website/ # Official website source code (Docusaurus)
βββ imgs/ # Documentation images
βββ LICENSE # Apache 2.0 License
βββ README.md # This file
- .NET 8.0 SDK or later
- Windows OS (for .cmd scripts) or cross-platform support with .NET
-
Clone the repository
git clone https://github.com/GeneralLibrary/GeneralUpdate-Samples.git cd GeneralUpdate-Samples/src -
Run the standard update demo
start.cmd
This script will:
- Build the Client, Server, and Upgrade projects
- Copy compiled files to the
rundirectory - Start the Server application
- Start the Client application
- Automatically trigger the update process
-
Verify the update
- The Client will detect available updates from the Server
- Download and apply the update package
- Restart automatically after update completion
- Check for the new file
Congratulations on the update.txtin the run directory
For a simplified update mechanism without server-side code:
cd src
oss_start.cmdThis demonstrates OSS-based updates using only a version.json configuration file on a file server.
Demonstrates the main application that requires updating. Key features:
- Version detection and verification
- Update package download with progress tracking
- Event-based notification system
- Automatic restart after update
Key Code:
var configinfo = new Configinfo
{
UpdateUrl = "http://127.0.0.1:5000/Upgrade/Verification",
MainAppName = "ClientSample.exe",
ClientVersion = "1.0.0.0",
ProductId = "2d974e2a-31e6-4887-9bb1-b4689e98c77a"
};
await new GeneralClientBootstrap()
.AddListenerMultiDownloadStatistics(OnMultiDownloadStatistics)
.AddListenerMultiDownloadCompleted(OnMultiDownloadCompleted)
.AddListenerException(OnException)
.SetConfig(configinfo)
.LaunchAsync();Minimal API server providing update information and package distribution:
- Version verification endpoint
- Update package download endpoint
- Update status reporting
Key Code:
app.MapPost("/Upgrade/Verification", (VerifyDTO request) =>
{
var result = new List<VerificationResultDTO>
{
new VerificationResultDTO
{
Version = "1.0.0.1",
Url = "http://localhost:5000/packages/packet.zip",
Hash = "...",
Size = packet.Length
}
};
return HttpResponseDTO<IEnumerable<VerificationResultDTO>>.Success(result);
});Independent upgrade process that updates the main application:
- Downloads update packages
- Applies updates while main app is closed
- Restarts main application after update
- Provides rollback capability on failure
Simplified update mechanism:
- No server-side code required
- Uses
version.jsonconfiguration on file server - Direct file server integration (Alibaba Cloud OSS, AWS S3, etc.)
- Supports AOT compilation
version.json Example:
[
{
"PacketName": "packet_20250102230201638_1.0.0.1",
"Hash": "ad1a85a9169ca0083ab54ba390e085c56b9059efc3ca8aa1ec9ed857683cc4b1",
"Version": "1.0.0.1",
"Url": "http://localhost:5000/packages/packet_20250102230201638_1.0.0.1.zip"
}
]Process crash monitoring and diagnostic information export:
- Monitors main application health
- Captures crash dump files
- Exports system information
- Provides automatic rollback on crash
Exports on Crash:
- π Dump file (.dmp)
- π Version information (.json)
- π Driver information (driverInfo.txt)
- π System information (systeminfo.txt)
- π Event logs (systemlog.evtx)
Binary differential update implementation:
- Generates differential patches between versions
- Identifies changed, new, and deleted files
- Supports blacklist for excluded files
- Reduces update package size significantly
Real-time update notification using SignalR:
- Push latest version information to clients
- Immediate update notifications
- Supports forced update triggers
The UI/ directory contains integration examples for various UI frameworks:
| Framework | Path | Description |
|---|---|---|
| AntdUI | UI/AntdUI |
Modern UI components for Windows Forms |
| LayUI | UI/LayUI |
WPF UI framework integration |
| SemiUrsa | UI/SemiUrsa |
Avalonia UI framework (cross-platform) |
| WPFDevelopers | UI/WPFDevelopers |
WPF with custom controls |
Each UI sample demonstrates how to integrate GeneralUpdate with specific UI frameworks and design patterns.
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 |
- π Official Website: https://www.justerzhu.cn/
- π Quick Start Guide: https://www.justerzhu.cn/docs/quickstart/quickstart
- π₯ Video Tutorial: Bilibili
The website/ directory contains the full documentation source built with Docusaurus:
Building the Documentation Website:
cd website
# Install dependencies
npm install
# Start local development server
npm run start
# Build for production
npm run buildDocumentation Structure:
website/docs/doc/- Component documentationwebsite/docs/quickstart/- Quick start guideswebsite/docs/guide/- Advanced guideswebsite/docs/releaselog/- Release noteswebsite/i18n/- Internationalization (English, Chinese)
- .NET 8.0 Runtime or later
- Operating Systems: Windows, Linux, macOS, Android (with MAUI)
- Supported Platforms: x64, ARM64, LoongArch
- .NET Core 2.0+
- .NET 5, 6, 7, 8+
- .NET Framework 4.6.1+
- WPF (Windows Presentation Foundation)
- WinForms (Windows Forms)
- Avalonia (Cross-platform)
- MAUI (Android)
- WinUI 3
- Console Applications
- β 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)
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
- Follow existing code style and patterns
- Add samples for new features
- Update documentation as needed
- Test your changes thoroughly
- π Issues: GitHub Issues
- π¬ Discussion Group: QQ Group 748744489 (GeneralUpdate Discussion)
- π οΈ Technical Exchange: QQ Group 341349660 (.NET Technical Exchange)
- π§ Email: [email protected]
- π Official Website: https://www.justerzhu.cn/
For customized development, technical consultation, or sponsorship opportunities, please contact the author via email or official website.
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.
Special thanks to all contributors and the community for their support and contributions to the GeneralUpdate project.
- Juster Zhu - Initial work and maintenance - GitHub
β If you find this project useful, please consider giving it a star! β
Updates limitless, upgrades boundless.