| 569 | } |
| 570 | |
| 571 | bool cmCPackInnoSetupGenerator::ProcessComponents() |
| 572 | { |
| 573 | codeIncludes.emplace_back( |
| 574 | "{ The following lines are required by CPack because " |
| 575 | "this script uses components }"); |
| 576 | |
| 577 | // Installation types |
| 578 | std::vector<cmCPackInstallationType*> types(InstallationTypes.size()); |
| 579 | for (auto& i : InstallationTypes) { |
| 580 | types[i.second.Index - 1] = &i.second; |
| 581 | } |
| 582 | |
| 583 | std::vector<std::string> allTypes; // For required components |
| 584 | for (cmCPackInstallationType* i : types) { |
| 585 | cmCPackInnoSetupKeyValuePairs params; |
| 586 | |
| 587 | params["Name"] = Quote(i->Name); |
| 588 | params["Description"] = Quote(i->DisplayName); |
| 589 | |
| 590 | allTypes.push_back(i->Name); |
| 591 | typeInstructions.push_back(ISKeyValueLine(params)); |
| 592 | } |
| 593 | |
| 594 | // Inno Setup requires the additional "custom" type |
| 595 | cmCPackInnoSetupKeyValuePairs customTypeParams; |
| 596 | |
| 597 | customTypeParams["Name"] = "\"custom\""; |
| 598 | customTypeParams["Description"] = |
| 599 | "\"{code:CPackGetCustomInstallationMessage}\""; |
| 600 | customTypeParams["Flags"] = "iscustom"; |
| 601 | |
| 602 | allTypes.emplace_back("custom"); |
| 603 | typeInstructions.push_back(ISKeyValueLine(customTypeParams)); |
| 604 | |
| 605 | // Components |
| 606 | std::vector<cmCPackComponent*> downloadedComponents; |
| 607 | for (auto& i : Components) { |
| 608 | cmCPackInnoSetupKeyValuePairs params; |
| 609 | cmCPackComponent* component = &i.second; |
| 610 | |
| 611 | if (component->IsHidden) { |
| 612 | continue; |
| 613 | } |
| 614 | |
| 615 | CreateRecursiveComponentGroups(component->Group); |
| 616 | |
| 617 | params["Name"] = |
| 618 | Quote(CreateRecursiveComponentPath(component->Group, component->Name)); |
| 619 | params["Description"] = Quote(component->DisplayName); |
| 620 | |
| 621 | if (component->IsRequired) { |
| 622 | params["Types"] = cmJoin(allTypes, " "); |
| 623 | params["Flags"] = "fixed"; |
| 624 | } else if (!component->InstallationTypes.empty()) { |
| 625 | std::vector<std::string> installationTypes; |
| 626 | |
| 627 | installationTypes.reserve(component->InstallationTypes.size()); |
| 628 | for (cmCPackInstallationType* j : component->InstallationTypes) { |
nothing calls this directly
no test coverage detected