diff --git a/cmake/macros/GenerateInstallers.cmake b/cmake/macros/GenerateInstallers.cmake index c44d76da70..82ce52f02c 100644 --- a/cmake/macros/GenerateInstallers.cmake +++ b/cmake/macros/GenerateInstallers.cmake @@ -29,10 +29,7 @@ macro(GENERATE_INSTALLERS) # install the uninstaller icon and reference it for Add/Remove icon set(ADD_REMOVE_ICON_NAME "add-remove.ico") - install( - FILES "${HF_CMAKE_DIR}/installer/${ADD_REMOVE_ICON_NAME}" - DESTINATION "." - ) + set(ADD_REMOVE_ICON_PATH "${HF_CMAKE_DIR}/installer/${ADD_REMOVE_ICON_NAME}") set(CPACK_NSIS_INSTALLED_ICON_NAME ${ADD_REMOVE_ICON_NAME}) # use macro to put backslashes in header image path since nsis requires them diff --git a/cmake/templates/CPackProperties.cmake.in b/cmake/templates/CPackProperties.cmake.in index e2d0c239a9..bf1a4ec033 100644 --- a/cmake/templates/CPackProperties.cmake.in +++ b/cmake/templates/CPackProperties.cmake.in @@ -28,3 +28,4 @@ set(CONSOLE_STARTUP_REG_KEY "@CONSOLE_STARTUP_REG_KEY@") set(LAUNCH_NOW_REG_KEY "@LAUNCH_NOW_REG_KEY@") set(INSTALLER_HEADER_IMAGE "@INSTALLER_HEADER_IMAGE@") set(UNINSTALLER_HEADER_IMAGE "@UNINSTALLER_HEADER_IMAGE@") +set(ADD_REMOVE_ICON_PATH "@ADD_REMOVE_ICON_PATH@") diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index 49db02c928..027520cdd9 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -721,6 +721,9 @@ Section "-Core installation" Call ConditionalAddToRegisty !endif + ; Package the add/remove icon file + File "@ADD_REMOVE_ICON_PATH@" + ; Optional registration Push "DisplayIcon" Push "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@"