Harden helper deploy against partial-copy UAC loop (#97)#99
Draft
corando98 wants to merge 1 commit into
Draft
Conversation
Fresh install on GPD Win 5 hit an infinite version-mismatch/UAC loop: DeployHelper returned success whenever the exe landed, even with failCount>0, but only stamps .version when failCount==0. A single failed file copy therefore let PerformSetup report Setup Complete while .version was never written, so every launch re-detected a mismatch and re-fired UAC. Once the scheduled task had a helper running from the deployed folder, its locked files made every retry fail the same way. - DeployHelper success now matches the .version stamp condition, so a partial deploy fails setup loudly instead of half-succeeding. - PerformSetup kills running/zombie helper instances before deploying (elevated, so it has the rights) to release file locks. - The self-copy no-op path re-stamps a missing/stale .version when a real package-identity version is available (never the 1.0.0.0 assembly fallback, which would poison the stamp).
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.
Fixes the infinite version-mismatch/UAC setup loop reported in #97 (fresh install on GPD Win 5).
Root cause
DeployHelper()returned success whenever the exe landed (successCount > 0 && File.Exists(DeployedExePath)), even withfailCount > 0— but only stamps.versionwhenfailCount == 0. A single failed file copy therefore letPerformSetup()report Setup Complete while.versionwas never written. Every subsequent launch re-detected a version mismatch (deployed=, current=0.3.2556.0) and re-fired UAC. Once the scheduled task had a helper running from the deployed folder, its locked exe/DLLs made every redeploy fail the same way — a permanent loop the reporter could only break by hand-writing.versionand End-Tasking zombie helpers.Changes
DeployHelper()success now matches the.versionstamp condition (failCount == 0 && exe present), so a partial deploy fails setup loudly instead of half-succeeding silently.PerformSetup()kills running/zombieXboxGamingBarHelper.exeinstances before deploying (Step 0). The setup process is elevated so it has the rights; this releases the file locks that made retries fail..versionwhen a real package-identity version is available — never the assembly-version fallback (hardcoded 1.0.0.0), which would poison the stamp and recreate the loop. ExtractedGetPackageVersionFromIdentity()(returns null without identity) for this.Verification
XboxGamingBarHelper.csprojbuilds clean in Release x64. Not hardware-tested; the loop needs a machine where a deploy copy fails mid-setup to reproduce end-to-end.