2014-08-06 19:23:00 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
|
|
|
|
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
|
|
|
|
|
|
|
#include "cmCPackIFWInstaller.h"
|
|
|
|
|
2016-09-07 01:21:35 +03:00
|
|
|
#include "CPack/cmCPackGenerator.h"
|
2014-08-06 19:23:00 +04:00
|
|
|
#include "cmCPackIFWGenerator.h"
|
2016-09-07 01:21:35 +03:00
|
|
|
#include "cmCPackIFWPackage.h"
|
|
|
|
#include "cmCPackIFWRepository.h"
|
|
|
|
#include "cmGeneratedFileStream.h"
|
|
|
|
#include "cmSystemTools.h"
|
|
|
|
#include "cmXMLWriter.h"
|
2014-08-06 19:23:00 +04:00
|
|
|
|
2016-09-07 01:21:35 +03:00
|
|
|
#include <cmConfigure.h>
|
|
|
|
#include <utility>
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
#ifdef cmCPackLogger
|
2016-05-16 17:34:04 +03:00
|
|
|
#undef cmCPackLogger
|
2014-08-06 19:23:00 +04:00
|
|
|
#endif
|
2016-05-16 17:34:04 +03:00
|
|
|
#define cmCPackLogger(logType, msg) \
|
|
|
|
do { \
|
|
|
|
std::ostringstream cmCPackLog_msg; \
|
|
|
|
cmCPackLog_msg << msg; \
|
|
|
|
if (Generator) { \
|
|
|
|
Generator->Logger->Log(logType, __FILE__, __LINE__, \
|
|
|
|
cmCPackLog_msg.str().c_str()); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
cmCPackIFWInstaller::cmCPackIFWInstaller()
|
2016-06-27 23:44:16 +03:00
|
|
|
: Generator(CM_NULLPTR)
|
2014-08-06 19:23:00 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
const char* cmCPackIFWInstaller::GetOption(const std::string& op) const
|
2014-08-06 19:23:00 +04:00
|
|
|
{
|
2016-06-27 23:44:16 +03:00
|
|
|
return Generator ? Generator->GetOption(op) : CM_NULLPTR;
|
2014-08-06 19:23:00 +04:00
|
|
|
}
|
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
bool cmCPackIFWInstaller::IsOn(const std::string& op) const
|
2014-10-05 12:52:57 +04:00
|
|
|
{
|
|
|
|
return Generator ? Generator->IsOn(op) : false;
|
|
|
|
}
|
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
bool cmCPackIFWInstaller::IsVersionLess(const char* version)
|
2015-04-27 17:02:49 +03:00
|
|
|
{
|
|
|
|
return Generator ? Generator->IsVersionLess(version) : false;
|
|
|
|
}
|
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
bool cmCPackIFWInstaller::IsVersionGreater(const char* version)
|
2015-04-27 17:02:49 +03:00
|
|
|
{
|
|
|
|
return Generator ? Generator->IsVersionGreater(version) : false;
|
|
|
|
}
|
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
bool cmCPackIFWInstaller::IsVersionEqual(const char* version)
|
2015-04-27 17:02:49 +03:00
|
|
|
{
|
|
|
|
return Generator ? Generator->IsVersionEqual(version) : false;
|
|
|
|
}
|
|
|
|
|
2014-08-06 19:23:00 +04:00
|
|
|
void cmCPackIFWInstaller::ConfigureFromOptions()
|
|
|
|
{
|
|
|
|
// Name;
|
2014-08-12 22:44:02 +04:00
|
|
|
if (const char* optIFW_PACKAGE_NAME =
|
2016-05-16 17:34:04 +03:00
|
|
|
this->GetOption("CPACK_IFW_PACKAGE_NAME")) {
|
2014-08-12 22:44:02 +04:00
|
|
|
Name = optIFW_PACKAGE_NAME;
|
2016-05-16 17:34:04 +03:00
|
|
|
} else if (const char* optPACKAGE_NAME =
|
|
|
|
this->GetOption("CPACK_PACKAGE_NAME")) {
|
2014-08-12 22:44:02 +04:00
|
|
|
Name = optPACKAGE_NAME;
|
2016-05-16 17:34:04 +03:00
|
|
|
} else {
|
2014-08-06 19:23:00 +04:00
|
|
|
Name = "Your package";
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
// Title;
|
|
|
|
if (const char* optIFW_PACKAGE_TITLE =
|
2016-05-16 17:34:04 +03:00
|
|
|
GetOption("CPACK_IFW_PACKAGE_TITLE")) {
|
2014-08-06 19:23:00 +04:00
|
|
|
Title = optIFW_PACKAGE_TITLE;
|
2016-05-16 17:34:04 +03:00
|
|
|
} else if (const char* optPACKAGE_DESCRIPTION_SUMMARY =
|
|
|
|
GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY")) {
|
2014-08-06 19:23:00 +04:00
|
|
|
Title = optPACKAGE_DESCRIPTION_SUMMARY;
|
2016-05-16 17:34:04 +03:00
|
|
|
} else {
|
2014-08-06 19:23:00 +04:00
|
|
|
Title = "Your package description";
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
// Version;
|
2016-05-16 17:34:04 +03:00
|
|
|
if (const char* option = GetOption("CPACK_PACKAGE_VERSION")) {
|
2014-08-06 19:23:00 +04:00
|
|
|
Version = option;
|
2016-05-16 17:34:04 +03:00
|
|
|
} else {
|
2014-08-06 19:23:00 +04:00
|
|
|
Version = "1.0.0";
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
// Publisher
|
2016-05-16 17:34:04 +03:00
|
|
|
if (const char* optIFW_PACKAGE_PUBLISHER =
|
|
|
|
GetOption("CPACK_IFW_PACKAGE_PUBLISHER")) {
|
2014-08-06 19:23:00 +04:00
|
|
|
Publisher = optIFW_PACKAGE_PUBLISHER;
|
2016-05-16 17:34:04 +03:00
|
|
|
} else if (const char* optPACKAGE_VENDOR =
|
|
|
|
GetOption("CPACK_PACKAGE_VENDOR")) {
|
2014-08-06 19:23:00 +04:00
|
|
|
Publisher = optPACKAGE_VENDOR;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
// ProductUrl
|
2016-05-16 17:34:04 +03:00
|
|
|
if (const char* option = GetOption("CPACK_IFW_PRODUCT_URL")) {
|
2014-08-06 19:23:00 +04:00
|
|
|
ProductUrl = option;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
// ApplicationIcon
|
2016-05-16 17:34:04 +03:00
|
|
|
if (const char* option = GetOption("CPACK_IFW_PACKAGE_ICON")) {
|
|
|
|
if (cmSystemTools::FileExists(option)) {
|
2014-08-06 19:23:00 +04:00
|
|
|
InstallerApplicationIcon = option;
|
2016-05-16 17:34:04 +03:00
|
|
|
} else {
|
2014-08-06 19:23:00 +04:00
|
|
|
// TODO: implement warning
|
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
// WindowIcon
|
2016-05-16 17:34:04 +03:00
|
|
|
if (const char* option = GetOption("CPACK_IFW_PACKAGE_WINDOW_ICON")) {
|
|
|
|
if (cmSystemTools::FileExists(option)) {
|
2014-08-06 19:23:00 +04:00
|
|
|
InstallerWindowIcon = option;
|
2016-05-16 17:34:04 +03:00
|
|
|
} else {
|
2014-08-06 19:23:00 +04:00
|
|
|
// TODO: implement warning
|
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
// Logo
|
2016-05-16 17:34:04 +03:00
|
|
|
if (const char* option = GetOption("CPACK_IFW_PACKAGE_LOGO")) {
|
|
|
|
if (cmSystemTools::FileExists(option)) {
|
2014-08-06 19:23:00 +04:00
|
|
|
Logo = option;
|
2016-05-16 17:34:04 +03:00
|
|
|
} else {
|
2014-08-06 19:23:00 +04:00
|
|
|
// TODO: implement warning
|
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
2015-04-27 17:02:49 +03:00
|
|
|
// Start menu
|
|
|
|
if (const char* optIFW_START_MENU_DIR =
|
2016-05-16 17:34:04 +03:00
|
|
|
this->GetOption("CPACK_IFW_PACKAGE_START_MENU_DIRECTORY")) {
|
2015-04-27 17:02:49 +03:00
|
|
|
StartMenuDir = optIFW_START_MENU_DIR;
|
2016-05-16 17:34:04 +03:00
|
|
|
} else {
|
2015-04-27 17:02:49 +03:00
|
|
|
StartMenuDir = Name;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2015-04-27 17:02:49 +03:00
|
|
|
|
2014-08-06 19:23:00 +04:00
|
|
|
// Default target directory for installation
|
|
|
|
if (const char* optIFW_TARGET_DIRECTORY =
|
2016-05-16 17:34:04 +03:00
|
|
|
GetOption("CPACK_IFW_TARGET_DIRECTORY")) {
|
2014-08-06 19:23:00 +04:00
|
|
|
TargetDir = optIFW_TARGET_DIRECTORY;
|
2016-05-16 17:34:04 +03:00
|
|
|
} else if (const char* optPACKAGE_INSTALL_DIRECTORY =
|
|
|
|
GetOption("CPACK_PACKAGE_INSTALL_DIRECTORY")) {
|
2014-08-06 19:23:00 +04:00
|
|
|
TargetDir = "@ApplicationsDir@/";
|
|
|
|
TargetDir += optPACKAGE_INSTALL_DIRECTORY;
|
2016-05-16 17:34:04 +03:00
|
|
|
} else {
|
2014-08-06 19:23:00 +04:00
|
|
|
TargetDir = "@RootDir@/usr/local";
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
// Default target directory for installation with administrator rights
|
2016-05-16 17:34:04 +03:00
|
|
|
if (const char* option = GetOption("CPACK_IFW_ADMIN_TARGET_DIRECTORY")) {
|
2014-08-06 19:23:00 +04:00
|
|
|
AdminTargetDir = option;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-10-05 12:52:57 +04:00
|
|
|
|
2015-04-27 17:02:49 +03:00
|
|
|
// Maintenance tool
|
2016-05-16 17:34:04 +03:00
|
|
|
if (const char* optIFW_MAINTENANCE_TOOL =
|
|
|
|
this->GetOption("CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME")) {
|
2015-04-27 17:02:49 +03:00
|
|
|
MaintenanceToolName = optIFW_MAINTENANCE_TOOL;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2015-04-27 17:02:49 +03:00
|
|
|
|
|
|
|
// Maintenance tool ini file
|
2016-05-16 17:34:04 +03:00
|
|
|
if (const char* optIFW_MAINTENANCE_TOOL_INI =
|
|
|
|
this->GetOption("CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_INI_FILE")) {
|
2015-04-27 17:02:49 +03:00
|
|
|
MaintenanceToolIniFile = optIFW_MAINTENANCE_TOOL_INI;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2015-04-27 17:02:49 +03:00
|
|
|
|
|
|
|
// Allow non-ASCII characters
|
2016-05-16 17:34:04 +03:00
|
|
|
if (this->GetOption("CPACK_IFW_PACKAGE_ALLOW_NON_ASCII_CHARACTERS")) {
|
|
|
|
if (IsOn("CPACK_IFW_PACKAGE_ALLOW_NON_ASCII_CHARACTERS")) {
|
2015-04-27 17:02:49 +03:00
|
|
|
AllowNonAsciiCharacters = "true";
|
2016-05-16 17:34:04 +03:00
|
|
|
} else {
|
2015-04-27 17:02:49 +03:00
|
|
|
AllowNonAsciiCharacters = "false";
|
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2015-04-27 17:02:49 +03:00
|
|
|
|
|
|
|
// Space in path
|
2016-05-16 17:34:04 +03:00
|
|
|
if (this->GetOption("CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATH")) {
|
|
|
|
if (IsOn("CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATH")) {
|
2015-04-27 17:02:49 +03:00
|
|
|
AllowSpaceInPath = "true";
|
2016-05-16 17:34:04 +03:00
|
|
|
} else {
|
2015-04-27 17:02:49 +03:00
|
|
|
AllowSpaceInPath = "false";
|
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2015-04-27 17:02:49 +03:00
|
|
|
|
|
|
|
// Control script
|
2016-05-16 17:34:04 +03:00
|
|
|
if (const char* optIFW_CONTROL_SCRIPT =
|
|
|
|
this->GetOption("CPACK_IFW_PACKAGE_CONTROL_SCRIPT")) {
|
2015-04-27 17:02:49 +03:00
|
|
|
ControlScript = optIFW_CONTROL_SCRIPT;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void cmCPackIFWInstaller::GenerateInstallerFile()
|
|
|
|
{
|
|
|
|
// Lazy directory initialization
|
2016-05-16 17:34:04 +03:00
|
|
|
if (Directory.empty() && Generator) {
|
2014-08-06 19:23:00 +04:00
|
|
|
Directory = Generator->toplevel;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
// Output stream
|
2015-07-16 22:53:57 +03:00
|
|
|
cmGeneratedFileStream fout((Directory + "/config/config.xml").data());
|
|
|
|
cmXMLWriter xout(fout);
|
2014-08-06 19:23:00 +04:00
|
|
|
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.StartDocument();
|
2015-04-27 17:02:49 +03:00
|
|
|
|
|
|
|
WriteGeneratedByToStrim(xout);
|
|
|
|
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.StartElement("Installer");
|
2014-08-06 19:23:00 +04:00
|
|
|
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.Element("Name", Name);
|
|
|
|
xout.Element("Version", Version);
|
|
|
|
xout.Element("Title", Title);
|
2014-08-06 19:23:00 +04:00
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
if (!Publisher.empty()) {
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.Element("Publisher", Publisher);
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
if (!ProductUrl.empty()) {
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.Element("ProductUrl", ProductUrl);
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
// ApplicationIcon
|
2016-05-16 17:34:04 +03:00
|
|
|
if (!InstallerApplicationIcon.empty()) {
|
2014-08-06 19:23:00 +04:00
|
|
|
std::string name =
|
|
|
|
cmSystemTools::GetFilenameName(InstallerApplicationIcon);
|
|
|
|
std::string path = Directory + "/config/" + name;
|
|
|
|
name = cmSystemTools::GetFilenameWithoutExtension(name);
|
2016-05-16 17:34:04 +03:00
|
|
|
cmsys::SystemTools::CopyFileIfDifferent(InstallerApplicationIcon.data(),
|
|
|
|
path.data());
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.Element("InstallerApplicationIcon", name);
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
// WindowIcon
|
2016-05-16 17:34:04 +03:00
|
|
|
if (!InstallerWindowIcon.empty()) {
|
2014-08-06 19:23:00 +04:00
|
|
|
std::string name = cmSystemTools::GetFilenameName(InstallerWindowIcon);
|
|
|
|
std::string path = Directory + "/config/" + name;
|
2016-05-16 17:34:04 +03:00
|
|
|
cmsys::SystemTools::CopyFileIfDifferent(InstallerWindowIcon.data(),
|
|
|
|
path.data());
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.Element("InstallerWindowIcon", name);
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
// Logo
|
2016-05-16 17:34:04 +03:00
|
|
|
if (!Logo.empty()) {
|
2014-08-06 19:23:00 +04:00
|
|
|
std::string name = cmSystemTools::GetFilenameName(Logo);
|
|
|
|
std::string path = Directory + "/config/" + name;
|
|
|
|
cmsys::SystemTools::CopyFileIfDifferent(Logo.data(), path.data());
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.Element("Logo", name);
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
2015-04-27 17:02:49 +03:00
|
|
|
// Start menu
|
2016-05-16 17:34:04 +03:00
|
|
|
if (!IsVersionLess("2.0")) {
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.Element("StartMenuDir", StartMenuDir);
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2015-04-27 17:02:49 +03:00
|
|
|
|
|
|
|
// Target dir
|
2016-05-16 17:34:04 +03:00
|
|
|
if (!TargetDir.empty()) {
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.Element("TargetDir", TargetDir);
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
2015-04-27 17:02:49 +03:00
|
|
|
// Admin target dir
|
2016-05-16 17:34:04 +03:00
|
|
|
if (!AdminTargetDir.empty()) {
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.Element("AdminTargetDir", AdminTargetDir);
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
2014-10-05 12:52:57 +04:00
|
|
|
// Remote repositories
|
2016-05-17 17:00:29 +03:00
|
|
|
if (!RemoteRepositories.empty()) {
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.StartElement("RemoteRepositories");
|
2016-05-17 17:00:29 +03:00
|
|
|
for (RepositoriesVector::iterator rit = RemoteRepositories.begin();
|
|
|
|
rit != RemoteRepositories.end(); ++rit) {
|
|
|
|
(*rit)->WriteRepositoryConfig(xout);
|
2014-08-06 19:23:00 +04:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
xout.EndElement();
|
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
2015-04-27 17:02:49 +03:00
|
|
|
// Maintenance tool
|
2016-05-16 17:34:04 +03:00
|
|
|
if (!IsVersionLess("2.0") && !MaintenanceToolName.empty()) {
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.Element("MaintenanceToolName", MaintenanceToolName);
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2015-04-27 17:02:49 +03:00
|
|
|
|
|
|
|
// Maintenance tool ini file
|
2016-05-16 17:34:04 +03:00
|
|
|
if (!IsVersionLess("2.0") && !MaintenanceToolIniFile.empty()) {
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.Element("MaintenanceToolIniFile", MaintenanceToolIniFile);
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2015-04-27 17:02:49 +03:00
|
|
|
|
|
|
|
// Different allows
|
2016-05-16 17:34:04 +03:00
|
|
|
if (IsVersionLess("2.0")) {
|
2015-04-27 17:02:49 +03:00
|
|
|
// CPack IFW default policy
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.Comment("CPack IFW default policy for QtIFW less 2.0");
|
|
|
|
xout.Element("AllowNonAsciiCharacters", "true");
|
|
|
|
xout.Element("AllowSpaceInPath", "true");
|
2016-05-16 17:34:04 +03:00
|
|
|
} else {
|
|
|
|
if (!AllowNonAsciiCharacters.empty()) {
|
|
|
|
xout.Element("AllowNonAsciiCharacters", AllowNonAsciiCharacters);
|
2015-04-27 17:02:49 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
if (!AllowSpaceInPath.empty()) {
|
|
|
|
xout.Element("AllowSpaceInPath", AllowSpaceInPath);
|
2015-04-27 17:02:49 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2015-04-27 17:02:49 +03:00
|
|
|
|
|
|
|
// Control script (copy to config dir)
|
2016-05-16 17:34:04 +03:00
|
|
|
if (!IsVersionLess("2.0") && !ControlScript.empty()) {
|
2015-04-27 17:02:49 +03:00
|
|
|
std::string name = cmSystemTools::GetFilenameName(ControlScript);
|
|
|
|
std::string path = Directory + "/config/" + name;
|
|
|
|
cmsys::SystemTools::CopyFileIfDifferent(ControlScript.data(), path.data());
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.Element("ControlScript", name);
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
2015-07-16 22:53:57 +03:00
|
|
|
xout.EndElement();
|
|
|
|
xout.EndDocument();
|
2014-08-06 19:23:00 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void cmCPackIFWInstaller::GeneratePackageFiles()
|
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
if (Packages.empty() || Generator->IsOnePackage()) {
|
2014-08-06 19:23:00 +04:00
|
|
|
// Generate default package
|
|
|
|
cmCPackIFWPackage package;
|
|
|
|
package.Generator = Generator;
|
|
|
|
package.Installer = this;
|
2014-08-12 22:44:02 +04:00
|
|
|
// Check package group
|
2016-05-16 17:34:04 +03:00
|
|
|
if (const char* option = GetOption("CPACK_IFW_PACKAGE_GROUP")) {
|
2014-08-12 22:44:02 +04:00
|
|
|
package.ConfigureFromGroup(option);
|
|
|
|
package.ForcedInstallation = "true";
|
2016-05-16 17:34:04 +03:00
|
|
|
} else {
|
2014-08-12 22:44:02 +04:00
|
|
|
package.ConfigureFromOptions();
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
package.GeneratePackageFile();
|
|
|
|
return;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
// Generate packages meta information
|
2016-05-16 17:34:04 +03:00
|
|
|
for (PackagesMap::iterator pit = Packages.begin(); pit != Packages.end();
|
|
|
|
++pit) {
|
2014-08-06 19:23:00 +04:00
|
|
|
cmCPackIFWPackage* package = pit->second;
|
|
|
|
package->GeneratePackageFile();
|
2015-04-27 17:02:49 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
void cmCPackIFWInstaller::WriteGeneratedByToStrim(cmXMLWriter& xout)
|
2015-04-27 17:02:49 +03:00
|
|
|
{
|
2016-06-10 19:36:24 +03:00
|
|
|
if (Generator) {
|
2016-05-16 17:34:04 +03:00
|
|
|
Generator->WriteGeneratedByToStrim(xout);
|
2016-06-10 19:36:24 +03:00
|
|
|
}
|
2014-08-06 19:23:00 +04:00
|
|
|
}
|