fix: silent update - manifest identity fields and upgrade process launch#483
Merged
Conversation
Three fixes for the silent update flow:
1. AppMetadataDiscoverer: MainAppName, UpdateAppName, UpdatePath, ClientVersion
now unconditionally take manifest values. Previously these fields had defaults
('Client', 'Update.exe', null, '1.0.0.0') that blocked manifest overrides,
causing: wrong executable names, endless update loops after version write-back.
2. SilentPollOrchestrator: add TryLaunchUpgrade() and HasPreparedUpdate for
explicit upgrade process launch. AppDomain.ProcessExit does not fire reliably
in console apps (Ctrl+C), so callers can now trigger the launch explicitly.
3. GeneralUpdateBootstrap: expose SilentOrchestrator property so callers can
access the orchestrator to call TryLaunchUpgrade().
Test infrastructure:
- ClientTest: enable silent mode, keep-alive loop, explicit launch on exit
- ClientTest.csproj: copy manifest + UpgradeTest output for test environment
- generalupdate.manifest.json: sample identity manifest for ClientTest
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three fixes for the silent update flow discovered during end-to-end testing.
1. AppMetadataDiscoverer: manifest identity fields now take precedence over defaults
Problem:
MainAppName,UpdateAppName,UpdatePath,ClientVersionhave non-empty defaults ("Client","Update.exe",null,"1.0.0.0") inUpdateConfiguration. The oldDiscover()logic only filled empty fields from the manifest, so these defaults blocked manifest values. This caused three bugs:WriteBackClientVersionupdates the manifest to v2.0.0.0, the default"1.0.0.0"blocks it from being read back on restart → client re-downloads the same update forever"Client"blocks manifest's"ClientTest.exe"→ upgrade process can't restart the application"Update.exe"blocks manifest's"UpgradeTest.exe"Fix: These four identity fields now unconditionally take manifest values when the manifest has them. The defaults are mere fallbacks, not explicit user choices.
2. SilentPollOrchestrator: explicit upgrade launch for console apps
Problem:
AppDomain.ProcessExitdoes not fire reliably in console applications terminated via Ctrl+C, so the upgrade process was never launched.Fix: Added
TryLaunchUpgrade()andHasPreparedUpdatepublic members. Callers can invokeTryLaunchUpgrade()explicitly before process exit. The built-in_updaterStartedguard prevents double-launch ifProcessExitalso fires.3. GeneralUpdateBootstrap: expose orchestrator to callers
Added
SilentOrchestratorproperty so callers can access the orchestrator afterLaunchAsync()returns in silent mode.Files Changed
src/c#/GeneralUpdate.Core/Configuration/AppMetadataDiscoverer.cssrc/c#/GeneralUpdate.Core/Silent/SilentPollOrchestrator.csTryLaunchUpgrade(),HasPreparedUpdatesrc/c#/GeneralUpdate.Core/Bootstrap/GeneralUpdateBootstrap.csSilentOrchestratorpropertytests/ClientTest/Program.cstests/ClientTest/ClientTest.csprojtests/ClientTest/generalupdate.manifest.jsonCo-Authored-By: Claude Opus 4.8 noreply@anthropic.com