diff options
author | Konstantin Podsvirov <konstantin@podsvirov.pro> | 2021-08-10 20:31:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-10-14 15:57:38 (GMT) |
commit | 6b12edfe82e014e17e3ea5d612bd8c9e755942f9 (patch) | |
tree | beaf3acff2030237c274a23079db214cf43295b8 | |
parent | 1c12694124aedc0f7cf5a98e635e27d4c338fce0 (diff) | |
download | CMake-6b12edfe82e014e17e3ea5d612bd8c9e755942f9.zip CMake-6b12edfe82e014e17e3ea5d612bd8c9e755942f9.tar.gz CMake-6b12edfe82e014e17e3ea5d612bd8c9e755942f9.tar.bz2 |
CPackIFW: Add support for DisableCommandLineInterface config attribute
-rw-r--r-- | Help/cpack_gen/ifw.rst | 8 | ||||
-rw-r--r-- | Help/release/dev/cpackifw-package-disable-command-line-interface.rst | 8 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.cxx | 16 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.h | 3 |
4 files changed, 35 insertions, 0 deletions
diff --git a/Help/cpack_gen/ifw.rst b/Help/cpack_gen/ifw.rst index 9ee6fbe..4eb6095 100644 --- a/Help/cpack_gen/ifw.rst +++ b/Help/cpack_gen/ifw.rst @@ -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 diff --git a/Help/release/dev/cpackifw-package-disable-command-line-interface.rst b/Help/release/dev/cpackifw-package-disable-command-line-interface.rst new file mode 100644 index 0000000..2de222e --- /dev/null +++ b/Help/release/dev/cpackifw-package-disable-command-line-interface.rst @@ -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. diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index d356f7d..465c38d 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -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()) { diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.h b/Source/CPack/IFW/cmCPackIFWInstaller.h index ad2d472..047f287 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.h +++ b/Source/CPack/IFW/cmCPackIFWInstaller.h @@ -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; |