Skip to main content

🎨 GeneralUpdate Update UI Guide

If your app needs to show users the update progress (instead of silently updating in the background), this page will help you generate the right UI code.


First: What each program displays​

GeneralUpdate uses a dual-process architecture, and each process shows a different UI:

Your main program (Client)
Shows "Checking for updates β†’ Download progress"
User sees: Downloading 45% / Speed / Time remaining

↓ After download completes, launches ↓

Upgrade program (Upgrade)
Shows "Installing update, please wait..."
User sees: Installation progress bar / Failure message

Client: Handles downloading β€” show a progress bar, speed, version info Upgrade: Handles file installation (fast) β€” just show a "please wait" screen


Which situation are you in?​

SituationWhat to do
Already have a main app, need to add an update windowAdd an update window to your existing project (this page will help)
Starting from scratchFirst use generalupdate-init to set up the dual-project structure, then come back for the UI
No UI needed (silent update)Go to generalupdate-strategy for silent mode

Supported UI frameworks​

FrameworkTemplate fileHighlights
WPF + LayUI.WpfLayUIStyle.xamlGlass-effect progress bar
WPF + WPFDevelopersWPFDevelopersStyle.xamlCircular progress, breathing animation
Avalonia + SemiUrsaSemiUrsaClientView.axamlCross-platform, dark mode toggle
WinForms + AntdUIAntdUIStyle.csDark theme
MAUIMauiUpdatePage.xamlMobile + desktop

The update logic is the same across all frameworks β€” only the visual style changes.


The 4 key UI states​

An update window is essentially a state machine with 4 main states:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β‘  Checking β”‚
β”‚ "Checking for updates..." β”‚
β”‚ β”‚ β”‚
β”‚ β–Ό β”‚
β”‚ β‘‘ Downloading (the main state) β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ MyApp_2.0.0.0.zip 45% β”‚ β”‚
β”‚ β”‚ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β”‚ β”‚
β”‚ β”‚ Speed: 3.2 MB/s Remaining: 12s β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚
β”‚ β–Ό β”‚
β”‚ β‘’ Installing β”‚
β”‚ "Installing update, please do not power off..." β”‚
β”‚ β”‚ β”‚
β”‚ β–Ό β”‚
β”‚ β‘£ Complete / Failed β”‚
β”‚ "Update complete!" / "Download failed, retry" β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

There are additional sub-states ("Already up to date", "Paused", "Retrying"), but beginners only need to focus on β‘  and β‘‘.


How to connect update progress to your UI​

GeneralUpdate fires events with progress data β€” you just map the numbers to your UI controls:

// GeneralUpdate progress event β†’ update your UI
bootstrap.AddListenerMultiDownloadStatistics((_, e) =>
{
// e.ProgressPercentage β†’ your progress bar Value (0-100)
// e.Speed β†’ your speed label
// e.Remaining β†’ your time remaining label
// e.BytesReceived β†’ bytes downloaded
// e.TotalBytesToReceive β†’ total bytes to download
});

That's it. The core work is mapping these 5 values to your UI controls.


Info to gather before generating UI​

### Your project
- UI framework: ______ (WPF / WinForms / Avalonia / MAUI / Console)
- Need dark mode: ______ (Yes/No)

### Update window role (see "First" section above)
- Client (main app): ______ (need to show download progress?)
- Upgrade (installer): ______ (need to show installation status?)

Simple example: Console progress bar​

Even without a GUI, a console progress bar is easy:

await new GeneralUpdateBootstrap()
.SetConfig(config)
.AddListenerMultiDownloadStatistics((_, e) =>
{
Console.Write($"\rDownload progress: {e.ProgressPercentage}% ");
Console.Write($"[{new string('β– ', (int)(e.ProgressPercentage / 5))}");
Console.WriteLine($"{new string('β–‘', 20 - (int)(e.ProgressPercentage / 5))}]");
Console.Write($"Speed: {e.Speed}/s");
})
.LaunchAsync();

Known issues & tips​

#IssueNote
1Don't do heavy work in update callbacksOnly update UI β€” no file I/O or network requests
2Cross-thread UI updatesWPF: Dispatcher.Invoke, WinForms: Control.Invoke
3Upgrade doesn't need download progressUpgrade just installs β€” show "Please wait"
4Show a retry button on failureOtherwise users get stuck at 99%
5Don't jump progress to 100% instantlyUsers need to see intermediate progress

Advanced: Full-state UI templates​

If you need a complete UI (pause, resume, retry, dark mode toggle, etc.), the skill repository provides full template code.

To generate: describe your UI framework in Claude Code, and the AI will select and generate the appropriate template.