Skip to main content

πŸš€ 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​

SceneBehavior
NoneNo update needed, launch main app directly
UpgradeOnlyOnly update the upgrade app itself
MainOnlyOnly update the main app
BothUpdate 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​

CheckDescription
UpgradeApp.exe exists in publish directoryMust be present from first release
Client and Upgrade use same AppSecretKeyRequired for IPC encrypted communication
Client and Upgrade use same NuGet versionMismatch causes "Method not found"
Upgrade process doesn't need networkAll 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.Differential package