From 9788caa6cb2b81f92c97f34d1683f5cfa2a52f54 Mon Sep 17 00:00:00 2001 From: scottr Date: Wed, 19 May 2021 13:48:02 -0700 Subject: [PATCH 1/4] [cpack_installer] move non-cmake packaging resources into their own folder --- .../{PackagingBootstrapper.wxs => Packaging/Bootstrapper.wxs} | 0 .../{PackagingTemplate.wxs.in => Packaging/Template.wxs.in} | 0 cmake/Platform/Windows/PackagingPostBuild.cmake | 2 +- cmake/Platform/Windows/Packaging_windows.cmake | 2 +- cmake/Platform/Windows/platform_windows_files.cmake | 4 ++-- 5 files changed, 4 insertions(+), 4 deletions(-) rename cmake/Platform/Windows/{PackagingBootstrapper.wxs => Packaging/Bootstrapper.wxs} (100%) rename cmake/Platform/Windows/{PackagingTemplate.wxs.in => Packaging/Template.wxs.in} (100%) diff --git a/cmake/Platform/Windows/PackagingBootstrapper.wxs b/cmake/Platform/Windows/Packaging/Bootstrapper.wxs similarity index 100% rename from cmake/Platform/Windows/PackagingBootstrapper.wxs rename to cmake/Platform/Windows/Packaging/Bootstrapper.wxs diff --git a/cmake/Platform/Windows/PackagingTemplate.wxs.in b/cmake/Platform/Windows/Packaging/Template.wxs.in similarity index 100% rename from cmake/Platform/Windows/PackagingTemplate.wxs.in rename to cmake/Platform/Windows/Packaging/Template.wxs.in diff --git a/cmake/Platform/Windows/PackagingPostBuild.cmake b/cmake/Platform/Windows/PackagingPostBuild.cmake index 3ba6ef2096..dbc54528b6 100644 --- a/cmake/Platform/Windows/PackagingPostBuild.cmake +++ b/cmake/Platform/Windows/PackagingPostBuild.cmake @@ -43,7 +43,7 @@ set(_candle_command "-I${_cpack_wix_out_dir}" # to include cpack_variables.wxi ${_addtional_defines} ${_ext_flags} - "${CPACK_SOURCE_DIR}/Platform/Windows/PackagingBootstrapper.wxs" + "${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/Bootstrapper.wxs" -o "${_bootstrap_out_dir}/" ) diff --git a/cmake/Platform/Windows/Packaging_windows.cmake b/cmake/Platform/Windows/Packaging_windows.cmake index 2ea35c1d9b..3b99992ad3 100644 --- a/cmake/Platform/Windows/Packaging_windows.cmake +++ b/cmake/Platform/Windows/Packaging_windows.cmake @@ -78,7 +78,7 @@ endif() set(CPACK_WIX_PRODUCT_GUID ${LY_WIX_PRODUCT_GUID}) set(CPACK_WIX_UPGRADE_GUID ${LY_WIX_UPGRADE_GUID}) -set(CPACK_WIX_TEMPLATE "${CPACK_SOURCE_DIR}/Platform/Windows/PackagingTemplate.wxs.in") +set(CPACK_WIX_TEMPLATE "${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/Template.wxs.in") set(_embed_artifacts "yes") diff --git a/cmake/Platform/Windows/platform_windows_files.cmake b/cmake/Platform/Windows/platform_windows_files.cmake index 84d1a3098c..b760a8760d 100644 --- a/cmake/Platform/Windows/platform_windows_files.cmake +++ b/cmake/Platform/Windows/platform_windows_files.cmake @@ -24,7 +24,7 @@ set(FILES PALDetection_windows.cmake Install_windows.cmake Packaging_windows.cmake - PackagingBootstrapper.wxs PackagingPostBuild.cmake - PackagingTemplate.wxs.in + Packaging/Bootstrapper.wxs + Packaging/Template.wxs.in ) From 3d4d63ab1d8b974a4e17ed0f4601111984358c85 Mon Sep 17 00:00:00 2001 From: scottr Date: Wed, 19 May 2021 14:08:38 -0700 Subject: [PATCH 2/4] [cpack_installer] installer product icons --- cmake/Platform/Windows/Packaging/Bootstrapper.wxs | 3 +++ cmake/Platform/Windows/Packaging/product_icon.ico | 3 +++ cmake/Platform/Windows/Packaging/product_logo.png | 3 +++ cmake/Platform/Windows/PackagingPostBuild.cmake | 1 + cmake/Platform/Windows/Packaging_windows.cmake | 3 +++ 5 files changed, 13 insertions(+) create mode 100644 cmake/Platform/Windows/Packaging/product_icon.ico create mode 100644 cmake/Platform/Windows/Packaging/product_logo.png diff --git a/cmake/Platform/Windows/Packaging/Bootstrapper.wxs b/cmake/Platform/Windows/Packaging/Bootstrapper.wxs index c3d1dd7a7b..55e8a8cd95 100644 --- a/cmake/Platform/Windows/Packaging/Bootstrapper.wxs +++ b/cmake/Platform/Windows/Packaging/Bootstrapper.wxs @@ -9,6 +9,7 @@ Version="$(var.CPACK_PACKAGE_VERSION)" Manufacturer="$(var.CPACK_PACKAGE_VENDOR)" UpgradeCode="$(var.CPACK_BOOTSTRAP_UPGRADE_GUID)" + IconSourceFile="$(var.CPACK_WIX_PRODUCT_ICON)" DisableModify="yes"> diff --git a/cmake/Platform/Windows/Packaging/product_icon.ico b/cmake/Platform/Windows/Packaging/product_icon.ico new file mode 100644 index 0000000000..0680ceea19 --- /dev/null +++ b/cmake/Platform/Windows/Packaging/product_icon.ico @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c042fce57915fc749abc7b37de765fd697c3c4d7de045a3d44805aa0ce29901a +size 107016 diff --git a/cmake/Platform/Windows/Packaging/product_logo.png b/cmake/Platform/Windows/Packaging/product_logo.png new file mode 100644 index 0000000000..d5fd60ffb8 --- /dev/null +++ b/cmake/Platform/Windows/Packaging/product_logo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac0348c906c91de864cba91c0231b4794d8a00fafa630d13f2232351b90aa59b +size 11074 diff --git a/cmake/Platform/Windows/PackagingPostBuild.cmake b/cmake/Platform/Windows/PackagingPostBuild.cmake index dbc54528b6..d379358bf4 100644 --- a/cmake/Platform/Windows/PackagingPostBuild.cmake +++ b/cmake/Platform/Windows/PackagingPostBuild.cmake @@ -30,6 +30,7 @@ set(_addtional_defines -dCPACK_LOCAL_INSTALLER_DIR=${_cpack_wix_out_dir} -dCPACK_PACKAGE_FILE_NAME=${CPACK_PACKAGE_FILE_NAME} -dCPACK_PACKAGE_INSTALL_DIRECTORY=${_fixed_package_install_dir} + -dCPACK_WIX_PRODUCT_LOGO=${CPACK_WIX_PRODUCT_LOGO} ) if(CPACK_LICENSE_URL) diff --git a/cmake/Platform/Windows/Packaging_windows.cmake b/cmake/Platform/Windows/Packaging_windows.cmake index 3b99992ad3..8504447d4f 100644 --- a/cmake/Platform/Windows/Packaging_windows.cmake +++ b/cmake/Platform/Windows/Packaging_windows.cmake @@ -78,6 +78,9 @@ endif() set(CPACK_WIX_PRODUCT_GUID ${LY_WIX_PRODUCT_GUID}) set(CPACK_WIX_UPGRADE_GUID ${LY_WIX_UPGRADE_GUID}) +set(CPACK_WIX_PRODUCT_LOGO ${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/product_logo.png) +set(CPACK_WIX_PRODUCT_ICON ${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/product_icon.ico) + set(CPACK_WIX_TEMPLATE "${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/Template.wxs.in") set(_embed_artifacts "yes") From e0cb0fec9b8fba61ffbe0ceb4e5f00a0263a3d2b Mon Sep 17 00:00:00 2001 From: scottr Date: Wed, 19 May 2021 19:39:52 -0700 Subject: [PATCH 3/4] [cpack_installer] add desktop and start menu shortcuts --- .../Platform/Windows/Packaging/Shortcuts.wxs | 68 +++++++++++++++++++ .../Windows/Packaging/Template.wxs.in | 5 +- .../Platform/Windows/Packaging_windows.cmake | 4 ++ .../Windows/platform_windows_files.cmake | 1 + 4 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 cmake/Platform/Windows/Packaging/Shortcuts.wxs diff --git a/cmake/Platform/Windows/Packaging/Shortcuts.wxs b/cmake/Platform/Windows/Packaging/Shortcuts.wxs new file mode 100644 index 0000000000..fb9d359b5a --- /dev/null +++ b/cmake/Platform/Windows/Packaging/Shortcuts.wxs @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cmake/Platform/Windows/Packaging/Template.wxs.in b/cmake/Platform/Windows/Packaging/Template.wxs.in index 0b3c597ab6..2900b96f41 100644 --- a/cmake/Platform/Windows/Packaging/Template.wxs.in +++ b/cmake/Platform/Windows/Packaging/Template.wxs.in @@ -38,7 +38,10 @@ - + + + + diff --git a/cmake/Platform/Windows/Packaging_windows.cmake b/cmake/Platform/Windows/Packaging_windows.cmake index 8504447d4f..204d59852a 100644 --- a/cmake/Platform/Windows/Packaging_windows.cmake +++ b/cmake/Platform/Windows/Packaging_windows.cmake @@ -83,6 +83,10 @@ set(CPACK_WIX_PRODUCT_ICON ${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/produc set(CPACK_WIX_TEMPLATE "${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/Template.wxs.in") +set(CPACK_WIX_EXTRA_SOURCES + "${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/Shortcuts.wxs" +) + set(_embed_artifacts "yes") if(LY_INSTALLER_DOWNLOAD_URL) diff --git a/cmake/Platform/Windows/platform_windows_files.cmake b/cmake/Platform/Windows/platform_windows_files.cmake index b760a8760d..3ce53fbcea 100644 --- a/cmake/Platform/Windows/platform_windows_files.cmake +++ b/cmake/Platform/Windows/platform_windows_files.cmake @@ -26,5 +26,6 @@ set(FILES Packaging_windows.cmake PackagingPostBuild.cmake Packaging/Bootstrapper.wxs + Packaging/Shortcuts.wxs Packaging/Template.wxs.in ) From d83d9c9bff49e3ce064e2c171ab5017ca1d2272c Mon Sep 17 00:00:00 2001 From: scottr Date: Wed, 19 May 2021 20:26:27 -0700 Subject: [PATCH 4/4] [cpack_installer] fixed issue with applying default installer GUIDs when seed property changes --- .../Platform/Windows/Packaging_windows.cmake | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/cmake/Platform/Windows/Packaging_windows.cmake b/cmake/Platform/Windows/Packaging_windows.cmake index 204d59852a..ce73e9a07b 100644 --- a/cmake/Platform/Windows/Packaging_windows.cmake +++ b/cmake/Platform/Windows/Packaging_windows.cmake @@ -48,29 +48,28 @@ set(_guid_seed_base "${PROJECT_NAME}_${LY_VERSION_STRING}") generate_wix_guid(_wix_default_product_guid "${_guid_seed_base}_ProductID" ) generate_wix_guid(_wix_default_upgrade_guid "${_guid_seed_base}_UpgradeCode") -set(LY_WIX_PRODUCT_GUID "${_wix_default_product_guid}" CACHE STRING "GUID for the Product ID field. Format: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX") -set(LY_WIX_UPGRADE_GUID "${_wix_default_upgrade_guid}" CACHE STRING "GUID for the Upgrade Code field. Format: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX") +set(LY_WIX_PRODUCT_GUID "" CACHE STRING "GUID for the Product ID field. Format: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX") +set(LY_WIX_UPGRADE_GUID "" CACHE STRING "GUID for the Upgrade Code field. Format: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX") -set(_uses_default_product_guid FALSE) -if(NOT LY_WIX_PRODUCT_GUID OR LY_WIX_PRODUCT_GUID STREQUAL ${_wix_default_product_guid}) - set(_uses_default_product_guid TRUE) - set(LY_WIX_PRODUCT_GUID ${_wix_default_product_guid}) +# clear previously cached default values to correct future runs. this will +# unfortunately only work if the seed properties still haven't changed +if(LY_WIX_PRODUCT_GUID STREQUAL ${_wix_default_product_guid}) + unset(LY_WIX_PRODUCT_GUID CACHE) +endif() +if(LY_WIX_UPGRADE_GUID STREQUAL ${_wix_default_upgrade_guid}) + unset(LY_WIX_UPGRADE_GUID CACHE) endif() -set(_uses_default_upgrade_guid FALSE) -if(NOT LY_WIX_UPGRADE_GUID OR LY_WIX_UPGRADE_GUID STREQUAL ${_wix_default_upgrade_guid}) - set(_uses_default_upgrade_guid TRUE) - set(LY_WIX_UPGRADE_GUID ${_wix_default_upgrade_guid}) -endif() - -if(_uses_default_product_guid OR _uses_default_upgrade_guid) +if(NOT (LY_WIX_PRODUCT_GUID AND LY_WIX_UPGRADE_GUID)) message(STATUS "One or both WiX GUIDs were auto generated. It is recommended you supply your own GUIDs through LY_WIX_PRODUCT_GUID and LY_WIX_UPGRADE_GUID.") - if(_uses_default_product_guid) + if(NOT LY_WIX_PRODUCT_GUID) + set(LY_WIX_PRODUCT_GUID ${_wix_default_product_guid}) message(STATUS "-> Default LY_WIX_PRODUCT_GUID = ${LY_WIX_PRODUCT_GUID}") endif() - if(_uses_default_upgrade_guid) + if(NOT LY_WIX_UPGRADE_GUID) + set(LY_WIX_UPGRADE_GUID ${_wix_default_upgrade_guid}) message(STATUS "-> Default LY_WIX_UPGRADE_GUID = ${LY_WIX_UPGRADE_GUID}") endif() endif()