mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
CPack/NSIS: Add option to not display component selection page
Fixes: #27754
This commit is contained in:
@@ -249,3 +249,9 @@ on Windows Nullsoft Scriptable Install System.
|
||||
allowing an install.
|
||||
Allowed values for this variable are ``on``, ``off``, and ``force``.
|
||||
If not specified, the default behavior is ``on``.
|
||||
|
||||
.. variable:: CPACK_NSIS_IGNORE_COMPONENTS_PAGE
|
||||
|
||||
.. versionadded:: 4.4
|
||||
|
||||
If set, do not display the page containing the license during installation.
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
nsis_ignore_components_page
|
||||
---------------------------
|
||||
|
||||
* The :cpack_gen:`CPack NSIS Generator` gained a new variable
|
||||
:variable:`CPACK_NSIS_IGNORE_COMPONENTS_PAGE` to ignore the
|
||||
component selection page in the installer.
|
||||
@@ -375,8 +375,10 @@ int cmCPackNSISGenerator::PackageFiles()
|
||||
}
|
||||
|
||||
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLATION_TYPES", installTypesCode);
|
||||
this->SetOptionIfNotSet("CPACK_NSIS_PAGE_COMPONENTS",
|
||||
"!insertmacro MUI_PAGE_COMPONENTS");
|
||||
if (!this->IsSet("CPACK_NSIS_IGNORE_COMPONENTS_PAGE")) {
|
||||
this->SetOptionIfNotSet("CPACK_NSIS_PAGE_COMPONENTS",
|
||||
"!insertmacro MUI_PAGE_COMPONENTS");
|
||||
}
|
||||
this->SetOptionIfNotSet("CPACK_NSIS_FULL_INSTALL", "");
|
||||
this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTIONS", componentCode);
|
||||
this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTION_LIST", sectionList);
|
||||
|
||||
@@ -40,6 +40,7 @@ set(CPACK_NSIS_MANIFEST_DPI_AWARE ON)
|
||||
set(CPACK_NSIS_BRANDING_TEXT "CMake branding text")
|
||||
set(CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION "RIGHT")
|
||||
set(CPACK_NSIS_IGNORE_LICENSE_PAGE ON)
|
||||
set(CPACK_NSIS_IGNORE_COMPONENTS_PAGE ON)
|
||||
set(CPACK_NSIS_CRC_CHECK "off")
|
||||
|
||||
include(CPack)
|
||||
|
||||
@@ -70,6 +70,15 @@ else()
|
||||
message(FATAL_ERROR "License found in the project")
|
||||
endif()
|
||||
|
||||
# components page should not be present
|
||||
file(STRINGS "${project_file}" line REGEX "!insertmacro MUI_PAGE_COMPONENTS")
|
||||
string(FIND "${line}" "MUI_PAGE_COMPONENTS" output_index)
|
||||
if("${output_index}" EQUAL "-1")
|
||||
message(STATUS "Components page not found in the project")
|
||||
else()
|
||||
message(FATAL_ERROR "Components page found in the project")
|
||||
endif()
|
||||
|
||||
file(STRINGS "${project_file}" line REGEX [[\\_CON\\]])
|
||||
string(FIND "${line}" [[\_CON\]] output_index)
|
||||
message(STATUS "Found CON component reserved directory name as _CON")
|
||||
|
||||
Reference in New Issue
Block a user