Cockatrice/tools/installer-holder-probe
Lukas Brübach 068ea1627f [Installer] Stop calling the payload free while an executable is locked
The guard answered "nothing is holding the payload" from two lookups that can
both miss a running instance: Restart Manager does not reliably report a
program's own image or the modules it mapped, and the image path of a process
running under another account cannot be read from the probe at all. A user log
showed exactly that: the first guard passed while cockatrice.exe was running
from the directory, the old uninstaller silently skipped the file it could not
delete, and the update aborted half an uninstall later with "cancelled by user"
after a close attempt the running window ignored.

Ask the file itself. A running image is opened without write sharing, so the
write open replacing it needs is refused with ERROR_SHARING_VIOLATION for as
long as the program runs, while a file that is merely being read still accepts
it. When neither lookup named anybody and a payload executable refuses that
open, the probe answers that the file is in use and that the program holding it
could not be identified - the guard's "could not confirm" dialog, whose Retry
works once the user has closed it - instead of passing the payload as free.

Only the payload executables are tested, not every file the purge removes: a
locked executable proves a program is running and a mapped DLL belongs to a
running executable, while a locked DLL or qt.conf can be the asking process
itself, which is the loop the guard already had. The open is retried once after
300 ms, and only for the files that refused, so a scanner holding a file for a
moment cannot stop an install for nothing.

The Windows probe check now covers that answer: a payload executable held by
the asking process, so that it cannot be named, has to come back as in use
rather than as free.

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-10-31 06:58:50 +01:00
..
close_holders.cpp [Installer] Name only the payload programs installed in the directory (#7684) 2026-10-30 13:16:50 +01:00
close_holders.h [Installer] Ask a hidden instance to close, then offer to end it once (#7683) 2026-10-29 21:01:16 +01:00
CMakeLists.txt [Installer] Stop calling the payload free while an executable is locked 2026-10-31 06:58:50 +01:00
holder_line.cpp [CrashReporting] Name the files and processes behind a failed installer purge (#7590) 2026-10-24 00:46:54 +02:00
holder_line.h [Installer] Ask a hidden instance to close, then offer to end it once (#7683) 2026-10-29 21:01:16 +01:00
main.cpp [Installer] Stop calling the payload free while an executable is locked 2026-10-31 06:58:50 +01:00
payload_locks.cpp [Installer] Stop calling the payload free while an executable is locked 2026-10-31 06:58:50 +01:00
payload_locks.h [Installer] Stop calling the payload free while an executable is locked 2026-10-31 06:58:50 +01:00
payload_paths.cpp [Installer] Stop calling the payload free while an executable is locked 2026-10-31 06:58:50 +01:00
payload_paths.h [Installer] Stop calling the payload free while an executable is locked 2026-10-31 06:58:50 +01:00
restart_manager_holders.cpp [Installer] Stop calling the payload free while an executable is locked 2026-10-31 06:58:50 +01:00
restart_manager_holders.h [Installer] Name only the payload programs installed in the directory (#7684) 2026-10-30 13:16:50 +01:00