1message(STATUS "=============================================================") 2message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)") 3message(STATUS "") 4 5if(NOT CPackWiXGenerator_BINARY_DIR) 6 message(FATAL_ERROR "CPackWiXGenerator_BINARY_DIR not set") 7endif() 8 9message(STATUS "CMAKE_COMMAND: ${CMAKE_COMMAND}") 10message(STATUS "CMAKE_CPACK_COMMAND: ${CMAKE_CPACK_COMMAND}") 11message(STATUS "CPackWiXGenerator_BINARY_DIR: ${CPackWiXGenerator_BINARY_DIR}") 12 13if(config) 14 set(_C_config -C ${config}) 15endif() 16 17execute_process(COMMAND "${CMAKE_CPACK_COMMAND}" 18 ${_C_config} 19 RESULT_VARIABLE CPack_result 20 OUTPUT_VARIABLE CPack_output 21 ERROR_VARIABLE CPack_error 22 WORKING_DIRECTORY "${CPackWiXGenerator_BINARY_DIR}") 23 24if(CPack_result) 25 message(FATAL_ERROR "CPack execution went wrong!, CPack_output=${CPack_output}, CPack_error=${CPack_error}") 26else () 27 message(STATUS "CPack_output=${CPack_output}") 28endif() 29 30set(expected_file_mask "*.msi") 31file(GLOB installer_file "${expected_file_mask}") 32 33message(STATUS "installer_file='${installer_file}'") 34message(STATUS "expected_file_mask='${expected_file_mask}'") 35 36if(NOT installer_file) 37 message(FATAL_ERROR "installer_file does not exist.") 38endif() 39 40function(run_wix_command command) 41 file(TO_CMAKE_PATH "$ENV{WIX}" WIX_ROOT) 42 set(WIX_PROGRAM "${WIX_ROOT}/bin/${command}.exe") 43 44 if(NOT EXISTS "${WIX_PROGRAM}") 45 message(FATAL_ERROR "Failed to find WiX Tool: ${WIX_PROGRAM}") 46 endif() 47 48 message(STATUS "Running WiX Tool: ${command} ${ARGN}") 49 50 execute_process(COMMAND "${WIX_PROGRAM}" ${ARGN} 51 RESULT_VARIABLE WIX_result 52 OUTPUT_VARIABLE WIX_output 53 ERROR_VARIABLE WIX_output 54 WORKING_DIRECTORY "${CPackWiXGenerator_BINARY_DIR}") 55 56 message(STATUS "${command} Output: \n${WIX_output}") 57 58 if(WIX_result) 59 message(FATAL_ERROR "WiX ${command} failed: ${WIX_result}") 60 endif() 61endfunction() 62 63file(GLOB WXS_SOURCE_FILES 64 "${CPackWiXGenerator_BINARY_DIR}/_CPack_Packages/*/WIX/*.wxs") 65 66if(NOT WXS_SOURCE_FILES) 67 message(FATAL_ERROR "Failed finding WiX source files to validate.") 68endif() 69 70foreach(WXS_SOURCE_FILE IN LISTS WXS_SOURCE_FILES) 71 run_wix_command(wixcop "${WXS_SOURCE_FILE}") 72endforeach() 73 74# error SMOK1076 : ICE61: This product should remove only older 75# versions of itself. The Maximum version is not less 76# than the current product. (1.0.0 1.0.0) 77if (NOT no_verify) 78 run_wix_command(smoke -nologo -wx -sw1076 "${installer_file}") 79endif () 80