mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00
@@ -240,3 +240,12 @@ on Windows Nullsoft Scriptable Install System.
|
|||||||
|
|
||||||
where ``<preArgs>...`` is constructed from ``CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS``
|
where ``<preArgs>...`` is constructed from ``CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS``
|
||||||
and ``<postArgs>...`` is constructed from ``CPACK_NSIS_EXECUTABLE_POST_ARGUMENTS``.
|
and ``<postArgs>...`` is constructed from ``CPACK_NSIS_EXECUTABLE_POST_ARGUMENTS``.
|
||||||
|
|
||||||
|
.. variable:: CPACK_NSIS_CRC_CHECK
|
||||||
|
|
||||||
|
.. versionadded:: 4.2
|
||||||
|
|
||||||
|
Specifies whether or not the installer will perform a CRC on itself before
|
||||||
|
allowing an install.
|
||||||
|
Allowed values for this variable are ``on``, ``off``, and ``force``.
|
||||||
|
If not specified, the default behavior is ``on``.
|
||||||
|
6
Help/release/dev/cpack-nsis-crc-check.rst
Normal file
6
Help/release/dev/cpack-nsis-crc-check.rst
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
cpack-nsis-crc-check
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
* The :cpack_gen:`CPack NSIS Generator` gained a new
|
||||||
|
:variable:`CPACK_NSIS_CRC_CHECK` variable for setting the ``CRCCheck``
|
||||||
|
attribute.
|
@@ -43,6 +43,7 @@
|
|||||||
@CPACK_NSIS_DEFINES@
|
@CPACK_NSIS_DEFINES@
|
||||||
@CPACK_NSIS_MANIFEST_DPI_AWARE_CODE@
|
@CPACK_NSIS_MANIFEST_DPI_AWARE_CODE@
|
||||||
@CPACK_NSIS_BRANDING_TEXT_CODE@
|
@CPACK_NSIS_BRANDING_TEXT_CODE@
|
||||||
|
@CPACK_NSIS_CRC_CHECK_CODE@
|
||||||
|
|
||||||
!include Sections.nsh
|
!include Sections.nsh
|
||||||
|
|
||||||
|
@@ -236,6 +236,10 @@ int cmCPackNSISGenerator::PackageFiles()
|
|||||||
this->SetOptionIfNotSet("CPACK_NSIS_BRANDING_TEXT_CODE", brandingTextCode);
|
this->SetOptionIfNotSet("CPACK_NSIS_BRANDING_TEXT_CODE", brandingTextCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cmValue v = this->GetOptionIfSet("CPACK_NSIS_CRC_CHECK")) {
|
||||||
|
this->SetOption("CPACK_NSIS_CRC_CHECK_CODE", "CRCCheck " + *v);
|
||||||
|
}
|
||||||
|
|
||||||
if (!this->IsSet("CPACK_NSIS_IGNORE_LICENSE_PAGE")) {
|
if (!this->IsSet("CPACK_NSIS_IGNORE_LICENSE_PAGE")) {
|
||||||
cmValue v = this->GetOption("CPACK_RESOURCE_FILE_LICENSE");
|
cmValue v = this->GetOption("CPACK_RESOURCE_FILE_LICENSE");
|
||||||
std::string licenseFile = cmSystemTools::ConvertToWindowsOutputPath(*v);
|
std::string licenseFile = cmSystemTools::ConvertToWindowsOutputPath(*v);
|
||||||
|
@@ -40,5 +40,6 @@ 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)
|
set(CPACK_NSIS_IGNORE_LICENSE_PAGE ON)
|
||||||
|
set(CPACK_NSIS_CRC_CHECK "off")
|
||||||
|
|
||||||
include(CPack)
|
include(CPack)
|
||||||
|
@@ -90,3 +90,11 @@ message(STATUS "Found EndsWithDot. component directory name as EndsWithDot._")
|
|||||||
if("${output_index}" EQUAL "-1")
|
if("${output_index}" EQUAL "-1")
|
||||||
message(FATAL_ERROR "EndsWithDot. component directory name not found as EndsWithDot._ in the project")
|
message(FATAL_ERROR "EndsWithDot. component directory name not found as EndsWithDot._ in the project")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
file(STRINGS "${project_file}" line REGEX "^CRCCheck off")
|
||||||
|
string(FIND "${line}" "off" output_index)
|
||||||
|
if("${output_index}" EQUAL "-1")
|
||||||
|
message(FATAL_ERROR "CRCCheck off not found in the project")
|
||||||
|
else()
|
||||||
|
message(STATUS "Found CRCCheck")
|
||||||
|
endif()
|
||||||
|
Reference in New Issue
Block a user