Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply Registry Entries Last During Update Flow #5214

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Trenly
Copy link
Contributor

@Trenly Trenly commented Feb 17, 2025

This PR makes it so that the registry entries for a portable application are only applied if the DesiredState was applied successfully


Microsoft Reviewers: Open in CodeFlow

@Trenly Trenly requested a review from a team as a code owner February 17, 2025 02:08
@microsoft-github-policy-service microsoft-github-policy-service bot added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Feb 17, 2025
@florelis
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JohnMcPMS
Copy link
Member

JohnMcPMS commented Feb 18, 2025

The code was this way intentionally, although I would agree that it probably didn't properly consider the update case.

On fresh install, the goal was to write to the registry first to create a handle for user action in the event of catastrophic failure. To say that plainly, if we crashed in the middle of the installation, the ARP registry entry would provide some means to uninstall the package.

On upgrade, I agree that this is flawed. Overwriting the state before completing the state change is an issue.

To achieve both of these goals, I think the answer is splitting the ARP registry writes into two portions:

  1. Ensure that a base registry key and values exist to enable at least uninstall. On upgrades I would expect that this is a no-op.
  2. Write the completed state (such as version, maybe only version?) into the existing key. In all cases this should create a situation where an upgrade remains available after an upgrade failure.

@Trenly Trenly marked this pull request as draft February 18, 2025 23:34
@Trenly
Copy link
Contributor Author

Trenly commented Feb 18, 2025

Makes sense; I'll look to see if theres an easy way to do that

@Trenly Trenly marked this pull request as ready for review February 19, 2025 18:35
@Trenly Trenly changed the title Apply Registry Entries Last Apply Registry Entries Last During Update Flow Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Registry keys updated before portable installation was successful
3 participants