|
@@ -60,6 +60,16 @@ bool cmCPackIFWInstaller::IsVersionEqual(const char* version)
|
|
|
return Generator ? Generator->IsVersionEqual(version) : false;
|
|
return Generator ? Generator->IsVersionEqual(version) : false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+void cmCPackIFWInstaller::printSkippedOptionWarning(
|
|
|
|
|
+ const std::string& optionName, const std::string& optionValue)
|
|
|
|
|
+{
|
|
|
|
|
+ cmCPackLogger(
|
|
|
|
|
+ cmCPackLog::LOG_WARNING, "Option "
|
|
|
|
|
+ << optionName << " is set to \"" << optionValue
|
|
|
|
|
+ << "\" but will be skipped because the specified file does not exist."
|
|
|
|
|
+ << std::endl);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
void cmCPackIFWInstaller::ConfigureFromOptions()
|
|
void cmCPackIFWInstaller::ConfigureFromOptions()
|
|
|
{
|
|
{
|
|
|
// Name;
|
|
// Name;
|
|
@@ -110,7 +120,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
|
|
|
if (cmSystemTools::FileExists(option)) {
|
|
if (cmSystemTools::FileExists(option)) {
|
|
|
InstallerApplicationIcon = option;
|
|
InstallerApplicationIcon = option;
|
|
|
} else {
|
|
} else {
|
|
|
- // TODO: implement warning
|
|
|
|
|
|
|
+ printSkippedOptionWarning("CPACK_IFW_PACKAGE_ICON", option);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -119,7 +129,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
|
|
|
if (cmSystemTools::FileExists(option)) {
|
|
if (cmSystemTools::FileExists(option)) {
|
|
|
InstallerWindowIcon = option;
|
|
InstallerWindowIcon = option;
|
|
|
} else {
|
|
} else {
|
|
|
- // TODO: implement warning
|
|
|
|
|
|
|
+ printSkippedOptionWarning("CPACK_IFW_PACKAGE_WINDOW_ICON", option);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -128,10 +138,69 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
|
|
|
if (cmSystemTools::FileExists(option)) {
|
|
if (cmSystemTools::FileExists(option)) {
|
|
|
Logo = option;
|
|
Logo = option;
|
|
|
} else {
|
|
} else {
|
|
|
- // TODO: implement warning
|
|
|
|
|
|
|
+ printSkippedOptionWarning("CPACK_IFW_PACKAGE_LOGO", option);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Watermark
|
|
|
|
|
+ if (const char* option = GetOption("CPACK_IFW_PACKAGE_WATERMARK")) {
|
|
|
|
|
+ if (cmSystemTools::FileExists(option)) {
|
|
|
|
|
+ Watermark = option;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ printSkippedOptionWarning("CPACK_IFW_PACKAGE_WATERMARK", option);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Banner
|
|
|
|
|
+ if (const char* option = GetOption("CPACK_IFW_PACKAGE_BANNER")) {
|
|
|
|
|
+ if (cmSystemTools::FileExists(option)) {
|
|
|
|
|
+ Banner = option;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ printSkippedOptionWarning("CPACK_IFW_PACKAGE_BANNER", option);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Background
|
|
|
|
|
+ if (const char* option = GetOption("CPACK_IFW_PACKAGE_BACKGROUND")) {
|
|
|
|
|
+ if (cmSystemTools::FileExists(option)) {
|
|
|
|
|
+ Background = option;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ printSkippedOptionWarning("CPACK_IFW_PACKAGE_BACKGROUND", option);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // WizardStyle
|
|
|
|
|
+ if (const char* option = GetOption("CPACK_IFW_PACKAGE_WIZARD_STYLE")) {
|
|
|
|
|
+ if (WizardStyle.compare("Modern") == 0 &&
|
|
|
|
|
+ WizardStyle.compare("Aero") == 0 && WizardStyle.compare("Mac") == 0 &&
|
|
|
|
|
+ WizardStyle.compare("Classic") == 0) {
|
|
|
|
|
+ cmCPackLogger(
|
|
|
|
|
+ cmCPackLog::LOG_WARNING,
|
|
|
|
|
+ "Option CPACK_IFW_PACKAGE_WIZARD_STYLE has unknown value \""
|
|
|
|
|
+ << option << "\". Expected values are: Modern, Aero, Mac, Classic."
|
|
|
|
|
+ << std::endl);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ WizardStyle = option;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // WizardDefaultWidth
|
|
|
|
|
+ if (const char* option =
|
|
|
|
|
+ GetOption("CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH")) {
|
|
|
|
|
+ WizardDefaultWidth = option;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // WizardDefaultHeight
|
|
|
|
|
+ if (const char* option =
|
|
|
|
|
+ GetOption("CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT")) {
|
|
|
|
|
+ WizardDefaultHeight = option;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // TitleColor
|
|
|
|
|
+ if (const char* option = GetOption("CPACK_IFW_PACKAGE_TITLE_COLOR")) {
|
|
|
|
|
+ TitleColor = option;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// Start menu
|
|
// Start menu
|
|
|
if (const char* optIFW_START_MENU_DIR =
|
|
if (const char* optIFW_START_MENU_DIR =
|
|
|
this->GetOption("CPACK_IFW_PACKAGE_START_MENU_DIRECTORY")) {
|
|
this->GetOption("CPACK_IFW_PACKAGE_START_MENU_DIRECTORY")) {
|
|
@@ -313,6 +382,50 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
|
|
|
xout.Element("Logo", name);
|
|
xout.Element("Logo", name);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Banner
|
|
|
|
|
+ if (!Banner.empty()) {
|
|
|
|
|
+ std::string name = cmSystemTools::GetFilenameName(Banner);
|
|
|
|
|
+ std::string path = Directory + "/config/" + name;
|
|
|
|
|
+ cmsys::SystemTools::CopyFileIfDifferent(Banner.data(), path.data());
|
|
|
|
|
+ xout.Element("Banner", name);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Watermark
|
|
|
|
|
+ if (!Watermark.empty()) {
|
|
|
|
|
+ std::string name = cmSystemTools::GetFilenameName(Watermark);
|
|
|
|
|
+ std::string path = Directory + "/config/" + name;
|
|
|
|
|
+ cmsys::SystemTools::CopyFileIfDifferent(Watermark.data(), path.data());
|
|
|
|
|
+ xout.Element("Watermark", name);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Background
|
|
|
|
|
+ if (!Background.empty()) {
|
|
|
|
|
+ std::string name = cmSystemTools::GetFilenameName(Background);
|
|
|
|
|
+ std::string path = Directory + "/config/" + name;
|
|
|
|
|
+ cmsys::SystemTools::CopyFileIfDifferent(Background.data(), path.data());
|
|
|
|
|
+ xout.Element("Background", name);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // WizardStyle
|
|
|
|
|
+ if (!WizardStyle.empty()) {
|
|
|
|
|
+ xout.Element("WizardStyle", WizardStyle);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // WizardDefaultWidth
|
|
|
|
|
+ if (!WizardDefaultWidth.empty()) {
|
|
|
|
|
+ xout.Element("WizardDefaultWidth", WizardDefaultWidth);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // WizardDefaultHeight
|
|
|
|
|
+ if (!WizardDefaultHeight.empty()) {
|
|
|
|
|
+ xout.Element("WizardDefaultHeight", WizardDefaultHeight);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // TitleColor
|
|
|
|
|
+ if (!TitleColor.empty()) {
|
|
|
|
|
+ xout.Element("TitleColor", TitleColor);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// Start menu
|
|
// Start menu
|
|
|
if (!IsVersionLess("2.0")) {
|
|
if (!IsVersionLess("2.0")) {
|
|
|
xout.Element("StartMenuDir", StartMenuDir);
|
|
xout.Element("StartMenuDir", StartMenuDir);
|