Skip to content

avoid dropping installer file handle to prevent race#10768

Merged
acarl005 merged 2 commits into
masterfrom
andy/fix-windows-autoupdate-10767
May 13, 2026
Merged

avoid dropping installer file handle to prevent race#10768
acarl005 merged 2 commits into
masterfrom
andy/fix-windows-autoupdate-10767

Conversation

@acarl005
Copy link
Copy Markdown
Contributor

@acarl005 acarl005 commented May 12, 2026

Description

This PR avoids deletion of the inno setup installer during auto-update.

The linked issue shows that in some cases, auto-update fails with a "file not found" error dialog. This is because of a race condition between dropping the TempPath, an RAII wrapper around the installer exe, and the installer itself actually starting up. It may have seemed like the installer should have started up sequentially first by calling a blocking call to spawn. This is not so b/c the exe actually spawns another process and exits immediately. To resolve this race, we simply do not delete the installer. There is no need, as the installer lives in %TEMP% anyways.

Linked Issue

This PR addresses #10767. Master issue is #10044.

Testing

Untested due to the lack of a robust reproduction case.

@acarl005 acarl005 added this to the 2026 Week 20 (May 11 - 15) milestone May 12, 2026
@acarl005 acarl005 requested a review from lucieleblanc May 12, 2026 20:50
@acarl005 acarl005 self-assigned this May 12, 2026
@cla-bot cla-bot Bot added the cla-signed label May 12, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 12, 2026

@acarl005

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR changes Windows autoupdate relaunch to clone the installer path without taking ownership of the TempPath, preventing RAII cleanup from deleting the installer before the spawned Inno Setup process has opened it.

Concerns

  • No blocking correctness or security concerns found in the changed hunk.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@lucieleblanc lucieleblanc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix makes sense to me!

Left a question about another race condition cited in the code.

Comment thread app/src/autoupdate/windows.rs Outdated
Comment on lines 262 to 268
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this code at all related to the issue? Should we clean this up?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yes! ready to be deleted

@acarl005 acarl005 enabled auto-merge (squash) May 13, 2026 22:02
@acarl005 acarl005 merged commit 5836a66 into master May 13, 2026
25 checks passed
@acarl005 acarl005 deleted the andy/fix-windows-autoupdate-10767 branch May 13, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants