Skip Inno spawn when another instance is already installing#318486
Open
dmitrivMS wants to merge 14 commits into
Open
Skip Inno spawn when another instance is already installing#318486dmitrivMS wants to merge 14 commits into
dmitrivMS wants to merge 14 commits into
Conversation
Two VS Code instances (e.g. a normal one plus one started with --transient) sharing the same install can both reach doApplyUpdate for the same downloaded package and each spawn Inno Setup. The second spawn races into Inno's 'Setup is already running' modal. Check the existing '<mutex>-updating' mutex before spawning. If another instance is already running setup, skip the spawn and rely on the existing '-ready' mutex polling loop to transition this instance to Ready when the install finishes.
Contributor
There was a problem hiding this comment.
Pull request overview
Prevents multiple VS Code instances sharing the same Windows installation from spawning a second Inno Setup installer during a background update, avoiding Inno’s “Setup is already running” modal by checking the existing *-updating named mutex before spawning.
Changes:
- Adds an
-updatingmutex pre-check indoApplyUpdateto detect an already-running installer. - Skips spawning and process tracking when another instance is already installing, relying on existing
-readymutex polling to advance state. - Logs when installation is delegated to another instance.
Show a summary per file
| File | Description |
|---|---|
| src/vs/platform/update/electron-main/updateService.win32.ts | Adds -updating mutex check to avoid spawning a second Inno Setup installer and continues readiness polling. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 1
This was referenced May 27, 2026
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.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.
Fixes #62476
Problem
When two VS Code Insiders instances are running against the same install (for example a normal instance plus one started with
--transient) and an update becomes available, both instances independently progress through the update state machine todoApplyUpdatefor the same downloadedCodeSetup-*.exeand each spawn Inno Setup.The second spawn races into Inno's built-in "Setup is already running" modal, because Inno protects itself with a global per-install mutex.
Fix
In
updateService.win32.tsdoApplyUpdate, check the existing${win32MutexName}-updatingWindows named mutex (already held by the running Inno Setup process) before spawning. If another instance is already running setup for this install:updateProcess(we must not kill the other instance's installer if the user cancels here).-readymutex polling loop running so this instance still transitionsUpdating → Readywhen the other instance's install finishes.The existing 1-hour
cancelTimeoutcontinues to act as the safety net if the other instance crashes mid-install.Notes
isActivechecks returnfalsebefore either process actually grabs the mutex), but the reported scenario — one instance already mid-install when the other tries to start — is handled.@vscode/windows-mutexalready imported a few lines down for-ready.