From 6e727e6ab0d7c942ad6183639014ac770e685f82 Mon Sep 17 00:00:00 2001 From: scottr Date: Fri, 18 Jun 2021 08:25:03 -0700 Subject: [PATCH] [cpack/stabilization/2106-jenkins] various changes to shorten cpack install path on windows --- cmake/Packaging.cmake | 3 +-- cmake/Platform/Windows/PackagingPostBuild.cmake | 2 +- cmake/Platform/Windows/Packaging_windows.cmake | 6 ++++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake index 2f001cf7ee..e7782ac284 100644 --- a/cmake/Packaging.cmake +++ b/cmake/Packaging.cmake @@ -32,8 +32,7 @@ set(CPACK_PACKAGE_VENDOR "TBD") set(CPACK_PACKAGE_VERSION "${LY_VERSION_STRING}") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Installation Tool") -string(TOLOWER ${PROJECT_NAME} _project_name_lower) -set(CPACK_PACKAGE_FILE_NAME "${_project_name_lower}_${LY_VERSION_STRING}_installer") +string(TOLOWER "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}" CPACK_PACKAGE_FILE_NAME) set(DEFAULT_LICENSE_NAME "Apache-2.0") set(DEFAULT_LICENSE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") diff --git a/cmake/Platform/Windows/PackagingPostBuild.cmake b/cmake/Platform/Windows/PackagingPostBuild.cmake index 1dcbedcba7..63f60994c5 100644 --- a/cmake/Platform/Windows/PackagingPostBuild.cmake +++ b/cmake/Platform/Windows/PackagingPostBuild.cmake @@ -17,7 +17,7 @@ string(REPLACE "/" "\\" _fixed_package_install_dir ${CPACK_PACKAGE_INSTALL_DIREC set(_cpack_wix_out_dir ${CPACK_TOPLEVEL_DIRECTORY}) set(_bootstrap_out_dir "${CPACK_TOPLEVEL_DIRECTORY}/bootstrap") -set(_bootstrap_filename "${CPACK_PACKAGE_FILE_NAME}.exe") +set(_bootstrap_filename "${CPACK_PACKAGE_FILE_NAME}_installer.exe") set(_bootstrap_output_file ${_cpack_wix_out_dir}/${_bootstrap_filename}) set(_ext_flags diff --git a/cmake/Platform/Windows/Packaging_windows.cmake b/cmake/Platform/Windows/Packaging_windows.cmake index 6dc806ff56..95c00a3d0f 100644 --- a/cmake/Platform/Windows/Packaging_windows.cmake +++ b/cmake/Platform/Windows/Packaging_windows.cmake @@ -26,6 +26,12 @@ set(_cmake_package_name "cmake-${CPACK_DESIRED_CMAKE_VERSION}-windows-x86_64") set(CPACK_CMAKE_PACKAGE_FILE "${_cmake_package_name}.zip") set(CPACK_CMAKE_PACKAGE_HASH "15a49e2ab81c1822d75b1b1a92f7863f58e31f6d6aac1c4103eef2b071be3112") +# workaround for shortening the path cpack installs to by stripping the platform directory and forcing monolithic +# mode to strip out component folders. this unfortunately is the closest we can get to changing the install location +# as CPACK_PACKAGING_INSTALL_PREFIX/CPACK_SET_DESTDIR isn't supported for the WiX generator +set(CPACK_TOPLEVEL_TAG "") +set(CPACK_MONOLITHIC_INSTALL ON) + # CPack will generate the WiX product/upgrade GUIDs further down the chain if they weren't supplied # however, they are unique for each run. instead, let's do the auto generation here and add it to # the cache for run persistence and have the ability to detect if they are still being used.