π GeneralUpdate Integration Complete Guide
Helps developers integrate GeneralUpdate auto-update into any .NET application from scratch, covering all configuration methods, deployment scenarios, and production considerations.
β οΈ Targeting NuGet v10.4.6 stable. Dev branch (v10.5.0-beta.2) has different APIs.
Workflowβ
1. Project Detection
βββ Check .csproj β target framework, UI type
βββ Check existing configuration β NuGet installed? Existing manifest?
2. Select Integration Mode
βββ [Minimal] (new Configinfo + SetConfig + LaunchAsync) β recommended for new users
βββ [Standard] (Configinfo + event listeners) β fine control
βββ [Scaffold] (full dual-project structure) β team projects from scratch
3. Generate Output
βββ NuGet installation commands
βββ Bootstrap configuration code
βββ manifest.json template
βββ Deployment checklist
4. Next Steps
βββ Need UI β generalupdate-ui
βββ Choose strategy β generalupdate-strategy
βββ Having issues β generalupdate-troubleshoot
Core Concept: 4 Update Scenesβ
| Scene | Behavior |
|---|---|
| None | No update needed, launch main app directly |
| UpgradeOnly | Only update the upgrade app itself |
| MainOnly | Only update the main app |
| Both | Update both |
Dual-Process Architectureβ
App.exe (Client) is responsible for:
βββ Version verification (HTTP request to server)
βββ Downloading all update packages
βββ IPC write (encrypted file to pass parameters to Upgrade)
βββ Launching Upgrade.exe then exiting
Upgrade.exe (Upgrade process) is responsible for:
βββ Reading the IPC file
βββ Applying the update (extract/patch/replace files)
βββ Launching the main app then exiting
Configinfo Referenceβ
Complete Configinfo Propertiesβ
var config = new Configinfo
{
// === Required ===
UpdateUrl = "https://your-server.com/Upgrade/Verification",
AppSecretKey = "your-secret-key",
AppName = "MyApp.exe",
MainAppName = "MyApp.exe",
ClientVersion = "1.0.0.0",
ProductId = "my-product-001",
InstallPath = ".",
// === Optional ===
ReportUrl = "https://your-server.com/Upgrade/Report",
UpdateLogUrl = "https://your-server.com/Upgrade/Log",
UpgradeClientVersion = "1.0.0.0",
// === Authentication ===
Scheme = "Bearer",
Token = "your-token",
// === Blacklist (excluded from backup/copy) ===
BlackFiles = new List<string> { "*.log", "*.tmp" },
BlackFormats = new List<string> { ".pdb" },
SkipDirectorys = new List<string> { "logs", "cache" },
};
Event Listener Checklistβ
// All 6 events
.AddListenerUpdateInfo((_, e) => {
/* Version verification results */
})
.AddListenerMultiDownloadStatistics((_, e) => {
/* Batch download progress */
})
.AddListenerMultiDownloadCompleted((_, e) => {
/* Per-version download complete */
})
.AddListenerMultiDownloadError((_, e) => {
/* Download error */
})
.AddListenerMultiAllDownloadCompleted((_, e) => {
/* All downloads complete */
})
.AddListenerException((_, e) => {
/* Exception handler */
})
Integration Codeβ
Minimal Integrationβ
using GeneralUpdate.Core;
using GeneralUpdate.Common.Shared.Object;
var config = new Configinfo
{
UpdateUrl = "https://your-server.com/api",
AppSecretKey = "your-32-char-secret-key-here!",
AppName = "MyApp.exe",
MainAppName = "MyApp.exe",
ClientVersion = "1.0.0.0",
ProductId = "my-product-001",
InstallPath = "."
};
await new GeneralUpdateBootstrap()
.SetConfig(config)
.LaunchAsync();
Upgrade Process Configurationβ
using GeneralUpdate.Core;
// Upgrade mode reads config from IPC file, no SetConfig needed
await new GeneralUpdateBootstrap()
.AddListenerException((_, e) =>
Console.WriteLine($"Error: {e.Message}"))
.LaunchAsync();
Production Deployment Checklistβ
Directory Structureβ
publish/
βββ MyApp.exe β MainAppName (main program)
βββ generalupdate.manifest.json
βββ update/
βββ UpgradeApp.exe β Upgrade program, must ship with first release
Dual-Process Verificationβ
| Check | Description |
|---|---|
| UpgradeApp.exe exists in publish directory | Must be present from first release |
| Client and Upgrade use same AppSecretKey | Required for IPC encrypted communication |
| Client and Upgrade use same NuGet version | Mismatch causes "Method not found" |
| Upgrade process doesn't need network | All data pre-downloaded by Client |
β οΈ Known Issuesβ
NuGet Type Conflictsβ
GeneralUpdate.Core and GeneralUpdate.Bowl cannot be referenced together (CS0433 type conflicts).
Choose based on requirements:
- Using Core:
dotnet add package GeneralUpdate.Core - Using Bowl: only reference
GeneralUpdate.Bowl(transitively includes all Core functionality) - Differential types are embedded in Core, no need for separate
GeneralUpdate.Differentialpackage