diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index 4ebf30699..25af0c93e 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -234,10 +234,35 @@ if("${CPACK_GENERATOR}" STREQUAL "WIX") set(CPACK_WIX_LIGHT_EXTRA_FLAGS "-dcl:high") set(CPACK_WIX_UI_BANNER - "@CMake_SOURCE_DIR@/Utilities/Release/cpack_wix_ui_banner.jpg" + "@CMake_SOURCE_DIR@/Utilities/Release/WiX/ui_banner.jpg" ) set(CPACK_WIX_UI_DIALOG - "@CMake_SOURCE_DIR@/Utilities/Release/cpack_wix_ui_dialog.jpg" + "@CMake_SOURCE_DIR@/Utilities/Release/WiX/ui_dialog.jpg" ) + + set(CPACK_WIX_EXTRA_SOURCES + "@CMake_SOURCE_DIR@/Utilities/Release/WiX/install_dir.wxs" + "@CMake_SOURCE_DIR@/Utilities/Release/WiX/cmake_extra_dialog.wxs" + ) + + set(CPACK_WIX_UI_REF "CMakeUI_InstallDir") + + set(CPACK_WIX_PATCH_FILE + "@CMake_SOURCE_DIR@/Utilities/Release/WiX/patch_path_env.xml" + ) + + set(CPACK_WIX_TEMPLATE + "@CMake_SOURCE_DIR@/Utilities/Release/WiX/WIX.template.in" + ) + + set(BUILD_QtDialog "@BUILD_QtDialog@") + + 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") + endif() endif() diff --git a/Utilities/Release/WiX/WIX.template.in b/Utilities/Release/WiX/WIX.template.in new file mode 100644 index 000000000..094999f1d --- /dev/null +++ b/Utilities/Release/WiX/WIX.template.in @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + ProductIcon.ico + + + + + + + + + + + + + + + + + + + diff --git a/Utilities/Release/WiX/cmake_extra_dialog.wxs b/Utilities/Release/WiX/cmake_extra_dialog.wxs new file mode 100644 index 000000000..0ee3d99e7 --- /dev/null +++ b/Utilities/Release/WiX/cmake_extra_dialog.wxs @@ -0,0 +1,36 @@ + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Utilities/Release/WiX/install_dir.wxs b/Utilities/Release/WiX/install_dir.wxs new file mode 100644 index 000000000..883efba90 --- /dev/null +++ b/Utilities/Release/WiX/install_dir.wxs @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + 1 + "1"]]> + + 1 + + NOT Installed + Installed AND PATCH + + 1 + LicenseAccepted = "1" + + 1 + 1 + NOT WIXUI_DONTVALIDATEPATH + "1"]]> + WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1" + 1 + 1 + + 1 + 1 + + NOT Installed + Installed AND NOT PATCH + Installed AND PATCH + + 1 + + 1 + 1 + 1 + + + + + + + diff --git a/Utilities/Release/WiX/patch_desktop_shortcut.xml b/Utilities/Release/WiX/patch_desktop_shortcut.xml new file mode 100644 index 000000000..d30705dd1 --- /dev/null +++ b/Utilities/Release/WiX/patch_desktop_shortcut.xml @@ -0,0 +1,5 @@ + + + DESKTOP_SHORTCUT_REQUESTED = 1 + + diff --git a/Utilities/Release/WiX/patch_path_env.xml b/Utilities/Release/WiX/patch_path_env.xml new file mode 100644 index 000000000..0e335c4d5 --- /dev/null +++ b/Utilities/Release/WiX/patch_path_env.xml @@ -0,0 +1,26 @@ + + + + + ADD_CMAKE_TO_PATH = "System" + + + + + + + ADD_CMAKE_TO_PATH = "User" + + + + + + + + + + diff --git a/Utilities/Release/cpack_wix_ui_banner.jpg b/Utilities/Release/WiX/ui_banner.jpg similarity index 100% rename from Utilities/Release/cpack_wix_ui_banner.jpg rename to Utilities/Release/WiX/ui_banner.jpg diff --git a/Utilities/Release/cpack_wix_ui_dialog.jpg b/Utilities/Release/WiX/ui_dialog.jpg similarity index 100% rename from Utilities/Release/cpack_wix_ui_dialog.jpg rename to Utilities/Release/WiX/ui_dialog.jpg