IFW Generator: Hierarchy is not preserved in maintenance tool for groups that are not installed
In online installers created using the IFW generator, group hierarchy is not preserved in the maintenance tool for groups that are not installed.
Steps to reproduce: create the installer, install only the components from one group, run the maintenance tool in the installation directory.
This is a minimal example to show the issue.
cmake_minimum_required(VERSION 3.5)
project(test_installer NONE)
# Force IFW generator
set(CPACK_GENERATOR IFW)
# If not set, all components will be merged in the group
set(CPACK_COMPONENTS_GROUPING IGNORE)
if(WIN32 AND CMAKE_GENERATOR MATCHES "^Visual Studio")
if(CMAKE_GENERATOR_PLATFORM MATCHES "x64" OR CMAKE_GENERATOR MATCHES "Win64")
string(APPEND CPACK_SYSTEM_NAME x86_amd64)
elseif(NOT CMAKE_GENERATOR MATCHES "ARM")
string(APPEND CPACK_SYSTEM_NAME x86)
endif()
endif()
set(CPACK_IFW_PACKAGE_GROUP root)
include(CPack)
include(CPackIFW)
# Add root component
cpack_add_component_group(root EXPANDED)
cpack_ifw_configure_component_group(root NAME org.foo.installer)
# Add some groups
foreach(_g g1 g2 g3)
cpack_add_component_group(${_g} PARENT_GROUP root)
cpack_ifw_configure_component_group(${_g} NAME org.foo.installer.${_g})
foreach(_f a b c d)
# Add some components
file(WRITE "${CMAKE_BINARY_DIR}/${_g}/${_f}.txt" "${_f}.txt contents\n")
install(FILES "${CMAKE_BINARY_DIR}/${_g}/${_f}.txt"
DESTINATION ${_g}
COMPONENT ${_g}_${_f})
cpack_add_component(${_g}_${_f}
DISABLED
GROUP ${_g}
DOWNLOADED)
cpack_ifw_configure_component(${_g}_${_f} NAME org.foo.installer.${_g}.${_f})
endforeach()
endforeach()
# Configure the repository
cpack_ifw_add_repository(repo URL "file:///${CMAKE_BINARY_DIR}/_CPack_Packages/${CPACK_SYSTEM_NAME}/IFW/${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}/repository")