diff --git a/CMakeLists.txt b/CMakeLists.txt index b294f27ba..97b87a1d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -337,6 +337,15 @@ elseif(WIN32) # Configure file with custom definitions for NSIS. configure_file("${COCKATRICE_CMAKE_PATH}/NSIS.definitions.nsh.in" "${PROJECT_BINARY_DIR}/NSIS.definitions.nsh") + # Installer-log sender for the AbortInstall Sentry hook (values parsed out of COCKATRICE_SENTRY_DSN in + # cmake/CrashReporting.cmake). Generated only when a DSN was parsed: cmake/NSIS.template.in embeds it under + # the same CPACK_SENTRY_ENABLED check, so a build without reporting never references or carries the helper. + if(CPACK_SENTRY_ENABLED) + configure_file( + "${COCKATRICE_CMAKE_PATH}/SendInstallerLog.ps1.in" "${PROJECT_BINARY_DIR}/SendInstallerLog.ps1" @ONLY + ) + endif() + # Every runtime DLL a Windows install has to contain, as paths relative to the # install root. .ci/compile.sh reads this and fails the build when the packaged # installer is missing one of them, or carries a runtime it does not know about. diff --git a/cmake/CrashReporting.cmake b/cmake/CrashReporting.cmake index db016269f..6f9cf4849 100644 --- a/cmake/CrashReporting.cmake +++ b/cmake/CrashReporting.cmake @@ -179,3 +179,34 @@ if(WITH_CRASH_REPORTING ) endif() endif() + +# Installer failure reporting (increment 4): parse COCKATRICE_SENTRY_DSN into the parts the Windows installer +# needs. These are CPACK_* so CPack snapshots them at include(CPack) time and substitutes them into +# cmake/NSIS.template.in at package time; on non-Windows they are inert (only the NSIS template consumes them). +# Set from COCKATRICE_SENTRY_DSN on every configure, so a changed or removed DSN can never leave a stale value +# behind. Plain variables, not CACHE: they only need to be in scope when include(CPack) later snapshots every +# CPACK_* variable into CPackConfig.cmake. +set(CPACK_SENTRY_ENABLED "0") +set(CPACK_SENTRY_KEY "") +set(CPACK_SENTRY_ENVELOPE_URL "") +set(CPACK_SENTRY_DSN_FULL "") +# Deliberately PROJECT_VERSION: that is what the client bakes as its Sentry release and what CI passes to +# `sentry-cli debug-files upload`, so installer and client events group under one release. It is not the +# CPACK_PACKAGE_VERSION the installer logs in its own log line — on Development tags PROJECT_VERSION carries a +# "-