aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.WindowsInstaller/Bind
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2020-04-13 10:22:20 +1000
committerSean Hall <r.sean.hall@gmail.com>2020-04-13 20:32:16 +1000
commitd7650a48368f15468d721f4d0729bbf60c7c1666 (patch)
treef50045ba42cd568259fbce5bd67bc773975a5000 /src/WixToolset.Core.WindowsInstaller/Bind
parent5a19a39a72d87ed96a6254f65da67b4258fef478 (diff)
downloadwix-d7650a48368f15468d721f4d0729bbf60c7c1666.tar.gz
wix-d7650a48368f15468d721f4d0729bbf60c7c1666.tar.bz2
wix-d7650a48368f15468d721f4d0729bbf60c7c1666.zip
Fix typo in SummaryInformationType.
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind')
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs76
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/BindSummaryInfoCommand.cs20
2 files changed, 48 insertions, 48 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs
index ca6bfd2f..214bf617 100644
--- a/src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs
+++ b/src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs
@@ -209,16 +209,16 @@ namespace WixToolset.Core.WindowsInstaller.Bind
209 productCodes = FinalizePatchProductCodes(tuples, productCodes); 209 productCodes = FinalizePatchProductCodes(tuples, productCodes);
210 210
211 // Semicolon delimited list of the product codes that can accept the patch. 211 // Semicolon delimited list of the product codes that can accept the patch.
212 summaryInfo.Add(SumaryInformationType.PatchProductCodes, new SummaryInformationTuple(patchIdTuple.SourceLineNumbers) 212 summaryInfo.Add(SummaryInformationType.PatchProductCodes, new SummaryInformationTuple(patchIdTuple.SourceLineNumbers)
213 { 213 {
214 PropertyId = SumaryInformationType.PatchProductCodes, 214 PropertyId = SummaryInformationType.PatchProductCodes,
215 Value = String.Join(";", productCodes) 215 Value = String.Join(";", productCodes)
216 }); 216 });
217 217
218 // Semicolon delimited list of transform substorage names in the order they are applied. 218 // Semicolon delimited list of transform substorage names in the order they are applied.
219 summaryInfo.Add(SumaryInformationType.TransformNames, new SummaryInformationTuple(patchIdTuple.SourceLineNumbers) 219 summaryInfo.Add(SummaryInformationType.TransformNames, new SummaryInformationTuple(patchIdTuple.SourceLineNumbers)
220 { 220 {
221 PropertyId = SumaryInformationType.TransformNames, 221 PropertyId = SummaryInformationType.TransformNames,
222 Value = String.Join(";", transformNames) 222 Value = String.Join(";", transformNames)
223 }); 223 });
224 224
@@ -233,9 +233,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind
233 return subStorages; 233 return subStorages;
234 } 234 }
235 235
236 private Dictionary<SumaryInformationType, SummaryInformationTuple> ExtractPatchSummaryInfo() 236 private Dictionary<SummaryInformationType, SummaryInformationTuple> ExtractPatchSummaryInfo()
237 { 237 {
238 var result = new Dictionary<SumaryInformationType, SummaryInformationTuple>(); 238 var result = new Dictionary<SummaryInformationType, SummaryInformationTuple>();
239 239
240 foreach (var section in this.Intermediate.Sections) 240 foreach (var section in this.Intermediate.Sections)
241 { 241 {
@@ -247,12 +247,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind
247 // are not calculated or reserved. 247 // are not calculated or reserved.
248 section.Tuples.RemoveAt(i); 248 section.Tuples.RemoveAt(i);
249 249
250 if (patchSummaryInfo.PropertyId != SumaryInformationType.PatchProductCodes && 250 if (patchSummaryInfo.PropertyId != SummaryInformationType.PatchProductCodes &&
251 patchSummaryInfo.PropertyId != SumaryInformationType.PatchCode && 251 patchSummaryInfo.PropertyId != SummaryInformationType.PatchCode &&
252 patchSummaryInfo.PropertyId != SumaryInformationType.PatchInstallerRequirement && 252 patchSummaryInfo.PropertyId != SummaryInformationType.PatchInstallerRequirement &&
253 patchSummaryInfo.PropertyId != SumaryInformationType.Reserved11 && 253 patchSummaryInfo.PropertyId != SummaryInformationType.Reserved11 &&
254 patchSummaryInfo.PropertyId != SumaryInformationType.Reserved14 && 254 patchSummaryInfo.PropertyId != SummaryInformationType.Reserved14 &&
255 patchSummaryInfo.PropertyId != SumaryInformationType.Reserved16) 255 patchSummaryInfo.PropertyId != SummaryInformationType.Reserved16)
256 { 256 {
257 result.Add(patchSummaryInfo.PropertyId, patchSummaryInfo); 257 result.Add(patchSummaryInfo.PropertyId, patchSummaryInfo);
258 } 258 }
@@ -263,25 +263,25 @@ namespace WixToolset.Core.WindowsInstaller.Bind
263 return result; 263 return result;
264 } 264 }
265 265
266 private Dictionary<string, MsiPatchMetadataTuple> PopulateSummaryInformation(Dictionary<SumaryInformationType, SummaryInformationTuple> summaryInfo, List<IntermediateTuple> tuples, WixPatchIdTuple patchIdTuple, int codepage) 266 private Dictionary<string, MsiPatchMetadataTuple> PopulateSummaryInformation(Dictionary<SummaryInformationType, SummaryInformationTuple> summaryInfo, List<IntermediateTuple> tuples, WixPatchIdTuple patchIdTuple, int codepage)
267 { 267 {
268 // PID_CODEPAGE 268 // PID_CODEPAGE
269 if (!summaryInfo.ContainsKey(SumaryInformationType.Codepage)) 269 if (!summaryInfo.ContainsKey(SummaryInformationType.Codepage))
270 { 270 {
271 // Set the code page by default to the same code page for the 271 // Set the code page by default to the same code page for the
272 // string pool in the database. 272 // string pool in the database.
273 AddSummaryInformation(SumaryInformationType.Codepage, codepage.ToString(CultureInfo.InvariantCulture), patchIdTuple.SourceLineNumbers); 273 AddSummaryInformation(SummaryInformationType.Codepage, codepage.ToString(CultureInfo.InvariantCulture), patchIdTuple.SourceLineNumbers);
274 } 274 }
275 275
276 // GUID patch code for the patch. 276 // GUID patch code for the patch.
277 AddSummaryInformation(SumaryInformationType.PatchCode, patchIdTuple.Id.Id, patchIdTuple.SourceLineNumbers); 277 AddSummaryInformation(SummaryInformationType.PatchCode, patchIdTuple.Id.Id, patchIdTuple.SourceLineNumbers);
278 278
279 // Indicates the minimum Windows Installer version that is required to install the patch. 279 // Indicates the minimum Windows Installer version that is required to install the patch.
280 AddSummaryInformation(SumaryInformationType.PatchInstallerRequirement, ((int)SummaryInformation.InstallerRequirement.Version31).ToString(CultureInfo.InvariantCulture), patchIdTuple.SourceLineNumbers); 280 AddSummaryInformation(SummaryInformationType.PatchInstallerRequirement, ((int)SummaryInformation.InstallerRequirement.Version31).ToString(CultureInfo.InvariantCulture), patchIdTuple.SourceLineNumbers);
281 281
282 if (!summaryInfo.ContainsKey(SumaryInformationType.Security)) 282 if (!summaryInfo.ContainsKey(SummaryInformationType.Security))
283 { 283 {
284 AddSummaryInformation(SumaryInformationType.Security, "4", patchIdTuple.SourceLineNumbers); // Read-only enforced; 284 AddSummaryInformation(SummaryInformationType.Security, "4", patchIdTuple.SourceLineNumbers); // Read-only enforced;
285 } 285 }
286 286
287 // Use authored comments or default to display name. 287 // Use authored comments or default to display name.
@@ -289,32 +289,32 @@ namespace WixToolset.Core.WindowsInstaller.Bind
289 289
290 var metadataTuples = tuples.OfType<MsiPatchMetadataTuple>().Where(t => String.IsNullOrEmpty(t.Company)).ToDictionary(t => t.Property); 290 var metadataTuples = tuples.OfType<MsiPatchMetadataTuple>().Where(t => String.IsNullOrEmpty(t.Company)).ToDictionary(t => t.Property);
291 291
292 if (!summaryInfo.ContainsKey(SumaryInformationType.Title) && 292 if (!summaryInfo.ContainsKey(SummaryInformationType.Title) &&
293 metadataTuples.TryGetValue("DisplayName", out var displayName)) 293 metadataTuples.TryGetValue("DisplayName", out var displayName))
294 { 294 {
295 AddSummaryInformation(SumaryInformationType.Title, displayName.Value, displayName.SourceLineNumbers); 295 AddSummaryInformation(SummaryInformationType.Title, displayName.Value, displayName.SourceLineNumbers);
296 296
297 // Default comments to use display name as-is. 297 // Default comments to use display name as-is.
298 commentsTuple = displayName; 298 commentsTuple = displayName;
299 } 299 }
300 300
301 // TODO: This code below seems unnecessary given the codepage is set at the top of this method. 301 // TODO: This code below seems unnecessary given the codepage is set at the top of this method.
302 //if (!summaryInfo.ContainsKey(SumaryInformationType.Codepage) && 302 //if (!summaryInfo.ContainsKey(SummaryInformationType.Codepage) &&
303 // metadataValues.TryGetValue("CodePage", out var codepage)) 303 // metadataValues.TryGetValue("CodePage", out var codepage))
304 //{ 304 //{
305 // AddSummaryInformation(SumaryInformationType.Codepage, codepage); 305 // AddSummaryInformation(SummaryInformationType.Codepage, codepage);
306 //} 306 //}
307 307
308 if (!summaryInfo.ContainsKey(SumaryInformationType.PatchPackageName) && 308 if (!summaryInfo.ContainsKey(SummaryInformationType.PatchPackageName) &&
309 metadataTuples.TryGetValue("Description", out var description)) 309 metadataTuples.TryGetValue("Description", out var description))
310 { 310 {
311 AddSummaryInformation(SumaryInformationType.PatchPackageName, description.Value, description.SourceLineNumbers); 311 AddSummaryInformation(SummaryInformationType.PatchPackageName, description.Value, description.SourceLineNumbers);
312 } 312 }
313 313
314 if (!summaryInfo.ContainsKey(SumaryInformationType.Author) && 314 if (!summaryInfo.ContainsKey(SummaryInformationType.Author) &&
315 metadataTuples.TryGetValue("ManufacturerName", out var manufacturer)) 315 metadataTuples.TryGetValue("ManufacturerName", out var manufacturer))
316 { 316 {
317 AddSummaryInformation(SumaryInformationType.Author, manufacturer.Value, manufacturer.SourceLineNumbers); 317 AddSummaryInformation(SummaryInformationType.Author, manufacturer.Value, manufacturer.SourceLineNumbers);
318 } 318 }
319 319
320 // Special metadata marshalled through the build. 320 // Special metadata marshalled through the build.
@@ -327,15 +327,15 @@ namespace WixToolset.Core.WindowsInstaller.Bind
327 } 327 }
328 328
329 // Write the package comments to summary info. 329 // Write the package comments to summary info.
330 if (!summaryInfo.ContainsKey(SumaryInformationType.Comments) && 330 if (!summaryInfo.ContainsKey(SummaryInformationType.Comments) &&
331 commentsTuple != null) 331 commentsTuple != null)
332 { 332 {
333 AddSummaryInformation(SumaryInformationType.Comments, commentsTuple.Value, commentsTuple.SourceLineNumbers); 333 AddSummaryInformation(SummaryInformationType.Comments, commentsTuple.Value, commentsTuple.SourceLineNumbers);
334 } 334 }
335 335
336 return metadataTuples; 336 return metadataTuples;
337 337
338 void AddSummaryInformation(SumaryInformationType type, string value, SourceLineNumber sourceLineNumber) 338 void AddSummaryInformation(SummaryInformationType type, string value, SourceLineNumber sourceLineNumber)
339 { 339 {
340 summaryInfo.Add(type, new SummaryInformationTuple(sourceLineNumber) 340 summaryInfo.Add(type, new SummaryInformationTuple(sourceLineNumber)
341 { 341 {
@@ -1091,7 +1091,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
1091 /// <summary> 1091 /// <summary>
1092 /// Create the #transform for the given main transform. 1092 /// Create the #transform for the given main transform.
1093 /// </summary> 1093 /// </summary>
1094 private WindowsInstallerData BuildPairedTransform(Dictionary<SumaryInformationType, SummaryInformationTuple> summaryInfo, Dictionary<string, MsiPatchMetadataTuple> patchMetadata, WixPatchIdTuple patchIdTuple, WindowsInstallerData mainTransform, MediaTuple mediaTuple, WixPatchBaselineTuple baselineTuple, out string productCode) 1094 private WindowsInstallerData BuildPairedTransform(Dictionary<SummaryInformationType, SummaryInformationTuple> summaryInfo, Dictionary<string, MsiPatchMetadataTuple> patchMetadata, WixPatchIdTuple patchIdTuple, WindowsInstallerData mainTransform, MediaTuple mediaTuple, WixPatchBaselineTuple baselineTuple, out string productCode)
1095 { 1095 {
1096 productCode = null; 1096 productCode = null;
1097 1097
@@ -1109,10 +1109,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind
1109 1109
1110 var baselineValidationFlags = ((int)baselineTuple.ValidationFlags).ToString(CultureInfo.InvariantCulture); 1110 var baselineValidationFlags = ((int)baselineTuple.ValidationFlags).ToString(CultureInfo.InvariantCulture);
1111 1111
1112 if (!mainSummaryRows.ContainsKey((int)SumaryInformationType.TransformValidationFlags)) 1112 if (!mainSummaryRows.ContainsKey((int)SummaryInformationType.TransformValidationFlags))
1113 { 1113 {
1114 var mainSummaryRow = mainSummaryTable.CreateRow(baselineTuple.SourceLineNumbers); 1114 var mainSummaryRow = mainSummaryTable.CreateRow(baselineTuple.SourceLineNumbers);
1115 mainSummaryRow[0] = (int)SumaryInformationType.TransformValidationFlags; 1115 mainSummaryRow[0] = (int)SummaryInformationType.TransformValidationFlags;
1116 mainSummaryRow[1] = baselineValidationFlags; 1116 mainSummaryRow[1] = baselineValidationFlags;
1117 } 1117 }
1118 1118
@@ -1121,11 +1121,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind
1121 1121
1122 foreach (var mainSummaryRow in mainSummaryTable.Rows) 1122 foreach (var mainSummaryRow in mainSummaryTable.Rows)
1123 { 1123 {
1124 var type = (SumaryInformationType)mainSummaryRow.FieldAsInteger(0); 1124 var type = (SummaryInformationType)mainSummaryRow.FieldAsInteger(0);
1125 var value = mainSummaryRow.FieldAsString(1); 1125 var value = mainSummaryRow.FieldAsString(1);
1126 switch (type) 1126 switch (type)
1127 { 1127 {
1128 case SumaryInformationType.TransformProductCodes: 1128 case SummaryInformationType.TransformProductCodes:
1129 var propertyData = value.Split(';'); 1129 var propertyData = value.Split(';');
1130 var oldProductVersion = propertyData[0].Substring(38); 1130 var oldProductVersion = propertyData[0].Substring(38);
1131 var upgradeCode = propertyData[2]; 1131 var upgradeCode = propertyData[2];
@@ -1140,7 +1140,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
1140 mainSummaryRow[1] = String.Concat(productCode, oldProductVersion, ';', productCode, newProductVersion, ';', upgradeCode); 1140 mainSummaryRow[1] = String.Concat(productCode, oldProductVersion, ';', productCode, newProductVersion, ';', upgradeCode);
1141 value = String.Concat(productCode, newProductVersion, ';', productCode, newProductVersion, ';', upgradeCode); 1141 value = String.Concat(productCode, newProductVersion, ';', productCode, newProductVersion, ';', upgradeCode);
1142 break; 1142 break;
1143 case SumaryInformationType.TransformValidationFlags: // use validation flags authored into the patch XML. 1143 case SummaryInformationType.TransformValidationFlags: // use validation flags authored into the patch XML.
1144 value = baselineValidationFlags; 1144 value = baselineValidationFlags;
1145 mainSummaryRow[1] = value; 1145 mainSummaryRow[1] = value;
1146 break; 1146 break;
@@ -1260,7 +1260,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
1260 pairedPropertyRow[1] = patchIdTuple.Id.Id; 1260 pairedPropertyRow[1] = patchIdTuple.Id.Id;
1261 1261
1262 // Add PATCHNEWSUMMARYCOMMENTS and PATCHNEWSUMMARYSUBJECT to apply to admin layouts. 1262 // Add PATCHNEWSUMMARYCOMMENTS and PATCHNEWSUMMARYSUBJECT to apply to admin layouts.
1263 if (summaryInfo.TryGetValue(SumaryInformationType.Subject, out var subjectTuple)) 1263 if (summaryInfo.TryGetValue(SummaryInformationType.Subject, out var subjectTuple))
1264 { 1264 {
1265 pairedPropertyRow = pairedPropertyTable.CreateRow(subjectTuple.SourceLineNumbers); 1265 pairedPropertyRow = pairedPropertyTable.CreateRow(subjectTuple.SourceLineNumbers);
1266 pairedPropertyRow.Operation = RowOperation.Add; 1266 pairedPropertyRow.Operation = RowOperation.Add;
@@ -1268,7 +1268,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
1268 pairedPropertyRow[1] = subjectTuple.Value; 1268 pairedPropertyRow[1] = subjectTuple.Value;
1269 } 1269 }
1270 1270
1271 if (summaryInfo.TryGetValue(SumaryInformationType.Comments, out var commentsTuple)) 1271 if (summaryInfo.TryGetValue(SummaryInformationType.Comments, out var commentsTuple))
1272 { 1272 {
1273 pairedPropertyRow = pairedPropertyTable.CreateRow(commentsTuple.SourceLineNumbers); 1273 pairedPropertyRow = pairedPropertyTable.CreateRow(commentsTuple.SourceLineNumbers);
1274 pairedPropertyRow.Operation = RowOperation.Add; 1274 pairedPropertyRow.Operation = RowOperation.Add;
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindSummaryInfoCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindSummaryInfoCommand.cs
index 7a9dbc69..6483f0fc 100644
--- a/src/WixToolset.Core.WindowsInstaller/Bind/BindSummaryInfoCommand.cs
+++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindSummaryInfoCommand.cs
@@ -53,7 +53,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
53 { 53 {
54 switch (summaryInformationTuple.PropertyId) 54 switch (summaryInformationTuple.PropertyId)
55 { 55 {
56 case SumaryInformationType.Codepage: // PID_CODEPAGE 56 case SummaryInformationType.Codepage: // PID_CODEPAGE
57 // make sure the code page is an int and not a web name or null 57 // make sure the code page is an int and not a web name or null
58 var codepage = summaryInformationTuple.Value; 58 var codepage = summaryInformationTuple.Value;
59 59
@@ -66,7 +66,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
66 summaryInformationTuple.Value = Common.GetValidCodePage(codepage, false, false, summaryInformationTuple.SourceLineNumbers).ToString(CultureInfo.InvariantCulture); 66 summaryInformationTuple.Value = Common.GetValidCodePage(codepage, false, false, summaryInformationTuple.SourceLineNumbers).ToString(CultureInfo.InvariantCulture);
67 } 67 }
68 break; 68 break;
69 case SumaryInformationType.PackageCode: // PID_REVNUMBER 69 case SummaryInformationType.PackageCode: // PID_REVNUMBER
70 var packageCode = summaryInformationTuple.Value; 70 var packageCode = summaryInformationTuple.Value;
71 71
72 if (SectionType.Module == this.Section.Type) 72 if (SectionType.Module == this.Section.Type)
@@ -79,16 +79,16 @@ namespace WixToolset.Core.WindowsInstaller.Bind
79 summaryInformationTuple.Value = Common.GenerateGuid(); 79 summaryInformationTuple.Value = Common.GenerateGuid();
80 } 80 }
81 break; 81 break;
82 case SumaryInformationType.Created: 82 case SummaryInformationType.Created:
83 foundCreateDataTime = true; 83 foundCreateDataTime = true;
84 break; 84 break;
85 case SumaryInformationType.LastSaved: 85 case SummaryInformationType.LastSaved:
86 foundLastSaveDataTime = true; 86 foundLastSaveDataTime = true;
87 break; 87 break;
88 case SumaryInformationType.WindowsInstallerVersion: 88 case SummaryInformationType.WindowsInstallerVersion:
89 this.InstallerVersion = summaryInformationTuple[SummaryInformationTupleFields.Value].AsNumber(); 89 this.InstallerVersion = summaryInformationTuple[SummaryInformationTupleFields.Value].AsNumber();
90 break; 90 break;
91 case SumaryInformationType.WordCount: 91 case SummaryInformationType.WordCount:
92 if (SectionType.Patch == this.Section.Type) 92 if (SectionType.Patch == this.Section.Type)
93 { 93 {
94 this.LongNames = true; 94 this.LongNames = true;
@@ -101,7 +101,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
101 this.Compressed = (2 == (attributes & 2)); 101 this.Compressed = (2 == (attributes & 2));
102 } 102 }
103 break; 103 break;
104 case SumaryInformationType.CreatingApplication: // PID_APPNAME 104 case SummaryInformationType.CreatingApplication: // PID_APPNAME
105 foundCreatingApplication = true; 105 foundCreatingApplication = true;
106 break; 106 break;
107 } 107 }
@@ -112,7 +112,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
112 { 112 {
113 this.Section.AddTuple(new SummaryInformationTuple(null) 113 this.Section.AddTuple(new SummaryInformationTuple(null)
114 { 114 {
115 PropertyId = SumaryInformationType.Created, 115 PropertyId = SummaryInformationType.Created,
116 Value = now, 116 Value = now,
117 }); 117 });
118 } 118 }
@@ -122,7 +122,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
122 { 122 {
123 this.Section.AddTuple(new SummaryInformationTuple(null) 123 this.Section.AddTuple(new SummaryInformationTuple(null)
124 { 124 {
125 PropertyId = SumaryInformationType.LastSaved, 125 PropertyId = SummaryInformationType.LastSaved,
126 Value = now, 126 Value = now,
127 }); 127 });
128 } 128 }
@@ -132,7 +132,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
132 { 132 {
133 this.Section.AddTuple(new SummaryInformationTuple(null) 133 this.Section.AddTuple(new SummaryInformationTuple(null)
134 { 134 {
135 PropertyId = SumaryInformationType.CreatingApplication, 135 PropertyId = SummaryInformationType.CreatingApplication,
136 Value = String.Format(CultureInfo.InvariantCulture, AppCommon.GetCreatingApplicationString()), 136 Value = String.Format(CultureInfo.InvariantCulture, AppCommon.GetCreatingApplicationString()),
137 }); 137 });
138 } 138 }