CPackIFW: Add support for DisableCommandLineInterface config attribute

This commit is contained in:
Konstantin Podsvirov
2021-08-10 23:31:09 +03:00
committed by Brad King
parent 1c12694124
commit 6b12edfe82
4 changed files with 35 additions and 0 deletions

View File

@@ -195,6 +195,14 @@ Package
Is ``ON`` for QtIFW less 2.0 tools.
.. variable:: CPACK_IFW_PACKAGE_DISABLE_COMMAND_LINE_INTERFACE
.. versionadded:: 3.23
Set to ``ON`` if command line interface features should be disabled.
Is ``OFF`` by default, but will only have an effect if using QtIFW 4.0 or later.
.. variable:: CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATH
.. versionadded:: 3.3

View File

@@ -0,0 +1,8 @@
cpackifw-package-disable-command-line-interface
-----------------------------------------------
* The :cpack_gen:`CPack IFW Generator` gained new
:variable:`CPACK_IFW_PACKAGE_DISABLE_COMMAND_LINE_INTERFACE` variable to
prevents the user from passing any consumer command to installer, like
``install``, ``update``, and ``remove``.
This feature is available for QtIFW 4.0 and newer.

View File

@@ -254,6 +254,16 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
}
// DisableCommandLineInterface
if (this->GetOption("CPACK_IFW_PACKAGE_DISABLE_COMMAND_LINE_INTERFACE")) {
if (this->IsOn("CPACK_IFW_PACKAGE_DISABLE_COMMAND_LINE_INTERFACE")) {
this->DisableCommandLineInterface = "true";
} else if (this->IsSetToOff(
"CPACK_IFW_PACKAGE_DISABLE_COMMAND_LINE_INTERFACE")) {
this->DisableCommandLineInterface = "false";
}
}
// Space in path
if (this->GetOption("CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATH")) {
if (this->IsOn("CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATH")) {
@@ -518,6 +528,12 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
if (!this->WizardShowPageList.empty()) {
xout.Element("WizardShowPageList", this->WizardShowPageList);
}
// DisableCommandLineInterface
if (!this->DisableCommandLineInterface.empty()) {
xout.Element("DisableCommandLineInterface",
this->DisableCommandLineInterface);
}
}
if (!this->RemoveTargetDir.empty()) {

View File

@@ -109,6 +109,9 @@ public:
/// uninstalling
std::string RemoveTargetDir;
/// Set to true if command line interface features should be disabled
std::string DisableCommandLineInterface;
/// Set to false if the installation path cannot contain space characters
std::string AllowSpaceInPath;