Cockatrice/cmake
BruebachL c6f682f9cf
[CrashReporting] Offer to send the installer log on abort (#7524)
* [CrashReporting] Installer log send offer on abort (inc 4)

DSN parsed to CPACK_SENTRY_* (scheme-aware for http self-hosts) before
include(CPack); new SendInstallerLog.ps1.in builds a byte-accurate
Sentry envelope (128 KiB tail cap, X-Sentry-Auth, exit 0/1) with the
abort reason read from the log file itself, so the NSIS side needs no
string functions and quoting stays trivial. AbortInstall asks consent
(attended installs only, silent path untouched, abort never
swallowed). Empty/malformed DSN disables the offer; no secrets in repo.

* [CrashReporting] Embed installer-log sender via a relative NSIS path

The AbortInstall hook embedded SendInstallerLog.ps1 through the absolute
CPACK_SENTRY_PS1_PATH, which carries CMake's forward slashes (D:/a/...).
makensis does not treat a forward-slash drive path as absolute, so it
resolved it relative to project.nsi, found nothing and aborted packaging
on the Windows jobs of every branch in the stack.

Embed it with the same '..\..\..\' relative path that already resolves
NSIS.definitions.nsh: both are configure_file'd into the build root,
three levels up from where CPack places project.nsi. Drop the now-unused
CPACK_SENTRY_PS1_PATH cache variable.

* [CrashReporting] Drop the installer /CRASHTEST hook, tidy the log sender

Remove the /CRASHTEST switch and the matching COCKATRICE_SENTRY_DSN
environment override on the installer abort path. With no deliberate
in-installer trigger left, a package built without a baked DSN must never
offer to post a user's log to an endpoint chosen by whatever happens to be
in the environment, so the prompt is now gated on CPACK_SENTRY_ENABLED
alone. This also retires the comment that claimed /S /R /CRASHTEST reaches
the prompt: the switch was evaluated before /R set ReinstallMode, so that
form never showed it.

Alongside: correct the CPACK_SENTRY_RELEASE comment (PROJECT_VERSION keeps
its "-<label>" on Development tags where CPACK_PACKAGE_VERSION does not),
delete the unused CPACK_SENTRY_HOST/CPACK_SENTRY_PROJECT_ID cache vars,
document the DSN regex's path-prefix fallback, log a declined send, keep
the uploaded installer log free of helper-injected newlines, and bound
the post with -TimeoutSec/-NonInteractive.

* [CrashReporting] Derive the installer DSN vars as plain variables

Review nit: every CPACK_SENTRY_* value is recomputed from
COCKATRICE_SENTRY_DSN on each configure, so CACHE ... FORCE bought
nothing. Set empty defaults once, override them in the match branch, and
drop the duplicated else() copies. Still CPACK_-prefixed, so include(CPack)
still snapshots them into CPackConfig.cmake.

* [CrashReporting] Gate the installer log send at build time

Review nit: test CPACK_SENTRY_ENABLED with the NSIS preprocessor
instead of copying it into $SentryEnabled and branching at runtime, so a
package built without a DSN compiles the prompt out rather than carrying
dead code. The configure_file that produces the helper is gated the same
way, so a build without reporting neither references nor embeds it.

* [CrashReporting] Disclose the Windows user name in the send prompt

Review nit: say that the log can include the Windows user name (a real
part of what gets uploaded) and drop the "No account needed." clause,
which answered a question the prompt never raised.

* [CrashReporting] Show progress while the installer log is sent

Review nit: DetailPrint a line before nsExec runs, so the details pane
says something while the send is in flight instead of staying blank for
up to the 60 s /TIMEOUT.

* [CrashReporting] Rename the Sentry event local in the installer helper

Review nit: $Event is a PowerShell automatic variable, so name the local
$sentryEvent instead. Also drop $firstLine: Select-String returns the
matching line alone, so the reason is already one physical line and the
extra split added nothing.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-10-19 14:57:04 +02: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 [CrashReporting] Offer to send the installer log on abort (#7524) 2026-10-19 14:57:04 +02: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 [CrashReporting] Offer to send the installer log on abort (#7524) 2026-10-19 14:57:04 +02: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