InnoSetup: Marking a component as REQUIRED makes it disabled and not installable
Consider the following fairly minimal reproducer project:
cmake_minimum_required(VERSION 3.27)
project(MyProj VERSION 1.3.29)
add_executable(MainApp main.cpp)
install(TARGETS MainApp COMPONENT Main)
set(CPACK_PACKAGE_NAME MyProj)
set(CPACK_PACKAGE_VENDOR MyCompany)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Example Inno Setup project")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_VERBATIM_VARIABLES YES)
set(CPACK_GENERATOR INNOSETUP)
include(CPack)
cpack_add_component(Main REQUIRED)
If you build that project and run cpack
in the build directory, it will produce a valid installer. If you then try to install that package, the dialog presented to you will show the Main
component, but it will be both unchecked and disabled. The result is that the Main
component cannot be installed, even though it has been marked as REQUIRED
.