From 9775822778ec2cf8003ea86f455906f75bce1c14 Mon Sep 17 00:00:00 2001 From: scottr Date: Tue, 11 May 2021 16:09:16 -0700 Subject: [PATCH 01/11] [cpack_installer] remove wxs file ext from lfs filter --- .gitattributes | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 1755def66a..55b43e4ba7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -115,5 +115,4 @@ *.wav filter=lfs diff=lfs merge=lfs -text *.webm filter=lfs diff=lfs merge=lfs -text *.wem filter=lfs diff=lfs merge=lfs -text -*.wxs filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text From c777e2e35301cd0054fe39e8fdccb5e632d48a21 Mon Sep 17 00:00:00 2001 From: scottr Date: Tue, 11 May 2021 18:07:19 -0700 Subject: [PATCH 02/11] [cpack_installer] some cpack cleanup and prep for online installer support (pre/post build steps) --- cmake/Packaging.cmake | 38 ++++++++++++------- .../Platform/Windows/PackagingPostBuild.cmake | 12 ++++++ .../Platform/Windows/Packaging_windows.cmake | 8 +++- .../Windows/platform_windows_files.cmake | 1 + 4 files changed, 43 insertions(+), 16 deletions(-) create mode 100644 cmake/Platform/Windows/PackagingPostBuild.cmake diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake index 4f6565edc7..e398ea7509 100644 --- a/cmake/Packaging.cmake +++ b/cmake/Packaging.cmake @@ -13,6 +13,30 @@ if(NOT PAL_TRAIT_BUILD_CPACK_SUPPORTED) return() endif() +# set the common cpack variables first so they are accessible via configure_file +# when the platforms specific properties are applied below +set(LY_INSTALLER_DOWNLOAD_URL "" CACHE PATH "URL embded into the installer to download additional artifacts") + +set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}") +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") + +set(DEFAULT_LICENSE_NAME "Apache-2.0") +set(DEFAULT_LICENSE_FILE "${CMAKE_SOURCE_DIR}/LICENSE.txt") + +set(CPACK_RESOURCE_FILE_LICENSE ${DEFAULT_LICENSE_FILE}) + +set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_VERSION}") + +# custom cpack cache variables for use in pre/post build scripts +set(CPACK_SOURCE_DIR ${CMAKE_SOURCE_DIR}/cmake) +set(CPACK_BINARY_DIR ${CMAKE_BINARY_DIR}/installer) +set(CPACK_DOWNLOAD_URL ${LY_INSTALLER_DOWNLOAD_URL}) + +# attempt to apply platform specific settings ly_get_absolute_pal_filename(pal_dir ${CMAKE_SOURCE_DIR}/cmake/Platform/${PAL_HOST_PLATFORM_NAME}) include(${pal_dir}/Packaging_${PAL_HOST_PLATFORM_NAME_LOWERCASE}.cmake) @@ -21,20 +45,6 @@ if(NOT CPACK_GENERATOR) return() endif() -set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}") -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}_installer") - -set(DEFAULT_LICENSE_NAME "Apache-2.0") -set(DEFAULT_LICENSE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") - -set(CPACK_RESOURCE_FILE_LICENSE ${DEFAULT_LICENSE_FILE}) - -set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_VERSION}") - # IMPORTANT: required to be included AFTER setting all property overrides include(CPack REQUIRED) diff --git a/cmake/Platform/Windows/PackagingPostBuild.cmake b/cmake/Platform/Windows/PackagingPostBuild.cmake new file mode 100644 index 0000000000..fe57904003 --- /dev/null +++ b/cmake/Platform/Windows/PackagingPostBuild.cmake @@ -0,0 +1,12 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +message(STATUS "Hello from CPack post build!") diff --git a/cmake/Platform/Windows/Packaging_windows.cmake b/cmake/Platform/Windows/Packaging_windows.cmake index 8aa6f2386d..ba3ce011a4 100644 --- a/cmake/Platform/Windows/Packaging_windows.cmake +++ b/cmake/Platform/Windows/Packaging_windows.cmake @@ -32,7 +32,7 @@ set(CPACK_GENERATOR "WIX") # however, they are unique for each run. instead, let's do the auto generation here and add it to # the cache for run persistence. an additional cache file will be used to store the information on # the original generation so we still have the ability to detect if they are still being used. -set(_guid_cache_file "${CMAKE_BINARY_DIR}/installer/wix_guid_cache.cmake") +set(_guid_cache_file "${CPACK_BINARY_DIR}/wix_guid_cache.cmake") if(NOT EXISTS ${_guid_cache_file}) set(_wix_guid_namespace "6D43F57A-2917-4AD9-B758-1F13CDB08593") @@ -89,4 +89,8 @@ endif() set(CPACK_WIX_PRODUCT_GUID ${LY_WIX_PRODUCT_GUID}) set(CPACK_WIX_UPGRADE_GUID ${LY_WIX_UPGRADE_GUID}) -set(CPACK_WIX_TEMPLATE "${CMAKE_SOURCE_DIR}/cmake/Platform/Windows/PackagingTemplate.wxs.in") +set(CPACK_WIX_TEMPLATE "${CPACK_SOURCE_DIR}/Platform/Windows/PackagingTemplate.wxs.in") + +set(CPACK_POST_BUILD_SCRIPTS + ${CPACK_SOURCE_DIR}/Platform/Windows/PackagingPostBuild.cmake +) diff --git a/cmake/Platform/Windows/platform_windows_files.cmake b/cmake/Platform/Windows/platform_windows_files.cmake index 2fc869b43e..579621d5ea 100644 --- a/cmake/Platform/Windows/platform_windows_files.cmake +++ b/cmake/Platform/Windows/platform_windows_files.cmake @@ -24,5 +24,6 @@ set(FILES PALDetection_windows.cmake Install_windows.cmake Packaging_windows.cmake + PackagingPostBuild.cmake PackagingTemplate.wxs.in ) From 6d7f7547ec6a64c34258dfcb54db9abc6754602f Mon Sep 17 00:00:00 2001 From: scottr Date: Fri, 14 May 2021 08:20:59 -0700 Subject: [PATCH 03/11] [cpack_installer] fix incorrect caching type of installer download url and add configure of download info --- cmake/Packaging.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake index e398ea7509..188cfbf52d 100644 --- a/cmake/Packaging.cmake +++ b/cmake/Packaging.cmake @@ -15,7 +15,7 @@ endif() # set the common cpack variables first so they are accessible via configure_file # when the platforms specific properties are applied below -set(LY_INSTALLER_DOWNLOAD_URL "" CACHE PATH "URL embded into the installer to download additional artifacts") +set(LY_INSTALLER_DOWNLOAD_URL "" CACHE STRING "URL embded into the installer to download additional artifacts") set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}") set(CPACK_PACKAGE_VERSION "${LY_VERSION_STRING}") @@ -34,7 +34,6 @@ set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_VER # custom cpack cache variables for use in pre/post build scripts set(CPACK_SOURCE_DIR ${CMAKE_SOURCE_DIR}/cmake) set(CPACK_BINARY_DIR ${CMAKE_BINARY_DIR}/installer) -set(CPACK_DOWNLOAD_URL ${LY_INSTALLER_DOWNLOAD_URL}) # attempt to apply platform specific settings ly_get_absolute_pal_filename(pal_dir ${CMAKE_SOURCE_DIR}/cmake/Platform/${PAL_HOST_PLATFORM_NAME}) @@ -86,3 +85,11 @@ ly_configure_cpack_component( DISPLAY_NAME "${PROJECT_NAME} Core" DESCRIPTION "${PROJECT_NAME} Headers, Libraries and Tools" ) + +if(LY_INSTALLER_DOWNLOAD_URL) + cpack_configure_downloads( + ${LY_INSTALLER_DOWNLOAD_URL} + UPLOAD_DIRECTORY artifacts + ALL + ) +endif() From f6b1fac139f649062e6f9595e0476b5299439cad Mon Sep 17 00:00:00 2001 From: scottr Date: Fri, 14 May 2021 12:03:20 -0700 Subject: [PATCH 04/11] [cpack_installer] initial bootstrap installer generation, this bootstrapper is what downloads the artifacts --- .../Windows/PackagingBootstrapper.wxs | 36 ++++++++++++++ .../Platform/Windows/PackagingPostBuild.cmake | 47 ++++++++++++++++++- .../Platform/Windows/PackagingTemplate.wxs.in | 4 +- .../Platform/Windows/Packaging_windows.cmake | 14 +++++- .../Windows/platform_windows_files.cmake | 1 + 5 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 cmake/Platform/Windows/PackagingBootstrapper.wxs diff --git a/cmake/Platform/Windows/PackagingBootstrapper.wxs b/cmake/Platform/Windows/PackagingBootstrapper.wxs new file mode 100644 index 0000000000..711b60d854 --- /dev/null +++ b/cmake/Platform/Windows/PackagingBootstrapper.wxs @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/cmake/Platform/Windows/PackagingPostBuild.cmake b/cmake/Platform/Windows/PackagingPostBuild.cmake index fe57904003..064fb0d530 100644 --- a/cmake/Platform/Windows/PackagingPostBuild.cmake +++ b/cmake/Platform/Windows/PackagingPostBuild.cmake @@ -9,4 +9,49 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -message(STATUS "Hello from CPack post build!") +# convert the path to a windows style path +string(REPLACE "/" "\\" _install_dir ${CPACK_PACKAGE_INSTALL_DIRECTORY}) + +# directory where the auto generated files live e.g /_CPack_Package/win64/WIX +set(_cpack_out_dir "${CPACK_TOPLEVEL_DIRECTORY}") +set(_out_dir "${CPACK_BINARY_DIR}/wixobj_bootstrap") + +set(_wix_ext_flags + -ext WixBalExtension +) + +set(_candle_command + ${CPACK_WIX_ROOT}/bin/candle.exe + -nologo + -arch x64 + "-I${_cpack_out_dir}" + ${_wix_ext_flags} + + -dCPACK_DOWNLOAD_SITE=${CPACK_DOWNLOAD_SITE} + -dCPACK_LOCAL_INSTALLER_DIR=${_cpack_out_dir} + -dCPACK_PACKAGE_FILE_NAME=${CPACK_PACKAGE_FILE_NAME} + -dCPACK_PACKAGE_INSTALL_DIRECTORY=${_install_dir} + + "${CPACK_SOURCE_DIR}/Platform/Windows/PackagingBootstrapper.wxs" + + -o "${_out_dir}" +) + +set(_light_command + ${CPACK_WIX_ROOT}/bin/light.exe + -nologo + ${_wix_ext_flags} + ${_out_dir}/*.wixobj + + -o "${CPACK_BINARY_DIR}/installer.exe" +) + +message(STATUS "Creating Installer Bootstrapper...") + +execute_process( + COMMAND + ${_candle_command} + + COMMAND + ${_light_command} +) diff --git a/cmake/Platform/Windows/PackagingTemplate.wxs.in b/cmake/Platform/Windows/PackagingTemplate.wxs.in index 3e5db03ec2..fd3610259a 100644 --- a/cmake/Platform/Windows/PackagingTemplate.wxs.in +++ b/cmake/Platform/Windows/PackagingTemplate.wxs.in @@ -14,8 +14,8 @@ - - + + Date: Mon, 17 May 2021 15:28:32 -0700 Subject: [PATCH 05/11] [cpack_installer] cpack variable usage cleanup --- cmake/Packaging.cmake | 8 +-- .../Platform/Windows/PackagingPostBuild.cmake | 58 ++++++++++--------- .../Platform/Windows/Packaging_windows.cmake | 2 +- 3 files changed, 36 insertions(+), 32 deletions(-) diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake index 188cfbf52d..72216847f1 100644 --- a/cmake/Packaging.cmake +++ b/cmake/Packaging.cmake @@ -31,12 +31,12 @@ set(CPACK_RESOURCE_FILE_LICENSE ${DEFAULT_LICENSE_FILE}) set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_VERSION}") -# custom cpack cache variables for use in pre/post build scripts +# CMAKE_SOURCE_DIR doesn't equate to anything during execution of pre/post build scripts. +# to pass it down, we can utilize the auto-caching of any variable with prefix "CPACK_" set(CPACK_SOURCE_DIR ${CMAKE_SOURCE_DIR}/cmake) -set(CPACK_BINARY_DIR ${CMAKE_BINARY_DIR}/installer) # attempt to apply platform specific settings -ly_get_absolute_pal_filename(pal_dir ${CMAKE_SOURCE_DIR}/cmake/Platform/${PAL_HOST_PLATFORM_NAME}) +ly_get_absolute_pal_filename(pal_dir ${CPACK_SOURCE_DIR}/Platform/${PAL_HOST_PLATFORM_NAME}) include(${pal_dir}/Packaging_${PAL_HOST_PLATFORM_NAME_LOWERCASE}.cmake) # if we get here and the generator hasn't been set, then a non fatal error occurred disabling packaging support @@ -89,7 +89,7 @@ ly_configure_cpack_component( if(LY_INSTALLER_DOWNLOAD_URL) cpack_configure_downloads( ${LY_INSTALLER_DOWNLOAD_URL} - UPLOAD_DIRECTORY artifacts + UPLOAD_DIRECTORY ${CMAKE_BINARY_DIR}/_CPack_Uploads # to match the _CPack_Packages directory ALL ) endif() diff --git a/cmake/Platform/Windows/PackagingPostBuild.cmake b/cmake/Platform/Windows/PackagingPostBuild.cmake index 064fb0d530..5262b42beb 100644 --- a/cmake/Platform/Windows/PackagingPostBuild.cmake +++ b/cmake/Platform/Windows/PackagingPostBuild.cmake @@ -9,49 +9,53 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# convert the path to a windows style path -string(REPLACE "/" "\\" _install_dir ${CPACK_PACKAGE_INSTALL_DIRECTORY}) +# convert the path to a windows style path using string replace because TO_NATIVE_PATH +# only works on real paths +string(REPLACE "/" "\\" _fixed_package_install_dir ${CPACK_PACKAGE_INSTALL_DIRECTORY}) # directory where the auto generated files live e.g /_CPack_Package/win64/WIX -set(_cpack_out_dir "${CPACK_TOPLEVEL_DIRECTORY}") -set(_out_dir "${CPACK_BINARY_DIR}/wixobj_bootstrap") +set(_cpack_wix_out_dir ${CPACK_TOPLEVEL_DIRECTORY}) +set(_bootstrap_out_dir "${CPACK_TOPLEVEL_DIRECTORY}/bootstrap") -set(_wix_ext_flags +set(_bootstrap_filename "${CPACK_PACKAGE_FILE_NAME}.exe") +set(_bootstrap_output_file ${_cpack_wix_out_dir}/${_bootstrap_filename}) + +set(_ext_flags -ext WixBalExtension ) +set(_addtional_defines + -dCPACK_DOWNLOAD_SITE=${CPACK_DOWNLOAD_SITE} + -dCPACK_LOCAL_INSTALLER_DIR=${_cpack_wix_out_dir} + -dCPACK_PACKAGE_FILE_NAME=${CPACK_PACKAGE_FILE_NAME} + -dCPACK_PACKAGE_INSTALL_DIRECTORY=${_fixed_package_install_dir} +) + set(_candle_command - ${CPACK_WIX_ROOT}/bin/candle.exe + ${CPACK_WIX_CANDLE_EXECUTABLE} -nologo -arch x64 - "-I${_cpack_out_dir}" - ${_wix_ext_flags} - - -dCPACK_DOWNLOAD_SITE=${CPACK_DOWNLOAD_SITE} - -dCPACK_LOCAL_INSTALLER_DIR=${_cpack_out_dir} - -dCPACK_PACKAGE_FILE_NAME=${CPACK_PACKAGE_FILE_NAME} - -dCPACK_PACKAGE_INSTALL_DIRECTORY=${_install_dir} - + "-I${_cpack_wix_out_dir}" # to include cpack_variables.wxi + ${_addtional_defines} + ${_ext_flags} "${CPACK_SOURCE_DIR}/Platform/Windows/PackagingBootstrapper.wxs" - - -o "${_out_dir}" + -o "${_bootstrap_out_dir}/" ) set(_light_command - ${CPACK_WIX_ROOT}/bin/light.exe + ${CPACK_WIX_LIGHT_EXECUTABLE} -nologo - ${_wix_ext_flags} - ${_out_dir}/*.wixobj - - -o "${CPACK_BINARY_DIR}/installer.exe" + ${_ext_flags} + ${_bootstrap_out_dir}/*.wixobj + -o "${_bootstrap_output_file}" ) message(STATUS "Creating Installer Bootstrapper...") - execute_process( - COMMAND - ${_candle_command} - - COMMAND - ${_light_command} + COMMAND ${_candle_command} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${_light_command} + COMMAND_ERROR_IS_FATAL ANY ) diff --git a/cmake/Platform/Windows/Packaging_windows.cmake b/cmake/Platform/Windows/Packaging_windows.cmake index f8c79e11d5..4044450d4c 100644 --- a/cmake/Platform/Windows/Packaging_windows.cmake +++ b/cmake/Platform/Windows/Packaging_windows.cmake @@ -32,7 +32,7 @@ set(CPACK_GENERATOR "WIX") # however, they are unique for each run. instead, let's do the auto generation here and add it to # the cache for run persistence. an additional cache file will be used to store the information on # the original generation so we still have the ability to detect if they are still being used. -set(_guid_cache_file "${CPACK_BINARY_DIR}/wix_guid_cache.cmake") +set(_guid_cache_file "${CMAKE_BINARY_DIR}/CPackWiXConfig.cmake") if(NOT EXISTS ${_guid_cache_file}) set(_wix_guid_namespace "6D43F57A-2917-4AD9-B758-1F13CDB08593") From 2ddbd36f9a7ff537bb98b05d8894326fc7636c81 Mon Sep 17 00:00:00 2001 From: scottr Date: Mon, 17 May 2021 16:34:24 -0700 Subject: [PATCH 06/11] [cpack_installer] add option to specify license url. replicate online artifacts copy --- cmake/Packaging.cmake | 12 ++++++++---- .../Windows/PackagingBootstrapper.wxs | 18 +++++++++++++----- .../Platform/Windows/PackagingPostBuild.cmake | 19 +++++++++++++++++++ 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake index 72216847f1..0fbd70e54c 100644 --- a/cmake/Packaging.cmake +++ b/cmake/Packaging.cmake @@ -13,10 +13,14 @@ if(NOT PAL_TRAIT_BUILD_CPACK_SUPPORTED) return() endif() -# set the common cpack variables first so they are accessible via configure_file -# when the platforms specific properties are applied below +# public facing options will eventually be converted into cpack specific ones below. +# all variables with the "CPACK_" prefix will automatically be cached for use in any +# of the build steps cpack runs e.g. pre-build, standard build, post-build. set(LY_INSTALLER_DOWNLOAD_URL "" CACHE STRING "URL embded into the installer to download additional artifacts") +set(LY_INSTALLER_LICENSE_URL "" CACHE STRING "Optionally embed a link to the license instead of raw text") +# set all common cpack variable overrides first so they can be accessible via configure_file +# when the platform specific settings are applied below set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}") set(CPACK_PACKAGE_VERSION "${LY_VERSION_STRING}") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Installation Tool") @@ -28,11 +32,11 @@ set(DEFAULT_LICENSE_NAME "Apache-2.0") set(DEFAULT_LICENSE_FILE "${CMAKE_SOURCE_DIR}/LICENSE.txt") set(CPACK_RESOURCE_FILE_LICENSE ${DEFAULT_LICENSE_FILE}) +set(CPACK_LICENSE_URL ${LY_INSTALLER_LICENSE_URL}) set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_VERSION}") -# CMAKE_SOURCE_DIR doesn't equate to anything during execution of pre/post build scripts. -# to pass it down, we can utilize the auto-caching of any variable with prefix "CPACK_" +# CMAKE_SOURCE_DIR doesn't equate to anything during execution of pre/post build scripts set(CPACK_SOURCE_DIR ${CMAKE_SOURCE_DIR}/cmake) # attempt to apply platform specific settings diff --git a/cmake/Platform/Windows/PackagingBootstrapper.wxs b/cmake/Platform/Windows/PackagingBootstrapper.wxs index 711b60d854..f231f05413 100644 --- a/cmake/Platform/Windows/PackagingBootstrapper.wxs +++ b/cmake/Platform/Windows/PackagingBootstrapper.wxs @@ -16,11 +16,19 @@ Value="[ProgramFiles64Folder]$(var.CPACK_PACKAGE_INSTALL_DIRECTORY)" bal:Overridable="yes"/> - - - + + + + + + + + + Date: Mon, 17 May 2021 20:52:06 -0700 Subject: [PATCH 07/11] [cpack_installer] bootstrap installer is copied to root of build directory. uploads directory is cleaned before copied to. --- cmake/Platform/Windows/PackagingPostBuild.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/Platform/Windows/PackagingPostBuild.cmake b/cmake/Platform/Windows/PackagingPostBuild.cmake index bfe725ab3b..cfed90e155 100644 --- a/cmake/Platform/Windows/PackagingPostBuild.cmake +++ b/cmake/Platform/Windows/PackagingPostBuild.cmake @@ -54,7 +54,7 @@ set(_light_command -o "${_bootstrap_output_file}" ) -message(STATUS "Creating Installer Bootstrapper...") +message(STATUS "Creating Bootstrap Installer...") execute_process( COMMAND ${_candle_command} COMMAND_ERROR_IS_FATAL ANY @@ -64,6 +64,12 @@ execute_process( COMMAND_ERROR_IS_FATAL ANY ) +file(COPY ${_bootstrap_output_file} + DESTINATION ${CPACK_PACKAGE_DIRECTORY} +) + +message(STATUS "Bootstrap installer generated to ${CPACK_PACKAGE_DIRECTORY}/${_bootstrap_filename}") + # use the internal default path if somehow not specified from cpack_configure_downloads if(NOT CPACK_UPLOAD_DIRECTORY) set(CPACK_UPLOAD_DIRECTORY ${CPACK_PACKAGE_DIRECTORY}/CPackUploads) @@ -73,6 +79,7 @@ endif() # through cpack_configure_downloads. this mimics the same process cpack does natively for # some other frameworks that have built-in online installer support. message(STATUS "Copying installer artifacts to upload directory...") +file(REMOVE_RECURSE ${CPACK_UPLOAD_DIRECTORY}) file(GLOB _artifacts "${_cpack_wix_out_dir}/*.msi" "${_cpack_wix_out_dir}/*.cab") file(COPY ${_artifacts} DESTINATION ${CPACK_UPLOAD_DIRECTORY} From efbb0077b5c8c79a73aa1a6a77a967e15ed81a19 Mon Sep 17 00:00:00 2001 From: scottr Date: Mon, 17 May 2021 21:43:46 -0700 Subject: [PATCH 08/11] [cpack_installer] configure install to be per machine --- cmake/Platform/Windows/PackagingTemplate.wxs.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Platform/Windows/PackagingTemplate.wxs.in b/cmake/Platform/Windows/PackagingTemplate.wxs.in index fd3610259a..0b3c597ab6 100644 --- a/cmake/Platform/Windows/PackagingTemplate.wxs.in +++ b/cmake/Platform/Windows/PackagingTemplate.wxs.in @@ -12,7 +12,7 @@ Manufacturer="$(var.CPACK_PACKAGE_VENDOR)" UpgradeCode="$(var.CPACK_WIX_UPGRADE_GUID)"> - + From 66ad040102cf1b60bf54dba93826e6a48370c6f3 Mon Sep 17 00:00:00 2001 From: scottr Date: Mon, 17 May 2021 22:51:48 -0700 Subject: [PATCH 09/11] [cpack_installer] some minor comment cleanup --- cmake/Packaging.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake index 0fbd70e54c..8f4e1134b9 100644 --- a/cmake/Packaging.cmake +++ b/cmake/Packaging.cmake @@ -13,14 +13,14 @@ if(NOT PAL_TRAIT_BUILD_CPACK_SUPPORTED) return() endif() -# public facing options will eventually be converted into cpack specific ones below. -# all variables with the "CPACK_" prefix will automatically be cached for use in any -# of the build steps cpack runs e.g. pre-build, standard build, post-build. +# public facing options will be used for conversion into cpack specific ones below. set(LY_INSTALLER_DOWNLOAD_URL "" CACHE STRING "URL embded into the installer to download additional artifacts") set(LY_INSTALLER_LICENSE_URL "" CACHE STRING "Optionally embed a link to the license instead of raw text") # set all common cpack variable overrides first so they can be accessible via configure_file -# when the platform specific settings are applied below +# when the platform specific settings are applied below. additionally, any variable with +# the "CPACK_" prefix will automatically be cached for use in any phase of cpack namely +# pre/post build set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}") set(CPACK_PACKAGE_VERSION "${LY_VERSION_STRING}") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Installation Tool") @@ -91,6 +91,7 @@ ly_configure_cpack_component( ) if(LY_INSTALLER_DOWNLOAD_URL) + # this will set the following variables: CPACK_DOWNLOAD_SITE, CPACK_DOWNLOAD_ALL, and CPACK_UPLOAD_DIRECTORY cpack_configure_downloads( ${LY_INSTALLER_DOWNLOAD_URL} UPLOAD_DIRECTORY ${CMAKE_BINARY_DIR}/_CPack_Uploads # to match the _CPack_Packages directory From b45d01919dac7e4ff096f58ab81c422e99d4faa6 Mon Sep 17 00:00:00 2001 From: scottr Date: Tue, 18 May 2021 00:22:17 -0700 Subject: [PATCH 10/11] [cpack_installer] simplify guid generation by using existing project props instead of timestamp in seed value. add bootstrapper specific guids. --- .../Windows/PackagingBootstrapper.wxs | 2 +- .../Platform/Windows/PackagingPostBuild.cmake | 1 + .../Platform/Windows/Packaging_windows.cmake | 42 ++++++++----------- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/cmake/Platform/Windows/PackagingBootstrapper.wxs b/cmake/Platform/Windows/PackagingBootstrapper.wxs index f231f05413..c3d1dd7a7b 100644 --- a/cmake/Platform/Windows/PackagingBootstrapper.wxs +++ b/cmake/Platform/Windows/PackagingBootstrapper.wxs @@ -8,7 +8,7 @@ Date: Tue, 18 May 2021 11:50:01 -0700 Subject: [PATCH 11/11] [cpack_installer] fixed typo in help string --- cmake/Packaging.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake index 8f4e1134b9..ba610b1883 100644 --- a/cmake/Packaging.cmake +++ b/cmake/Packaging.cmake @@ -14,7 +14,7 @@ if(NOT PAL_TRAIT_BUILD_CPACK_SUPPORTED) endif() # public facing options will be used for conversion into cpack specific ones below. -set(LY_INSTALLER_DOWNLOAD_URL "" CACHE STRING "URL embded into the installer to download additional artifacts") +set(LY_INSTALLER_DOWNLOAD_URL "" CACHE STRING "URL embedded into the installer to download additional artifacts") set(LY_INSTALLER_LICENSE_URL "" CACHE STRING "Optionally embed a link to the license instead of raw text") # set all common cpack variable overrides first so they can be accessible via configure_file