Browse Source

Merge topic 'innosetup-component-install' into release-3.27

c80190c6ab InnoSetup: Always specify at least one component installation type

Acked-by: Kitware Robot <[email protected]>
Acked-by: buildbot <[email protected]>
Merge-request: !8630
Brad King 2 years ago
parent
commit
59ed19304b
1 changed files with 8 additions and 11 deletions
  1. 8 11
      Source/CPack/cmCPackInnoSetupGenerator.cxx

+ 8 - 11
Source/CPack/cmCPackInnoSetupGenerator.cxx

@@ -583,10 +583,8 @@ bool cmCPackInnoSetupGenerator::ProcessComponents()
                          "this script uses components }");
 
   // Installation types
-  bool noTypes = true;
   std::vector<cmCPackInstallationType*> types(InstallationTypes.size());
   for (auto& i : InstallationTypes) {
-    noTypes = false;
     types[i.second.Index - 1] = &i.second;
   }
 
@@ -601,17 +599,16 @@ bool cmCPackInnoSetupGenerator::ProcessComponents()
     typeInstructions.push_back(ISKeyValueLine(params));
   }
 
-  if (!noTypes) {
-    // Inno Setup requires the "custom" type
-    cmCPackInnoSetupKeyValuePairs params;
+  // Inno Setup requires the additional "custom" type
+  cmCPackInnoSetupKeyValuePairs customTypeParams;
 
-    params["Name"] = "\"custom\"";
-    params["Description"] = "\"{code:CPackGetCustomInstallationMessage}\"";
-    params["Flags"] = "iscustom";
+  customTypeParams["Name"] = "\"custom\"";
+  customTypeParams["Description"] =
+    "\"{code:CPackGetCustomInstallationMessage}\"";
+  customTypeParams["Flags"] = "iscustom";
 
-    allTypes.push_back("custom");
-    typeInstructions.push_back(ISKeyValueLine(params));
-  }
+  allTypes.push_back("custom");
+  typeInstructions.push_back(ISKeyValueLine(customTypeParams));
 
   // Components
   std::vector<cmCPackComponent*> downloadedComponents;