Skip to content

win32: fix installer's context menu COM surrogate kill command - #344505

Merged
Robo (deepak1556) merged 2 commits into
microsoft:mainfrom
pl4nty:fix/win32-installer-com-surrogate-kill
Oct 27, 2026
Merged

Robo (deepak1556) merged 2 commits into
microsoft:mainfrom
pl4nty:fix/win32-installer-com-surrogate-kill

Conversation

@pl4nty

@pl4nty Tom Plant (pl4nty) commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #318029, assisted by Claude Opus 5.5

KillContextMenuComSurrogate in build/win32/code.iss passes -Filter ""Name = 'dllhost.exe'"" to powershell.exe -Command "...". powershell.exe doesn't treat "" as an escaped quote, so the script fails to parse (The string is missing the terminator: ".) and exits 1. The context menu dllhost.exe is never stopped, so inno_updater --gc hangs retrying deletion of the old commit folder.

Changes:

  • Use \" for the inner quotes so they survive argv parsing
  • Match {#FileExplorerContextMenuCLSID} anywhere in the dllhost command line instead of only */Processid:{CLSID}*, this should make it less fragile

How to test

  1. Install a build with the File Explorer context menu registered, right-click a file in Explorer so the COM surrogate dllhost.exe starts
  2. Update to a build with this change
  3. Verify the dllhost.exe hosting the context menu CLSID is stopped and the old commit folder is removed without inno_updater hanging

Also verified standalone by extracting the Command := expression, evaluating it with Inno Pascal string rules and running it via ShellExecute against a fake dllhost.exe with /Processid:{GUID} in its command line:

  • before: exit 1 (TerminatorExpectedAtEndOfString), process not killed
  • after: exit 0, process killed

Copilot AI balanced review requested due to automatic review settings October 27, 2026 06:52

Copilot AI left a comment

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.

🟢 Approval recommended

The narrow fix addresses the reported parsing failure while retaining process-name and CLSID filtering, with no unresolved findings.

No open issues 🎉

What changed in this PR

Fixes the Windows installer’s PowerShell command for stopping the context-menu COM surrogate, addressing the cleanup hang reported in #318029.

Changes:

  • Corrects quote escaping so the PowerShell process filter parses successfully.
  • Matches the context-menu CLSID anywhere in the dllhost.exe command line rather than requiring the /Processid: prefix.
File Description
build/​win32/​code.iss Fixes command quoting and broadens CLSID matching for context-menu surrogate cleanup.

Review effort: Balanced

@deepak1556
Robo (deepak1556) force-pushed the fix/win32-installer-com-surrogate-kill branch from d048824 to a741855 Compare October 27, 2026 10:34
@deepak1556 Robo (deepak1556) added this to the 1.145.0 milestone Oct 27, 2026

@deepak1556 Robo (deepak1556) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks!

@deepak1556
Robo (deepak1556) enabled auto-merge (squash) October 27, 2026 10:39
@deepak1556
Robo (deepak1556) merged commit a0fba2a into microsoft:main Oct 27, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup gets stuck due to dllhost.exe blocking inno_updater.exe from finishing cleanup

4 participants