Skip to content

Silent update: ProcessExit not firing, manifest identity fields blocked by defaults #484

Description

@JusterZhu

Describe the bug

Three bugs discovered during silent update end-to-end testing:

1. Manifest identity fields blocked by non-empty defaults (critical)

AppMetadataDiscoverer.Discover() only fills empty fields from generalupdate.manifest.json. But UpdateConfiguration has non-empty defaults for critical identity fields:

  • MainAppName defaults to "Client"
  • UpdateAppName defaults to "Update.exe"
  • ClientVersion defaults to "1.0.0.0"

These defaults block manifest overrides, causing:

  • Endless update loop: WriteBackClientVersion writes "2.0.0.0" to manifest after upgrade. On restart, Discover() skips ClientVersion (not empty, default "1.0.0.0" present), so the client re-checks with "1.0.0.0" → finds v2.0.0.0 again → downloads again → infinite loop.
  • Can't find main app: Manifest says "ClientTest.exe" but default "Client" takes precedence.
  • Can't launch upgrade: Manifest says "UpgradeTest.exe" but default "Update.exe" takes precedence.

2. ProcessExit doesn't fire in console apps

AppDomain.ProcessExit does not fire reliably when a console app is terminated via Ctrl+C. The silent update orchestrator registers OnProcessExit to launch the upgrade process, but the handler is never called.

3. Missing /Upgrade/Report server route

The server registers /Update/Report but not /Upgrade/Report, while /Upgrade/Verification and /Update/Verification both exist. This causes 404 errors during status reporting.

To Reproduce

  1. Start the sample server
  2. Run ClientTest with .SetOption(Option.Silent, true)
  3. Wait for update to be prepared
  4. Press Ctrl+C to exit
  5. Observe that UpgradeTest.exe is never launched
  6. Manually restart → observe endless update loop

Expected behavior

  1. Manifest values for identity fields should always take precedence over code defaults
  2. Upgrade process should launch reliably when process exits
  3. Server should respond to both /Upgrade/Report and /Update/Report

Fix

See PR #483

Metadata

Metadata

Assignees

Labels

fixFix some existing issues

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions