installer: auto-terminate QuickLook.exe before install/upgrade/uninstall - #1918
Conversation
… prevent locked-file warnings Agent-Logs-Url: https://github.com/QL-Win/QuickLook/sessions/107141f9-3b6f-4409-8cd2-2d3663c692c9 Co-authored-by: emako <24737061+emako@users.noreply.github.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a WiX CloseApplication custom action to automatically terminate QuickLook.exe before file operations, preventing MSI uninstall/install loops due to locked files, and wires in the WixUtilExtension needed for that action. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider tightening the
util:CloseApplicationtarget so it only affects the MSI-installed QuickLook instance (e.g., via full path tied to a component rather than justQuickLook.exe), to avoid unintentionally terminating a portable or separately installed copy. - It may be worth adding a Condition around the
CloseApplicationcustom action (e.g.,NOT Installed OR UPGRADINGPRODUCTCODEor similar) so it only runs when needed and doesn’t execute in unrelated maintenance scenarios.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider tightening the `util:CloseApplication` target so it only affects the MSI-installed QuickLook instance (e.g., via full path tied to a component rather than just `QuickLook.exe`), to avoid unintentionally terminating a portable or separately installed copy.
- It may be worth adding a Condition around the `CloseApplication` custom action (e.g., `NOT Installed OR UPGRADINGPRODUCTCODE` or similar) so it only runs when needed and doesn’t execute in unrelated maintenance scenarios.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Pull request overview
Adds a WiX installer action to proactively close/terminate QuickLook.exe during install/upgrade/uninstall, reducing MSI “file locked” prompts (notably during uninstall where QuickLook can hold its own DLLs open).
Changes:
- Add
WixUtilExtensionreference to the WiX project. - Add
xmlns:utiland autil:CloseApplicationentry targetingQuickLook.exein the main installer authoring.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| QuickLook.Installer/QuickLook.Installer.wixproj | References WixUtilExtension so util:* elements can be used. |
| QuickLook.Installer/Product.wxs | Declares the util namespace and adds a CloseApplication action for QuickLook.exe. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Target="QuickLook.exe" | ||
| CloseMessage="yes" | ||
| RebootPrompt="no" | ||
| TerminateProcess="1" |
There was a problem hiding this comment.
TerminateProcess is a boolean attribute (consistent with CloseMessage/RebootPrompt in this same element). Using TerminateProcess="1" is inconsistent with the rest of the WiX authoring here and may fail schema validation in Candle/Light. Use the standard yes/no value (e.g., yes) to ensure it builds reliably with WiX 3.x.
| TerminateProcess="1" | |
| TerminateProcess="yes" |
MSI uninstall loops on repeated "file locked" warnings because
QuickLook.exeholds its own DLLs open. Added aWixUtilExtensionCloseApplicationaction that gracefully closes then force-kills the process before any file operations run.Changes
Product.wxs— addedxmlns:utilnamespace +util:CloseApplicationtargetingQuickLook.exe(graceful WM_CLOSE → force-terminate if unresponsive, no reboot prompt, sequenced at 800 beforeInstallFiles)QuickLook.Installer.wixproj— addedWixUtilExtensionreferenceApplies on install, upgrade, and uninstall.
Original prompt
This pull request was created from Copilot chat.
Summary by Sourcery
Ensure the Windows installer automatically closes the running QuickLook process before performing install, upgrade, or uninstall operations to avoid file-lock issues.
Bug Fixes:
Enhancements: