mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-21 23:00:50 +08:00
@@ -201,3 +201,9 @@ on Windows Nullsoft Scriptable Install System.
|
|||||||
.. versionadded:: 3.21
|
.. versionadded:: 3.21
|
||||||
|
|
||||||
If set, specify the name of the NSIS executable. Default is ``makensis``.
|
If set, specify the name of the NSIS executable. Default is ``makensis``.
|
||||||
|
|
||||||
|
.. variable:: CPACK_NSIS_IGNORE_LICENSE_PAGE
|
||||||
|
|
||||||
|
.. versionadded:: 3.22
|
||||||
|
|
||||||
|
If set, do not display the page containing the license during installation.
|
||||||
|
6
Help/release/dev/nsis_ignore_install_page.rst
Normal file
6
Help/release/dev/nsis_ignore_install_page.rst
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
nsis_ignore_install_page
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
* The :cpack_gen:`CPack NSIS Generator` gained a new variable
|
||||||
|
:variable:`CPACK_NSIS_IGNORE_LICENSE_PAGE` to ignore the
|
||||||
|
license page in the installer.
|
@@ -540,7 +540,7 @@ FunctionEnd
|
|||||||
@CPACK_NSIS_INSTALLER_WELCOME_TITLE_3LINES_CODE@
|
@CPACK_NSIS_INSTALLER_WELCOME_TITLE_3LINES_CODE@
|
||||||
!insertmacro MUI_PAGE_WELCOME
|
!insertmacro MUI_PAGE_WELCOME
|
||||||
|
|
||||||
!insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@"
|
@CPACK_NSIS_LICENSE_PAGE@
|
||||||
Page custom InstallOptionsPage
|
Page custom InstallOptionsPage
|
||||||
!insertmacro MUI_PAGE_DIRECTORY
|
!insertmacro MUI_PAGE_DIRECTORY
|
||||||
|
|
||||||
|
@@ -235,6 +235,13 @@ int cmCPackNSISGenerator::PackageFiles()
|
|||||||
brandingTextCode.c_str());
|
brandingTextCode.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this->IsSet("CPACK_NSIS_IGNORE_LICENSE_PAGE")) {
|
||||||
|
std::string licenceCode =
|
||||||
|
cmStrCat("!insertmacro MUI_PAGE_LICENSE \"",
|
||||||
|
this->GetOption("CPACK_RESOURCE_FILE_LICENSE"), "\"\n");
|
||||||
|
this->SetOptionIfNotSet("CPACK_NSIS_LICENSE_PAGE", licenceCode.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
// Setup all of the component sections
|
// Setup all of the component sections
|
||||||
if (this->Components.empty()) {
|
if (this->Components.empty()) {
|
||||||
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLATION_TYPES", "");
|
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLATION_TYPES", "");
|
||||||
|
@@ -19,5 +19,6 @@ set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
|||||||
set(CPACK_NSIS_MANIFEST_DPI_AWARE ON)
|
set(CPACK_NSIS_MANIFEST_DPI_AWARE ON)
|
||||||
set(CPACK_NSIS_BRANDING_TEXT "CMake branding text")
|
set(CPACK_NSIS_BRANDING_TEXT "CMake branding text")
|
||||||
set(CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION "RIGHT")
|
set(CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION "RIGHT")
|
||||||
|
set(CPACK_NSIS_IGNORE_LICENSE_PAGE ON)
|
||||||
|
|
||||||
include(CPack)
|
include(CPack)
|
||||||
|
@@ -60,3 +60,12 @@ if("${output_index}" EQUAL "-1")
|
|||||||
else()
|
else()
|
||||||
message(STATUS "Found BrandingText")
|
message(STATUS "Found BrandingText")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# license page should not be present
|
||||||
|
file(STRINGS "${project_file}" line REGEX "!insertmacro MUI_PAGE_LICENSE")
|
||||||
|
string(FIND "${line}" "MUI_PAGE_LICENSE" output_index)
|
||||||
|
if("${output_index}" EQUAL "-1")
|
||||||
|
message(STATUS "License not found in the project")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "License found in the project")
|
||||||
|
endif()
|
||||||
|
Reference in New Issue
Block a user