Cockatrice/cmake
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
..
pch [Build] Extend PCH to libraries and grow IWYU-driven header sets (#7456) 2026-10-11 15:07:30 +02:00
CMakeDMGSetup.script [Deprecation] Remove DBConverter from sources. (#6431) 2025-12-20 15:25:13 +01:00
Coverage.cmake [CI] Publish a gcovr line-coverage report from the test run (#7404) 2026-10-11 15:05:28 +02:00
CrashReporting.cmake [CrashReporting] Offer to send the installer log on abort (#7524) 2026-10-19 14:57:04 +02:00
createversionfile.cmake Add cmake format (#4618) 2022-05-08 21:22:43 +02:00
dmgBackground.tif CPack DMG Installer with Background Image (#4787) 2023-04-29 23:13:01 -04:00
FindLibexecinfo.cmake Add cmake format (#4618) 2022-05-08 21:22:43 +02:00
FindQtRuntime.cmake [Tests] Register each test case with CTest instead of each test binary (#7399) 2026-10-11 14:50:09 +02:00
FindVCredistRuntime.cmake CI: Use windows-2022 image with Visual Studio 17 2022 (#4999) 2024-05-13 17:41:50 -04:00
getversion.cmake Use dash instead of underscore 2026-05-08 10:13:40 -04:00
gtest-CMakeLists.txt.in Bump minimum required cmake to 3.10 in gtest (#6851) 2026-05-09 00:05:10 +02:00
headerimage.bmp svg+png updates 2015-04-28 16:06:36 +02:00
Info.plist Define Cockatrice as an editor/handler for .cod files and cockatrice:// protocol on all platforms (#6775) 2026-08-08 19:02:19 +02:00
launch-c.in Travis: enable ccache usage under macOS; halves compilation time (#3052) 2018-01-27 13:43:48 -05:00
launch-cxx.in Travis: enable ccache usage under macOS; halves compilation time (#3052) 2018-01-27 13:43:48 -05:00
leftimage.bmp svg+png updates 2015-04-28 16:06:36 +02:00
NSIS.definitions.nsh.in NSIS: misc fixes [wip] (#3300) 2018-06-25 18:34:58 +02:00
NSIS.template.in [Installer] Stop calling the payload free while an executable is locked 2026-10-31 06:58:50 +01:00
Sanitizers.cmake [Tests] Register each test case with CTest instead of each test binary (#7399) 2026-10-11 14:50:09 +02:00
SendInstallerLog.ps1.in [Installer] Ask a hidden instance to close, then offer to end it once (#7683) 2026-10-29 21:01:16 +01:00
SignMacApplications.cmake [Deprecation] Remove DBConverter from sources. (#6431) 2025-12-20 15:25:13 +01:00
SplitDebugSymbols.cmake.in [CrashReporting] Breakpad capture, session detection and symbol upload (#7523) 2026-10-19 14:57:04 +02:00