diff options
author | Erlend E. Aasland <erlend.aasland@innova.no> | 2021-10-07 20:56:44 (GMT) |
---|---|---|
committer | Erlend E. Aasland <erlend.aasland@innova.no> | 2021-10-17 19:15:57 (GMT) |
commit | f2f4e66f64c5bd574fd868af928bdd6ee39cfc86 (patch) | |
tree | 35aa12aa591a6ea0f5abce3c246c61968eb25802 /Source/CPack/IFW | |
parent | 47cc20fc67357f796b1a51583a9e182bf78bfb69 (diff) | |
download | CMake-f2f4e66f64c5bd574fd868af928bdd6ee39cfc86.zip CMake-f2f4e66f64c5bd574fd868af928bdd6ee39cfc86.tar.gz CMake-f2f4e66f64c5bd574fd868af928bdd6ee39cfc86.tar.bz2 |
CPackIFW: Add support for RunProgram* config variables
This patch adds support for specifying <RunProgram>,
<RunProgramArguments>, and <RunProgramDescription> in the IFW
configuration file.
Diffstat (limited to 'Source/CPack/IFW')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.cxx | 33 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.h | 11 |
2 files changed, 44 insertions, 0 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index 0948a84..a94ca48 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -292,6 +292,20 @@ void cmCPackIFWInstaller::ConfigureFromOptions() this->ProductImages.clear(); cmExpandList(productImages, this->ProductImages); } + + // Run program, run program arguments, and run program description + if (cmValue program = this->GetOption("CPACK_IFW_PACKAGE_RUN_PROGRAM")) { + this->RunProgram = *program; + } + if (cmValue arguments = + this->GetOption("CPACK_IFW_PACKAGE_RUN_PROGRAM_ARGUMENTS")) { + this->RunProgramArguments.clear(); + cmExpandList(arguments, this->RunProgramArguments); + } + if (cmValue description = + this->GetOption("CPACK_IFW_PACKAGE_RUN_PROGRAM_DESCRIPTION")) { + this->RunProgramDescription = *description; + } } /** \class cmCPackIFWResourcesParser @@ -542,6 +556,25 @@ void cmCPackIFWInstaller::GenerateInstallerFile() xout.Element("DisableCommandLineInterface", this->DisableCommandLineInterface); } + + // RunProgram + if (!this->RunProgram.empty()) { + xout.Element("RunProgram", this->RunProgram); + } + + // RunProgramArguments + if (!this->RunProgramArguments.empty()) { + xout.StartElement("RunProgramArguments"); + for (const auto& arg : this->RunProgramArguments) { + xout.Element("Argument", arg); + } + xout.EndElement(); + } + + // RunProgramDescription + if (!this->RunProgramDescription.empty()) { + xout.Element("RunProgramDescription", this->RunProgramDescription); + } } if (!this->RemoveTargetDir.empty()) { diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.h b/Source/CPack/IFW/cmCPackIFWInstaller.h index 047f287..0ace099 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.h +++ b/Source/CPack/IFW/cmCPackIFWInstaller.h @@ -124,6 +124,17 @@ public: /// A list of images to be shown on PerformInstallationPage. std::vector<std::string> ProductImages; + /// Command executed after the installer is done if the user accepts the + /// action + std::string RunProgram; + + /// Arguments passed to the program specified in <RunProgram> + std::vector<std::string> RunProgramArguments; + + /// Text shown next to the check box for running the program after the + /// installation + std::string RunProgramDescription; + public: // Internal implementation |