diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-06-25 14:43:50 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-06-25 14:50:31 -0700 |
| commit | 38afa9e7bc7eacc021f8805f607368a05751e3c3 (patch) | |
| tree | 803b0a8d9a06a7d6f7c4df408437017ae21a883e /src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs | |
| parent | 8968578d50858721317d410549a9f9b5c62bf1f7 (diff) | |
| download | wix-38afa9e7bc7eacc021f8805f607368a05751e3c3.tar.gz wix-38afa9e7bc7eacc021f8805f607368a05751e3c3.tar.bz2 wix-38afa9e7bc7eacc021f8805f607368a05751e3c3.zip | |
The Great Tuple to Symbol Rename (tm)
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs')
| -rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs | 170 |
1 files changed, 85 insertions, 85 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs index a16bafd7..51f1f81a 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/AttachPatchTransformsCommand.cs | |||
| @@ -9,7 +9,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 9 | using System.Text.RegularExpressions; | 9 | using System.Text.RegularExpressions; |
| 10 | using WixToolset.Core.WindowsInstaller.Msi; | 10 | using WixToolset.Core.WindowsInstaller.Msi; |
| 11 | using WixToolset.Data; | 11 | using WixToolset.Data; |
| 12 | using WixToolset.Data.Tuples; | 12 | using WixToolset.Data.Symbols; |
| 13 | using WixToolset.Data.WindowsInstaller; | 13 | using WixToolset.Data.WindowsInstaller; |
| 14 | using WixToolset.Data.WindowsInstaller.Rows; | 14 | using WixToolset.Data.WindowsInstaller.Rows; |
| 15 | using WixToolset.Extensibility.Services; | 15 | using WixToolset.Extensibility.Services; |
| @@ -85,25 +85,25 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 85 | 85 | ||
| 86 | var section = this.Intermediate.Sections.First(); | 86 | var section = this.Intermediate.Sections.First(); |
| 87 | 87 | ||
| 88 | var tuples = this.Intermediate.Sections.SelectMany(s => s.Tuples).ToList(); | 88 | var symbols = this.Intermediate.Sections.SelectMany(s => s.Symbols).ToList(); |
| 89 | 89 | ||
| 90 | // Get the patch id from the WixPatchId tuple. | 90 | // Get the patch id from the WixPatchId symbol. |
| 91 | var patchIdTuple = tuples.OfType<WixPatchIdTuple>().FirstOrDefault(); | 91 | var patchIdSymbol = symbols.OfType<WixPatchIdSymbol>().FirstOrDefault(); |
| 92 | 92 | ||
| 93 | if (String.IsNullOrEmpty(patchIdTuple.Id?.Id)) | 93 | if (String.IsNullOrEmpty(patchIdSymbol.Id?.Id)) |
| 94 | { | 94 | { |
| 95 | this.Messaging.Write(ErrorMessages.ExpectedPatchIdInWixMsp()); | 95 | this.Messaging.Write(ErrorMessages.ExpectedPatchIdInWixMsp()); |
| 96 | return subStorages; | 96 | return subStorages; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | if (String.IsNullOrEmpty(patchIdTuple.ClientPatchId)) | 99 | if (String.IsNullOrEmpty(patchIdSymbol.ClientPatchId)) |
| 100 | { | 100 | { |
| 101 | this.Messaging.Write(ErrorMessages.ExpectedClientPatchIdInWixMsp()); | 101 | this.Messaging.Write(ErrorMessages.ExpectedClientPatchIdInWixMsp()); |
| 102 | return subStorages; | 102 | return subStorages; |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | // enumerate patch.Media to map diskId to Media row | 105 | // enumerate patch.Media to map diskId to Media row |
| 106 | var patchMediaByDiskId = tuples.OfType<MediaTuple>().ToDictionary(t => t.DiskId); | 106 | var patchMediaByDiskId = symbols.OfType<MediaSymbol>().ToDictionary(t => t.DiskId); |
| 107 | 107 | ||
| 108 | if (patchMediaByDiskId.Count == 0) | 108 | if (patchMediaByDiskId.Count == 0) |
| 109 | { | 109 | { |
| @@ -112,23 +112,23 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | // populate MSP summary information | 114 | // populate MSP summary information |
| 115 | var patchMetadata = this.PopulateSummaryInformation(summaryInfo, tuples, patchIdTuple, section.Codepage); | 115 | var patchMetadata = this.PopulateSummaryInformation(summaryInfo, symbols, patchIdSymbol, section.Codepage); |
| 116 | 116 | ||
| 117 | // enumerate transforms | 117 | // enumerate transforms |
| 118 | var productCodes = new SortedSet<string>(); | 118 | var productCodes = new SortedSet<string>(); |
| 119 | var transformNames = new List<string>(); | 119 | var transformNames = new List<string>(); |
| 120 | var validTransform = new List<Tuple<string, WindowsInstallerData>>(); | 120 | var validTransform = new List<Tuple<string, WindowsInstallerData>>(); |
| 121 | 121 | ||
| 122 | var baselineTuplesById = tuples.OfType<WixPatchBaselineTuple>().ToDictionary(t => t.Id.Id); | 122 | var baselineSymbolsById = symbols.OfType<WixPatchBaselineSymbol>().ToDictionary(t => t.Id.Id); |
| 123 | 123 | ||
| 124 | foreach (var mainTransform in this.Transforms) | 124 | foreach (var mainTransform in this.Transforms) |
| 125 | { | 125 | { |
| 126 | var baselineTuple = baselineTuplesById[mainTransform.Baseline]; | 126 | var baselineSymbol = baselineSymbolsById[mainTransform.Baseline]; |
| 127 | 127 | ||
| 128 | var patchRefTuples = tuples.OfType<WixPatchRefTuple>().ToList(); | 128 | var patchRefSymbols = symbols.OfType<WixPatchRefSymbol>().ToList(); |
| 129 | if (patchRefTuples.Count > 0) | 129 | if (patchRefSymbols.Count > 0) |
| 130 | { | 130 | { |
| 131 | if (!this.ReduceTransform(mainTransform.Transform, patchRefTuples)) | 131 | if (!this.ReduceTransform(mainTransform.Transform, patchRefSymbols)) |
| 132 | { | 132 | { |
| 133 | // transform has none of the content authored into this patch | 133 | // transform has none of the content authored into this patch |
| 134 | continue; | 134 | continue; |
| @@ -139,7 +139,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 139 | this.Validate(mainTransform); | 139 | this.Validate(mainTransform); |
| 140 | 140 | ||
| 141 | // ensure consistent File.Sequence within each Media | 141 | // ensure consistent File.Sequence within each Media |
| 142 | var mediaTuple = patchMediaByDiskId[baselineTuple.DiskId]; | 142 | var mediaSymbol = patchMediaByDiskId[baselineSymbol.DiskId]; |
| 143 | 143 | ||
| 144 | // Ensure that files are sequenced after the last file in any transform. | 144 | // Ensure that files are sequenced after the last file in any transform. |
| 145 | var transformMediaTable = mainTransform.Transform.Tables["Media"]; | 145 | var transformMediaTable = mainTransform.Transform.Tables["Media"]; |
| @@ -147,25 +147,25 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 147 | { | 147 | { |
| 148 | foreach (MediaRow transformMediaRow in transformMediaTable.Rows) | 148 | foreach (MediaRow transformMediaRow in transformMediaTable.Rows) |
| 149 | { | 149 | { |
| 150 | if (!mediaTuple.LastSequence.HasValue || mediaTuple.LastSequence < transformMediaRow.LastSequence) | 150 | if (!mediaSymbol.LastSequence.HasValue || mediaSymbol.LastSequence < transformMediaRow.LastSequence) |
| 151 | { | 151 | { |
| 152 | // The Binder will pre-increment the sequence. | 152 | // The Binder will pre-increment the sequence. |
| 153 | mediaTuple.LastSequence = transformMediaRow.LastSequence; | 153 | mediaSymbol.LastSequence = transformMediaRow.LastSequence; |
| 154 | } | 154 | } |
| 155 | } | 155 | } |
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | // Use the Media/@DiskId if greater than the last sequence for backward compatibility. | 158 | // Use the Media/@DiskId if greater than the last sequence for backward compatibility. |
| 159 | if (!mediaTuple.LastSequence.HasValue || mediaTuple.LastSequence < mediaTuple.DiskId) | 159 | if (!mediaSymbol.LastSequence.HasValue || mediaSymbol.LastSequence < mediaSymbol.DiskId) |
| 160 | { | 160 | { |
| 161 | mediaTuple.LastSequence = mediaTuple.DiskId; | 161 | mediaSymbol.LastSequence = mediaSymbol.DiskId; |
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | // Ignore media table in the transform. | 164 | // Ignore media table in the transform. |
| 165 | mainTransform.Transform.Tables.Remove("Media"); | 165 | mainTransform.Transform.Tables.Remove("Media"); |
| 166 | mainTransform.Transform.Tables.Remove("MsiDigitalSignature"); | 166 | mainTransform.Transform.Tables.Remove("MsiDigitalSignature"); |
| 167 | 167 | ||
| 168 | var pairedTransform = this.BuildPairedTransform(summaryInfo, patchMetadata, patchIdTuple, mainTransform.Transform, mediaTuple, baselineTuple, out var productCode); | 168 | var pairedTransform = this.BuildPairedTransform(summaryInfo, patchMetadata, patchIdSymbol, mainTransform.Transform, mediaSymbol, baselineSymbol, out var productCode); |
| 169 | 169 | ||
| 170 | productCode = productCode.ToUpperInvariant(); | 170 | productCode = productCode.ToUpperInvariant(); |
| 171 | productCodes.Add(productCode); | 171 | productCodes.Add(productCode); |
| @@ -205,17 +205,17 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 205 | } | 205 | } |
| 206 | 206 | ||
| 207 | // Finish filling tables with transform-dependent data. | 207 | // Finish filling tables with transform-dependent data. |
| 208 | productCodes = FinalizePatchProductCodes(tuples, productCodes); | 208 | productCodes = FinalizePatchProductCodes(symbols, productCodes); |
| 209 | 209 | ||
| 210 | // Semicolon delimited list of the product codes that can accept the patch. | 210 | // Semicolon delimited list of the product codes that can accept the patch. |
| 211 | summaryInfo.Add(SummaryInformationType.PatchProductCodes, new SummaryInformationTuple(patchIdTuple.SourceLineNumbers) | 211 | summaryInfo.Add(SummaryInformationType.PatchProductCodes, new SummaryInformationSymbol(patchIdSymbol.SourceLineNumbers) |
| 212 | { | 212 | { |
| 213 | PropertyId = SummaryInformationType.PatchProductCodes, | 213 | PropertyId = SummaryInformationType.PatchProductCodes, |
| 214 | Value = String.Join(";", productCodes) | 214 | Value = String.Join(";", productCodes) |
| 215 | }); | 215 | }); |
| 216 | 216 | ||
| 217 | // Semicolon delimited list of transform substorage names in the order they are applied. | 217 | // Semicolon delimited list of transform substorage names in the order they are applied. |
| 218 | summaryInfo.Add(SummaryInformationType.TransformNames, new SummaryInformationTuple(patchIdTuple.SourceLineNumbers) | 218 | summaryInfo.Add(SummaryInformationType.TransformNames, new SummaryInformationSymbol(patchIdSymbol.SourceLineNumbers) |
| 219 | { | 219 | { |
| 220 | PropertyId = SummaryInformationType.TransformNames, | 220 | PropertyId = SummaryInformationType.TransformNames, |
| 221 | Value = String.Join(";", transformNames) | 221 | Value = String.Join(";", transformNames) |
| @@ -224,7 +224,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 224 | // Put the summary information that was extracted back in now that it is updated. | 224 | // Put the summary information that was extracted back in now that it is updated. |
| 225 | foreach (var readSummaryInfo in summaryInfo.Values.OrderBy(s => s.PropertyId)) | 225 | foreach (var readSummaryInfo in summaryInfo.Values.OrderBy(s => s.PropertyId)) |
| 226 | { | 226 | { |
| 227 | section.AddTuple(readSummaryInfo); | 227 | section.AddSymbol(readSummaryInfo); |
| 228 | } | 228 | } |
| 229 | 229 | ||
| 230 | this.SubStorages = subStorages; | 230 | this.SubStorages = subStorages; |
| @@ -232,19 +232,19 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 232 | return subStorages; | 232 | return subStorages; |
| 233 | } | 233 | } |
| 234 | 234 | ||
| 235 | private Dictionary<SummaryInformationType, SummaryInformationTuple> ExtractPatchSummaryInfo() | 235 | private Dictionary<SummaryInformationType, SummaryInformationSymbol> ExtractPatchSummaryInfo() |
| 236 | { | 236 | { |
| 237 | var result = new Dictionary<SummaryInformationType, SummaryInformationTuple>(); | 237 | var result = new Dictionary<SummaryInformationType, SummaryInformationSymbol>(); |
| 238 | 238 | ||
| 239 | foreach (var section in this.Intermediate.Sections) | 239 | foreach (var section in this.Intermediate.Sections) |
| 240 | { | 240 | { |
| 241 | for (var i = section.Tuples.Count - 1; i >= 0; i--) | 241 | for (var i = section.Symbols.Count - 1; i >= 0; i--) |
| 242 | { | 242 | { |
| 243 | if (section.Tuples[i] is SummaryInformationTuple patchSummaryInfo) | 243 | if (section.Symbols[i] is SummaryInformationSymbol patchSummaryInfo) |
| 244 | { | 244 | { |
| 245 | // Remove all summary information from the tuples and remember those that | 245 | // Remove all summary information from the symbols and remember those that |
| 246 | // are not calculated or reserved. | 246 | // are not calculated or reserved. |
| 247 | section.Tuples.RemoveAt(i); | 247 | section.Symbols.RemoveAt(i); |
| 248 | 248 | ||
| 249 | if (patchSummaryInfo.PropertyId != SummaryInformationType.PatchProductCodes && | 249 | if (patchSummaryInfo.PropertyId != SummaryInformationType.PatchProductCodes && |
| 250 | patchSummaryInfo.PropertyId != SummaryInformationType.PatchCode && | 250 | patchSummaryInfo.PropertyId != SummaryInformationType.PatchCode && |
| @@ -262,39 +262,39 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 262 | return result; | 262 | return result; |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | private Dictionary<string, MsiPatchMetadataTuple> PopulateSummaryInformation(Dictionary<SummaryInformationType, SummaryInformationTuple> summaryInfo, List<IntermediateTuple> tuples, WixPatchIdTuple patchIdTuple, int codepage) | 265 | private Dictionary<string, MsiPatchMetadataSymbol> PopulateSummaryInformation(Dictionary<SummaryInformationType, SummaryInformationSymbol> summaryInfo, List<IntermediateSymbol> symbols, WixPatchIdSymbol patchIdSymbol, int codepage) |
| 266 | { | 266 | { |
| 267 | // PID_CODEPAGE | 267 | // PID_CODEPAGE |
| 268 | if (!summaryInfo.ContainsKey(SummaryInformationType.Codepage)) | 268 | if (!summaryInfo.ContainsKey(SummaryInformationType.Codepage)) |
| 269 | { | 269 | { |
| 270 | // Set the code page by default to the same code page for the | 270 | // Set the code page by default to the same code page for the |
| 271 | // string pool in the database. | 271 | // string pool in the database. |
| 272 | AddSummaryInformation(SummaryInformationType.Codepage, codepage.ToString(CultureInfo.InvariantCulture), patchIdTuple.SourceLineNumbers); | 272 | AddSummaryInformation(SummaryInformationType.Codepage, codepage.ToString(CultureInfo.InvariantCulture), patchIdSymbol.SourceLineNumbers); |
| 273 | } | 273 | } |
| 274 | 274 | ||
| 275 | // GUID patch code for the patch. | 275 | // GUID patch code for the patch. |
| 276 | AddSummaryInformation(SummaryInformationType.PatchCode, patchIdTuple.Id.Id, patchIdTuple.SourceLineNumbers); | 276 | AddSummaryInformation(SummaryInformationType.PatchCode, patchIdSymbol.Id.Id, patchIdSymbol.SourceLineNumbers); |
| 277 | 277 | ||
| 278 | // Indicates the minimum Windows Installer version that is required to install the patch. | 278 | // Indicates the minimum Windows Installer version that is required to install the patch. |
| 279 | AddSummaryInformation(SummaryInformationType.PatchInstallerRequirement, ((int)SummaryInformation.InstallerRequirement.Version31).ToString(CultureInfo.InvariantCulture), patchIdTuple.SourceLineNumbers); | 279 | AddSummaryInformation(SummaryInformationType.PatchInstallerRequirement, ((int)SummaryInformation.InstallerRequirement.Version31).ToString(CultureInfo.InvariantCulture), patchIdSymbol.SourceLineNumbers); |
| 280 | 280 | ||
| 281 | if (!summaryInfo.ContainsKey(SummaryInformationType.Security)) | 281 | if (!summaryInfo.ContainsKey(SummaryInformationType.Security)) |
| 282 | { | 282 | { |
| 283 | AddSummaryInformation(SummaryInformationType.Security, "4", patchIdTuple.SourceLineNumbers); // Read-only enforced; | 283 | AddSummaryInformation(SummaryInformationType.Security, "4", patchIdSymbol.SourceLineNumbers); // Read-only enforced; |
| 284 | } | 284 | } |
| 285 | 285 | ||
| 286 | // Use authored comments or default to display name. | 286 | // Use authored comments or default to display name. |
| 287 | MsiPatchMetadataTuple commentsTuple = null; | 287 | MsiPatchMetadataSymbol commentsSymbol = null; |
| 288 | 288 | ||
| 289 | var metadataTuples = tuples.OfType<MsiPatchMetadataTuple>().Where(t => String.IsNullOrEmpty(t.Company)).ToDictionary(t => t.Property); | 289 | var metadataSymbols = symbols.OfType<MsiPatchMetadataSymbol>().Where(t => String.IsNullOrEmpty(t.Company)).ToDictionary(t => t.Property); |
| 290 | 290 | ||
| 291 | if (!summaryInfo.ContainsKey(SummaryInformationType.Title) && | 291 | if (!summaryInfo.ContainsKey(SummaryInformationType.Title) && |
| 292 | metadataTuples.TryGetValue("DisplayName", out var displayName)) | 292 | metadataSymbols.TryGetValue("DisplayName", out var displayName)) |
| 293 | { | 293 | { |
| 294 | AddSummaryInformation(SummaryInformationType.Title, displayName.Value, displayName.SourceLineNumbers); | 294 | AddSummaryInformation(SummaryInformationType.Title, displayName.Value, displayName.SourceLineNumbers); |
| 295 | 295 | ||
| 296 | // Default comments to use display name as-is. | 296 | // Default comments to use display name as-is. |
| 297 | commentsTuple = displayName; | 297 | commentsSymbol = displayName; |
| 298 | } | 298 | } |
| 299 | 299 | ||
| 300 | // TODO: This code below seems unnecessary given the codepage is set at the top of this method. | 300 | // TODO: This code below seems unnecessary given the codepage is set at the top of this method. |
| @@ -305,38 +305,38 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 305 | //} | 305 | //} |
| 306 | 306 | ||
| 307 | if (!summaryInfo.ContainsKey(SummaryInformationType.PatchPackageName) && | 307 | if (!summaryInfo.ContainsKey(SummaryInformationType.PatchPackageName) && |
| 308 | metadataTuples.TryGetValue("Description", out var description)) | 308 | metadataSymbols.TryGetValue("Description", out var description)) |
| 309 | { | 309 | { |
| 310 | AddSummaryInformation(SummaryInformationType.PatchPackageName, description.Value, description.SourceLineNumbers); | 310 | AddSummaryInformation(SummaryInformationType.PatchPackageName, description.Value, description.SourceLineNumbers); |
| 311 | } | 311 | } |
| 312 | 312 | ||
| 313 | if (!summaryInfo.ContainsKey(SummaryInformationType.Author) && | 313 | if (!summaryInfo.ContainsKey(SummaryInformationType.Author) && |
| 314 | metadataTuples.TryGetValue("ManufacturerName", out var manufacturer)) | 314 | metadataSymbols.TryGetValue("ManufacturerName", out var manufacturer)) |
| 315 | { | 315 | { |
| 316 | AddSummaryInformation(SummaryInformationType.Author, manufacturer.Value, manufacturer.SourceLineNumbers); | 316 | AddSummaryInformation(SummaryInformationType.Author, manufacturer.Value, manufacturer.SourceLineNumbers); |
| 317 | } | 317 | } |
| 318 | 318 | ||
| 319 | // Special metadata marshalled through the build. | 319 | // Special metadata marshalled through the build. |
| 320 | //var wixMetadataValues = tuples.OfType<WixPatchMetadataTuple>().ToDictionary(t => t.Id.Id, t => t.Value); | 320 | //var wixMetadataValues = symbols.OfType<WixPatchMetadataSymbol>().ToDictionary(t => t.Id.Id, t => t.Value); |
| 321 | 321 | ||
| 322 | //if (wixMetadataValues.TryGetValue("Comments", out var wixComments)) | 322 | //if (wixMetadataValues.TryGetValue("Comments", out var wixComments)) |
| 323 | if (metadataTuples.TryGetValue("Comments", out var wixComments)) | 323 | if (metadataSymbols.TryGetValue("Comments", out var wixComments)) |
| 324 | { | 324 | { |
| 325 | commentsTuple = wixComments; | 325 | commentsSymbol = wixComments; |
| 326 | } | 326 | } |
| 327 | 327 | ||
| 328 | // Write the package comments to summary info. | 328 | // Write the package comments to summary info. |
| 329 | if (!summaryInfo.ContainsKey(SummaryInformationType.Comments) && | 329 | if (!summaryInfo.ContainsKey(SummaryInformationType.Comments) && |
| 330 | commentsTuple != null) | 330 | commentsSymbol != null) |
| 331 | { | 331 | { |
| 332 | AddSummaryInformation(SummaryInformationType.Comments, commentsTuple.Value, commentsTuple.SourceLineNumbers); | 332 | AddSummaryInformation(SummaryInformationType.Comments, commentsSymbol.Value, commentsSymbol.SourceLineNumbers); |
| 333 | } | 333 | } |
| 334 | 334 | ||
| 335 | return metadataTuples; | 335 | return metadataSymbols; |
| 336 | 336 | ||
| 337 | void AddSummaryInformation(SummaryInformationType type, string value, SourceLineNumber sourceLineNumber) | 337 | void AddSummaryInformation(SummaryInformationType type, string value, SourceLineNumber sourceLineNumber) |
| 338 | { | 338 | { |
| 339 | summaryInfo.Add(type, new SummaryInformationTuple(sourceLineNumber) | 339 | summaryInfo.Add(type, new SummaryInformationSymbol(sourceLineNumber) |
| 340 | { | 340 | { |
| 341 | PropertyId = type, | 341 | PropertyId = type, |
| 342 | Value = value | 342 | Value = value |
| @@ -379,9 +379,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 379 | /// Reduce the transform according to the patch references. | 379 | /// Reduce the transform according to the patch references. |
| 380 | /// </summary> | 380 | /// </summary> |
| 381 | /// <param name="transform">transform generated by torch.</param> | 381 | /// <param name="transform">transform generated by torch.</param> |
| 382 | /// <param name="patchRefTuples">Table contains patch family filter.</param> | 382 | /// <param name="patchRefSymbols">Table contains patch family filter.</param> |
| 383 | /// <returns>true if the transform is not empty</returns> | 383 | /// <returns>true if the transform is not empty</returns> |
| 384 | private bool ReduceTransform(WindowsInstallerData transform, IEnumerable<WixPatchRefTuple> patchRefTuples) | 384 | private bool ReduceTransform(WindowsInstallerData transform, IEnumerable<WixPatchRefSymbol> patchRefSymbols) |
| 385 | { | 385 | { |
| 386 | // identify sections to keep | 386 | // identify sections to keep |
| 387 | var oldSections = new Dictionary<string, Row>(); | 387 | var oldSections = new Dictionary<string, Row>(); |
| @@ -402,10 +402,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 402 | var directoryLockPermissionsIndex = new Dictionary<string, List<Row>>(); | 402 | var directoryLockPermissionsIndex = new Dictionary<string, List<Row>>(); |
| 403 | var directoryMsiLockPermissionsExIndex = new Dictionary<string, List<Row>>(); | 403 | var directoryMsiLockPermissionsExIndex = new Dictionary<string, List<Row>>(); |
| 404 | 404 | ||
| 405 | foreach (var patchRefTuple in patchRefTuples) | 405 | foreach (var patchRefSymbol in patchRefSymbols) |
| 406 | { | 406 | { |
| 407 | var tableName = patchRefTuple.Table; | 407 | var tableName = patchRefSymbol.Table; |
| 408 | var key = patchRefTuple.PrimaryKeys; | 408 | var key = patchRefSymbol.PrimaryKeys; |
| 409 | 409 | ||
| 410 | // Short circuit filtering if all changes should be included. | 410 | // Short circuit filtering if all changes should be included. |
| 411 | if ("*" == tableName && "*" == key) | 411 | if ("*" == tableName && "*" == key) |
| @@ -1090,7 +1090,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 1090 | /// <summary> | 1090 | /// <summary> |
| 1091 | /// Create the #transform for the given main transform. | 1091 | /// Create the #transform for the given main transform. |
| 1092 | /// </summary> | 1092 | /// </summary> |
| 1093 | private WindowsInstallerData BuildPairedTransform(Dictionary<SummaryInformationType, SummaryInformationTuple> summaryInfo, Dictionary<string, MsiPatchMetadataTuple> patchMetadata, WixPatchIdTuple patchIdTuple, WindowsInstallerData mainTransform, MediaTuple mediaTuple, WixPatchBaselineTuple baselineTuple, out string productCode) | 1093 | private WindowsInstallerData BuildPairedTransform(Dictionary<SummaryInformationType, SummaryInformationSymbol> summaryInfo, Dictionary<string, MsiPatchMetadataSymbol> patchMetadata, WixPatchIdSymbol patchIdSymbol, WindowsInstallerData mainTransform, MediaSymbol mediaSymbol, WixPatchBaselineSymbol baselineSymbol, out string productCode) |
| 1094 | { | 1094 | { |
| 1095 | productCode = null; | 1095 | productCode = null; |
| 1096 | 1096 | ||
| @@ -1106,11 +1106,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 1106 | var mainSummaryTable = mainTransform.Tables["_SummaryInformation"]; | 1106 | var mainSummaryTable = mainTransform.Tables["_SummaryInformation"]; |
| 1107 | var mainSummaryRows = mainSummaryTable.Rows.ToDictionary(r => r.FieldAsInteger(0)); | 1107 | var mainSummaryRows = mainSummaryTable.Rows.ToDictionary(r => r.FieldAsInteger(0)); |
| 1108 | 1108 | ||
| 1109 | var baselineValidationFlags = ((int)baselineTuple.ValidationFlags).ToString(CultureInfo.InvariantCulture); | 1109 | var baselineValidationFlags = ((int)baselineSymbol.ValidationFlags).ToString(CultureInfo.InvariantCulture); |
| 1110 | 1110 | ||
| 1111 | if (!mainSummaryRows.ContainsKey((int)SummaryInformationType.TransformValidationFlags)) | 1111 | if (!mainSummaryRows.ContainsKey((int)SummaryInformationType.TransformValidationFlags)) |
| 1112 | { | 1112 | { |
| 1113 | var mainSummaryRow = mainSummaryTable.CreateRow(baselineTuple.SourceLineNumbers); | 1113 | var mainSummaryRow = mainSummaryTable.CreateRow(baselineSymbol.SourceLineNumbers); |
| 1114 | mainSummaryRow[0] = (int)SummaryInformationType.TransformValidationFlags; | 1114 | mainSummaryRow[0] = (int)SummaryInformationType.TransformValidationFlags; |
| 1115 | mainSummaryRow[1] = baselineValidationFlags; | 1115 | mainSummaryRow[1] = baselineValidationFlags; |
| 1116 | } | 1116 | } |
| @@ -1177,7 +1177,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 1177 | mainFileRow.CopyTo(pairedFileRow); | 1177 | mainFileRow.CopyTo(pairedFileRow); |
| 1178 | 1178 | ||
| 1179 | // Override authored media for patch bind. | 1179 | // Override authored media for patch bind. |
| 1180 | mainFileRow.DiskId = mediaTuple.DiskId; | 1180 | mainFileRow.DiskId = mediaSymbol.DiskId; |
| 1181 | 1181 | ||
| 1182 | // Suppress any change to File.Sequence to avoid bloat. | 1182 | // Suppress any change to File.Sequence to avoid bloat. |
| 1183 | mainFileRow.Fields[7].Modified = false; | 1183 | mainFileRow.Fields[7].Modified = false; |
| @@ -1200,78 +1200,78 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 1200 | 1200 | ||
| 1201 | // Add Media row to pairedTransform | 1201 | // Add Media row to pairedTransform |
| 1202 | var pairedMediaTable = pairedTransform.EnsureTable(this.tableDefinitions["Media"]); | 1202 | var pairedMediaTable = pairedTransform.EnsureTable(this.tableDefinitions["Media"]); |
| 1203 | var pairedMediaRow = (MediaRow)pairedMediaTable.CreateRow(mediaTuple.SourceLineNumbers); | 1203 | var pairedMediaRow = (MediaRow)pairedMediaTable.CreateRow(mediaSymbol.SourceLineNumbers); |
| 1204 | pairedMediaRow.Operation = RowOperation.Add; | 1204 | pairedMediaRow.Operation = RowOperation.Add; |
| 1205 | pairedMediaRow.DiskId = mediaTuple.DiskId; | 1205 | pairedMediaRow.DiskId = mediaSymbol.DiskId; |
| 1206 | pairedMediaRow.LastSequence = mediaTuple.LastSequence ?? 0; | 1206 | pairedMediaRow.LastSequence = mediaSymbol.LastSequence ?? 0; |
| 1207 | pairedMediaRow.DiskPrompt = mediaTuple.DiskPrompt; | 1207 | pairedMediaRow.DiskPrompt = mediaSymbol.DiskPrompt; |
| 1208 | pairedMediaRow.Cabinet = mediaTuple.Cabinet; | 1208 | pairedMediaRow.Cabinet = mediaSymbol.Cabinet; |
| 1209 | pairedMediaRow.VolumeLabel = mediaTuple.VolumeLabel; | 1209 | pairedMediaRow.VolumeLabel = mediaSymbol.VolumeLabel; |
| 1210 | pairedMediaRow.Source = mediaTuple.Source; | 1210 | pairedMediaRow.Source = mediaSymbol.Source; |
| 1211 | 1211 | ||
| 1212 | // Add PatchPackage for this Media | 1212 | // Add PatchPackage for this Media |
| 1213 | var pairedPackageTable = pairedTransform.EnsureTable(this.tableDefinitions["PatchPackage"]); | 1213 | var pairedPackageTable = pairedTransform.EnsureTable(this.tableDefinitions["PatchPackage"]); |
| 1214 | pairedPackageTable.Operation = TableOperation.Add; | 1214 | pairedPackageTable.Operation = TableOperation.Add; |
| 1215 | var pairedPackageRow = pairedPackageTable.CreateRow(mediaTuple.SourceLineNumbers); | 1215 | var pairedPackageRow = pairedPackageTable.CreateRow(mediaSymbol.SourceLineNumbers); |
| 1216 | pairedPackageRow.Operation = RowOperation.Add; | 1216 | pairedPackageRow.Operation = RowOperation.Add; |
| 1217 | pairedPackageRow[0] = patchIdTuple.Id.Id; | 1217 | pairedPackageRow[0] = patchIdSymbol.Id.Id; |
| 1218 | pairedPackageRow[1] = mediaTuple.DiskId; | 1218 | pairedPackageRow[1] = mediaSymbol.DiskId; |
| 1219 | 1219 | ||
| 1220 | // Add the property to the patch transform's Property table. | 1220 | // Add the property to the patch transform's Property table. |
| 1221 | var pairedPropertyTable = pairedTransform.EnsureTable(this.tableDefinitions["Property"]); | 1221 | var pairedPropertyTable = pairedTransform.EnsureTable(this.tableDefinitions["Property"]); |
| 1222 | pairedPropertyTable.Operation = TableOperation.Add; | 1222 | pairedPropertyTable.Operation = TableOperation.Add; |
| 1223 | 1223 | ||
| 1224 | // Add property to both identify client patches and whether those patches are removable or not | 1224 | // Add property to both identify client patches and whether those patches are removable or not |
| 1225 | patchMetadata.TryGetValue("AllowRemoval", out var allowRemovalTuple); | 1225 | patchMetadata.TryGetValue("AllowRemoval", out var allowRemovalSymbol); |
| 1226 | 1226 | ||
| 1227 | var pairedPropertyRow = pairedPropertyTable.CreateRow(allowRemovalTuple?.SourceLineNumbers); | 1227 | var pairedPropertyRow = pairedPropertyTable.CreateRow(allowRemovalSymbol?.SourceLineNumbers); |
| 1228 | pairedPropertyRow.Operation = RowOperation.Add; | 1228 | pairedPropertyRow.Operation = RowOperation.Add; |
| 1229 | pairedPropertyRow[0] = String.Concat(patchIdTuple.ClientPatchId, ".AllowRemoval"); | 1229 | pairedPropertyRow[0] = String.Concat(patchIdSymbol.ClientPatchId, ".AllowRemoval"); |
| 1230 | pairedPropertyRow[1] = allowRemovalTuple?.Value ?? "0"; | 1230 | pairedPropertyRow[1] = allowRemovalSymbol?.Value ?? "0"; |
| 1231 | 1231 | ||
| 1232 | // Add this patch code GUID to the patch transform to identify | 1232 | // Add this patch code GUID to the patch transform to identify |
| 1233 | // which patches are installed, including in multi-patch | 1233 | // which patches are installed, including in multi-patch |
| 1234 | // installations. | 1234 | // installations. |
| 1235 | pairedPropertyRow = pairedPropertyTable.CreateRow(patchIdTuple.SourceLineNumbers); | 1235 | pairedPropertyRow = pairedPropertyTable.CreateRow(patchIdSymbol.SourceLineNumbers); |
| 1236 | pairedPropertyRow.Operation = RowOperation.Add; | 1236 | pairedPropertyRow.Operation = RowOperation.Add; |
| 1237 | pairedPropertyRow[0] = String.Concat(patchIdTuple.ClientPatchId, ".PatchCode"); | 1237 | pairedPropertyRow[0] = String.Concat(patchIdSymbol.ClientPatchId, ".PatchCode"); |
| 1238 | pairedPropertyRow[1] = patchIdTuple.Id.Id; | 1238 | pairedPropertyRow[1] = patchIdSymbol.Id.Id; |
| 1239 | 1239 | ||
| 1240 | // Add PATCHNEWPACKAGECODE to apply to admin layouts. | 1240 | // Add PATCHNEWPACKAGECODE to apply to admin layouts. |
| 1241 | pairedPropertyRow = pairedPropertyTable.CreateRow(patchIdTuple.SourceLineNumbers); | 1241 | pairedPropertyRow = pairedPropertyTable.CreateRow(patchIdSymbol.SourceLineNumbers); |
| 1242 | pairedPropertyRow.Operation = RowOperation.Add; | 1242 | pairedPropertyRow.Operation = RowOperation.Add; |
| 1243 | pairedPropertyRow[0] = "PATCHNEWPACKAGECODE"; | 1243 | pairedPropertyRow[0] = "PATCHNEWPACKAGECODE"; |
| 1244 | pairedPropertyRow[1] = patchIdTuple.Id.Id; | 1244 | pairedPropertyRow[1] = patchIdSymbol.Id.Id; |
| 1245 | 1245 | ||
| 1246 | // Add PATCHNEWSUMMARYCOMMENTS and PATCHNEWSUMMARYSUBJECT to apply to admin layouts. | 1246 | // Add PATCHNEWSUMMARYCOMMENTS and PATCHNEWSUMMARYSUBJECT to apply to admin layouts. |
| 1247 | if (summaryInfo.TryGetValue(SummaryInformationType.Subject, out var subjectTuple)) | 1247 | if (summaryInfo.TryGetValue(SummaryInformationType.Subject, out var subjectSymbol)) |
| 1248 | { | 1248 | { |
| 1249 | pairedPropertyRow = pairedPropertyTable.CreateRow(subjectTuple.SourceLineNumbers); | 1249 | pairedPropertyRow = pairedPropertyTable.CreateRow(subjectSymbol.SourceLineNumbers); |
| 1250 | pairedPropertyRow.Operation = RowOperation.Add; | 1250 | pairedPropertyRow.Operation = RowOperation.Add; |
| 1251 | pairedPropertyRow[0] = "PATCHNEWSUMMARYSUBJECT"; | 1251 | pairedPropertyRow[0] = "PATCHNEWSUMMARYSUBJECT"; |
| 1252 | pairedPropertyRow[1] = subjectTuple.Value; | 1252 | pairedPropertyRow[1] = subjectSymbol.Value; |
| 1253 | } | 1253 | } |
| 1254 | 1254 | ||
| 1255 | if (summaryInfo.TryGetValue(SummaryInformationType.Comments, out var commentsTuple)) | 1255 | if (summaryInfo.TryGetValue(SummaryInformationType.Comments, out var commentsSymbol)) |
| 1256 | { | 1256 | { |
| 1257 | pairedPropertyRow = pairedPropertyTable.CreateRow(commentsTuple.SourceLineNumbers); | 1257 | pairedPropertyRow = pairedPropertyTable.CreateRow(commentsSymbol.SourceLineNumbers); |
| 1258 | pairedPropertyRow.Operation = RowOperation.Add; | 1258 | pairedPropertyRow.Operation = RowOperation.Add; |
| 1259 | pairedPropertyRow[0] = "PATCHNEWSUMMARYCOMMENTS"; | 1259 | pairedPropertyRow[0] = "PATCHNEWSUMMARYCOMMENTS"; |
| 1260 | pairedPropertyRow[1] = commentsTuple.Value; | 1260 | pairedPropertyRow[1] = commentsSymbol.Value; |
| 1261 | } | 1261 | } |
| 1262 | 1262 | ||
| 1263 | return pairedTransform; | 1263 | return pairedTransform; |
| 1264 | } | 1264 | } |
| 1265 | 1265 | ||
| 1266 | private static SortedSet<string> FinalizePatchProductCodes(List<IntermediateTuple> tuples, SortedSet<string> productCodes) | 1266 | private static SortedSet<string> FinalizePatchProductCodes(List<IntermediateSymbol> symbols, SortedSet<string> productCodes) |
| 1267 | { | 1267 | { |
| 1268 | var patchTargetTuples = tuples.OfType<WixPatchTargetTuple>().ToList(); | 1268 | var patchTargetSymbols = symbols.OfType<WixPatchTargetSymbol>().ToList(); |
| 1269 | 1269 | ||
| 1270 | if (patchTargetTuples.Any()) | 1270 | if (patchTargetSymbols.Any()) |
| 1271 | { | 1271 | { |
| 1272 | var targets = new SortedSet<string>(); | 1272 | var targets = new SortedSet<string>(); |
| 1273 | var replace = true; | 1273 | var replace = true; |
| 1274 | foreach (var wixPatchTargetRow in patchTargetTuples) | 1274 | foreach (var wixPatchTargetRow in patchTargetSymbols) |
| 1275 | { | 1275 | { |
| 1276 | var target = wixPatchTargetRow.ProductCode.ToUpperInvariant(); | 1276 | var target = wixPatchTargetRow.ProductCode.ToUpperInvariant(); |
| 1277 | if (target == "*") | 1277 | if (target == "*") |
