MCPcopy Create free account
hub / github.com/Kitware/CMake / CreateWiXPropertiesIncludeFile

Method CreateWiXPropertiesIncludeFile

Source/CPack/WiX/cmCPackWIXGenerator.cxx:437–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435}
436
437void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile()
438{
439 std::string includeFilename =
440 cmStrCat(this->CPackTopLevel, "/properties.wxi");
441
442 cmWIXSourceWriter includeFile(this->WixVersion, this->Logger,
443 includeFilename, this->ComponentGuidType,
444 cmWIXSourceWriter::INCLUDE_ELEMENT_ROOT);
445 InjectXmlNamespaces(includeFile);
446
447 std::string prefix = "CPACK_WIX_PROPERTY_";
448 std::vector<std::string> options = GetOptions();
449
450 for (std::string const& name : options) {
451 if (cmHasPrefix(name, prefix)) {
452 std::string id = name.substr(prefix.length());
453 std::string value = GetOption(name);
454
455 includeFile.BeginElement("Property");
456 includeFile.AddAttribute("Id", id);
457 includeFile.AddAttribute("Value", value);
458 includeFile.EndElement("Property");
459 }
460 }
461
462 if (!GetOption("CPACK_WIX_PROPERTY_ARPINSTALLLOCATION")) {
463 includeFile.BeginElement("Property");
464 includeFile.AddAttribute("Id", "INSTALL_ROOT");
465 includeFile.AddAttribute("Secure", "yes");
466
467 includeFile.BeginElement("RegistrySearch");
468 includeFile.AddAttribute("Id", "FindInstallLocation");
469 includeFile.AddAttribute("Root", "HKLM");
470 includeFile.AddAttribute(
471 "Key",
472 "Software\\Microsoft\\Windows\\"
473 "CurrentVersion\\Uninstall\\[WIX_UPGRADE_DETECTED]");
474 includeFile.AddAttribute("Name", "InstallLocation");
475 includeFile.AddAttribute("Type", "raw");
476 includeFile.EndElement("RegistrySearch");
477 includeFile.EndElement("Property");
478
479 includeFile.BeginElement("SetProperty");
480 includeFile.AddAttribute("Id", "ARPINSTALLLOCATION");
481 includeFile.AddAttribute("Value", "[INSTALL_ROOT]");
482 includeFile.AddAttribute("After", "CostFinalize");
483 includeFile.EndElement("SetProperty");
484 }
485}
486
487void cmCPackWIXGenerator::CreateWiXProductFragmentIncludeFile()
488{

Callers

nothing calls this directly

Calls 7

cmHasPrefixFunction · 0.85
lengthMethod · 0.80
BeginElementMethod · 0.80
cmStrCatFunction · 0.50
substrMethod · 0.45
AddAttributeMethod · 0.45
EndElementMethod · 0.45

Tested by

no test coverage detected