| 421 | }; |
| 422 | |
| 423 | void cmCPackIFWInstaller::GenerateInstallerFile() |
| 424 | { |
| 425 | // Lazy directory initialization |
| 426 | if (this->Directory.empty() && this->Generator) { |
| 427 | this->Directory = this->Generator->toplevel; |
| 428 | } |
| 429 | |
| 430 | // Output stream |
| 431 | cmGeneratedFileStream fout(this->Directory + "/config/config.xml"); |
| 432 | cmXMLWriter xout(fout); |
| 433 | |
| 434 | xout.StartDocument(); |
| 435 | |
| 436 | this->WriteGeneratedByToStrim(xout); |
| 437 | |
| 438 | xout.StartElement("Installer"); |
| 439 | |
| 440 | xout.Element("Name", this->Name); |
| 441 | xout.Element("Version", this->Version); |
| 442 | xout.Element("Title", this->Title); |
| 443 | |
| 444 | if (!this->Publisher.empty()) { |
| 445 | xout.Element("Publisher", this->Publisher); |
| 446 | } |
| 447 | |
| 448 | if (!this->ProductUrl.empty()) { |
| 449 | xout.Element("ProductUrl", this->ProductUrl); |
| 450 | } |
| 451 | |
| 452 | // Logo |
| 453 | if (!this->Logo.empty()) { |
| 454 | std::string srcName = cmSystemTools::GetFilenameName(this->Logo); |
| 455 | std::string suffix = cmSystemTools::GetFilenameLastExtension(srcName); |
| 456 | std::string name = "cm_logo" + suffix; |
| 457 | std::string path = this->Directory + "/config/" + name; |
| 458 | cmsys::SystemTools::CopyFileIfDifferent(this->Logo, path); |
| 459 | xout.Element("Logo", name); |
| 460 | } |
| 461 | |
| 462 | // Banner |
| 463 | if (!this->Banner.empty()) { |
| 464 | std::string name = cmSystemTools::GetFilenameName(this->Banner); |
| 465 | std::string path = this->Directory + "/config/" + name; |
| 466 | cmsys::SystemTools::CopyFileIfDifferent(this->Banner, path); |
| 467 | xout.Element("Banner", name); |
| 468 | } |
| 469 | |
| 470 | // Watermark |
| 471 | if (!this->Watermark.empty()) { |
| 472 | std::string name = cmSystemTools::GetFilenameName(this->Watermark); |
| 473 | std::string path = this->Directory + "/config/" + name; |
| 474 | cmsys::SystemTools::CopyFileIfDifferent(this->Watermark, path); |
| 475 | xout.Element("Watermark", name); |
| 476 | } |
| 477 | |
| 478 | // Background |
| 479 | if (!this->Background.empty()) { |
| 480 | std::string name = cmSystemTools::GetFilenameName(this->Background); |
no test coverage detected