From 2438339b2e4b54b382bd7c89d20c5e0b22848d12 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 21 Jan 2025 16:46:41 +0100 Subject: [PATCH] Windows MSI build: run light.exe with -sval if $ICINGA2_NO_MSI_VALIDATION is set This is equivalent to "setting true in your WiX MSBuild project" not to require a CI/CD service to run as an admin. https://wixtoolset.org/docs/tools/validation/#errors-running-validation --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e531a0591f..516912d4e20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -509,6 +509,11 @@ set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_BINARY_DIR}/icinga-installer/icinga2.w set(CPACK_WIX_EXTENSIONS "WixUtilExtension" "WixNetFxExtension") set(CPACK_WIX_INSTALL_SCOPE NONE) +if(DEFINED ENV{ICINGA2_NO_MSI_VALIDATION}) + # https://wixtoolset.org/docs/tools/validation/#errors-running-validation + set(CPACK_WIX_LIGHT_EXTRA_FLAGS "-sval") +endif() + set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "sbin") set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE) include(InstallRequiredSystemLibraries)