Description
InstallNewVersionStage1 in PowerToys.Update.cpp sends WM_CLOSE to the PowerToys tray window but immediately proceeds to launch the installer via Stage 2 without waiting for the PT process to actually exit.
Steps to Reproduce
- PowerToys is running with modules loaded (FancyZones, MWB, etc.)
- Update triggers Stage 1
WM_CLOSE is sent but PT hasn't fully shut down yet
- Stage 2 launches installer which tries to replace files still in use
Impact
Intermittent install failures due to file-in-use errors.
Fix
After SendMessageW(WM_CLOSE), wait for the PT process handle to exit before launching Stage 2.
Found during multi-agent code review of #46889.
Description
InstallNewVersionStage1inPowerToys.Update.cppsendsWM_CLOSEto the PowerToys tray window but immediately proceeds to launch the installer via Stage 2 without waiting for the PT process to actually exit.Steps to Reproduce
WM_CLOSEis sent but PT hasn't fully shut down yetImpact
Intermittent install failures due to file-in-use errors.
Fix
After
SendMessageW(WM_CLOSE), wait for the PT process handle to exit before launching Stage 2.Found during multi-agent code review of #46889.