diff options
Diffstat (limited to 'Source/CPack/IFW')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWGenerator.cxx | 15 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.cxx | 15 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.h | 4 |
3 files changed, 26 insertions, 8 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 825a888..9f1a15e 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -9,6 +9,7 @@ #include "cmCPackIFWPackage.h" #include "cmCPackIFWRepository.h" #include "cmCPackLog.h" // IWYU pragma: keep +#include "cmDuration.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" @@ -61,7 +62,7 @@ int cmCPackIFWGenerator::PackageFiles() } } else { cmCPackIFWLogger(WARNING, "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" " - << "variable is set, but content will be skiped, " + << "variable is set, but content will be skipped, " << "because this feature available only since " << "QtIFW 3.1. Please update your QtIFW instance." << std::endl); @@ -84,9 +85,9 @@ int cmCPackIFWGenerator::PackageFiles() std::string output; int retVal = 1; cmCPackIFWLogger(OUTPUT, "- Generate repository" << std::endl); - bool res = cmSystemTools::RunSingleCommand(ifwCmd.c_str(), &output, - &output, &retVal, nullptr, - this->GeneratorVerbose, 0); + bool res = cmSystemTools::RunSingleCommand( + ifwCmd.c_str(), &output, &output, &retVal, nullptr, + this->GeneratorVerbose, cmDuration::zero()); if (!res || retVal) { cmGeneratedFileStream ofs(ifwTmpFile.c_str()); ofs << "# Run command: " << ifwCmd << std::endl @@ -194,9 +195,9 @@ int cmCPackIFWGenerator::PackageFiles() std::string output; int retVal = 1; cmCPackIFWLogger(OUTPUT, "- Generate package" << std::endl); - bool res = cmSystemTools::RunSingleCommand(ifwCmd.c_str(), &output, - &output, &retVal, nullptr, - this->GeneratorVerbose, 0); + bool res = cmSystemTools::RunSingleCommand( + ifwCmd.c_str(), &output, &output, &retVal, nullptr, + this->GeneratorVerbose, cmDuration::zero()); if (!res || retVal) { cmGeneratedFileStream ofs(ifwTmpFile.c_str()); ofs << "# Run command: " << ifwCmd << std::endl diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index 422f5d5..05a852d 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -93,6 +93,15 @@ void cmCPackIFWInstaller::ConfigureFromOptions() } } + // RemoveTargetDir + if (this->IsSetToOff("CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR")) { + this->RemoveTargetDir = "false"; + } else if (this->IsOn("CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR")) { + this->RemoveTargetDir = "true"; + } else { + this->RemoveTargetDir.clear(); + } + // Logo if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_LOGO")) { if (cmSystemTools::FileExists(option)) { @@ -422,6 +431,10 @@ void cmCPackIFWInstaller::GenerateInstallerFile() xout.Element("MaintenanceToolIniFile", this->MaintenanceToolIniFile); } + if (!this->RemoveTargetDir.empty()) { + xout.Element("RemoveTargetDir", this->RemoveTargetDir); + } + // Different allows if (this->IsVersionLess("2.0")) { // CPack IFW default policy @@ -454,7 +467,7 @@ void cmCPackIFWInstaller::GenerateInstallerFile() std::string name = cmSystemTools::GetFilenameName(this->Resources[i]); std::string path = this->Directory + "/resources/" + name; cmsys::SystemTools::CopyFileIfDifferent(this->Resources[i], path); - resources.push_back(name); + resources.push_back(std::move(name)); } else { cmCPackIFWLogger(WARNING, "Can't copy resources from \"" << this->Resources[i] diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.h b/Source/CPack/IFW/cmCPackIFWInstaller.h index b635f42..37ad339 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.h +++ b/Source/CPack/IFW/cmCPackIFWInstaller.h @@ -99,6 +99,10 @@ public: /// Set to true if the installation path can contain non-ASCII characters std::string AllowNonAsciiCharacters; + /// Set to false if the target directory should not be deleted when + /// uninstalling + std::string RemoveTargetDir; + /// Set to false if the installation path cannot contain space characters std::string AllowSpaceInPath; |