mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 05:06:36 +02:00
[Installer] Gracefully terminate PowerToys process before updating do… (#20430)
* [Installer] Gracefully terminate PowerToys process before updating dotnet
This commit is contained in:
12
installer/PowerToysSetup/terminate_powertoys.cmd
Normal file
12
installer/PowerToysSetup/terminate_powertoys.cmd
Normal file
@@ -0,0 +1,12 @@
|
||||
@echo off
|
||||
setlocal ENABLEDELAYEDEXPANSION
|
||||
|
||||
@REM We loop here until taskkill cannot find a PowerToys process. We can't use /F flag, because it
|
||||
@REM doesn't give application an opportunity to cleanup. Thus we send WM_CLOSE which is being caught
|
||||
@REM by multiple windows running a msg loop in PowerToys.exe process, which we close one by one.
|
||||
for /l %%x in (1, 1, 100) do (
|
||||
taskkill /IM PowerToys.exe 1>NUL 2>NUL
|
||||
if !ERRORLEVEL! NEQ 0 goto quit
|
||||
)
|
||||
|
||||
:quit
|
||||
Reference in New Issue
Block a user