summaryrefslogtreecommitdiff
path: root/CMakeCPackOptions.cmake.in
diff options
context:
space:
mode:
authorNils Gladitz <nilsgladitz@gmail.com>2016-02-07 20:25:56 +0100
committerBrad King <brad.king@kitware.com>2016-02-09 10:28:57 -0500
commita12b0f1b193024b71583b9150aeead33d364d189 (patch)
treef94b0230c6bfdb8e72b1572877fcadcb0d6d2a72 /CMakeCPackOptions.cmake.in
parenta5a5a6857241c21d306661d723b749839f4c6e1a (diff)
downloadcmake-a12b0f1b193024b71583b9150aeead33d364d189.tar.gz
CMake: Prevent WiX installations over existing NSIS installations
Use a custom action to look for Uninstall.exe in the user selected installation prefix. Its presence indicates a previous NSIS installation. Inform the user and request manual resolution of the issue.
Diffstat (limited to 'CMakeCPackOptions.cmake.in')
-rw-r--r--CMakeCPackOptions.cmake.in28
1 files changed, 25 insertions, 3 deletions
diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in
index 25af0c93e7..59ae224ea4 100644
--- a/CMakeCPackOptions.cmake.in
+++ b/CMakeCPackOptions.cmake.in
@@ -246,6 +246,29 @@ if("${CPACK_GENERATOR}" STREQUAL "WIX")
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/cmake_extra_dialog.wxs"
)
+ set(_WIX_CUSTOM_ACTION_ENABLED "@WIX_CUSTOM_ACTION_ENABLED@")
+ if(_WIX_CUSTOM_ACTION_ENABLED)
+ list(APPEND CPACK_WIX_EXTRA_SOURCES
+ "@CMake_SOURCE_DIR@/Utilities/Release/WiX/cmake_nsis_overwrite_dialog.wxs"
+ )
+ list(APPEND CPACK_WIX_CANDLE_EXTRA_FLAGS -dCHECK_NSIS=1)
+
+ set(_WIX_CUSTOM_ACTION_MULTI_CONFIG "@WIX_CUSTOM_ACTION_MULTI_CONFIG@")
+ if(_WIX_CUSTOM_ACTION_MULTI_CONFIG)
+ if(CPACK_BUILD_CONFIG)
+ set(_WIX_CUSTOM_ACTION_CONFIG "${CPACK_BUILD_CONFIG}")
+ else()
+ set(_WIX_CUSTOM_ACTION_CONFIG "Release")
+ endif()
+
+ list(APPEND CPACK_WIX_EXTRA_SOURCES
+ "@CMake_BINARY_DIR@/Utilities/Release/WiX/custom_action_dll-${_WIX_CUSTOM_ACTION_CONFIG}.wxs")
+ else()
+ list(APPEND CPACK_WIX_EXTRA_SOURCES
+ "@CMake_BINARY_DIR@/Utilities/Release/WiX/custom_action_dll.wxs")
+ endif()
+ endif()
+
set(CPACK_WIX_UI_REF "CMakeUI_InstallDir")
set(CPACK_WIX_PATCH_FILE
@@ -261,8 +284,7 @@ if("${CPACK_GENERATOR}" STREQUAL "WIX")
if(BUILD_QtDialog)
list(APPEND CPACK_WIX_PATCH_FILE
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/patch_desktop_shortcut.xml"
- )
-
- set(CPACK_WIX_CANDLE_EXTRA_FLAGS "-dBUILD_QtDialog=1")
+ )
+ list(APPEND CPACK_WIX_CANDLE_EXTRA_FLAGS -dBUILD_QtDialog=1)
endif()
endif()