From 38afa9e7bc7eacc021f8805f607368a05751e3c3 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 25 Jun 2020 14:43:50 -0700 Subject: The Great Tuple to Symbol Rename (tm) --- .../Bind/AddBackSuppressedSequenceTablesCommand.cs | 2 +- .../Bind/AddCreateFoldersCommand.cs | 16 +- .../Bind/AssignMediaCommand.cs | 100 +- .../Bind/AttachPatchTransformsCommand.cs | 170 ++-- .../Bind/BindDatabaseCommand.cs | 26 +- .../Bind/BindSummaryInfoCommand.cs | 24 +- .../Bind/BindTransformCommand.cs | 2 +- .../Bind/CalculateComponentGuids.cs | 52 +- .../Bind/CopyTransformDataCommand.cs | 14 +- .../Bind/CreateCabinetsCommand.cs | 48 +- .../Bind/CreateDeltaPatchesCommand.cs | 8 +- .../Bind/CreateInstanceTransformsCommand.cs | 42 +- .../Bind/CreateOutputFromIRCommand.cs | 1074 ++++++++++---------- .../Bind/CreatePatchTransformsCommand.cs | 16 +- .../Bind/CreateSpecialPropertiesCommand.cs | 14 +- .../Bind/ExtractMergeModuleFilesCommand.cs | 26 +- .../Bind/GenerateTransformCommand.cs | 2 +- .../Bind/GetFileFacadesCommand.cs | 14 +- .../Bind/LoadTableDefinitionsCommand.cs | 16 +- .../Bind/MergeModulesCommand.cs | 12 +- .../Bind/ModularizeCommand.cs | 16 +- .../Bind/ProcessUncompressedFilesCommand.cs | 12 +- .../Bind/SequenceActionsCommand.cs | 344 +++---- .../Bind/UpdateFileFacadesCommand.cs | 50 +- .../Bind/UpdateFromTextFilesCommand.cs | 8 +- .../Bind/UpdateMediaSequencesCommand.cs | 38 +- .../Bind/UpdateTransformsWithFileFacades.cs | 14 +- .../Bind/ValidateComponentGuidsCommand.cs | 16 +- 28 files changed, 1088 insertions(+), 1088 deletions(-) (limited to 'src/WixToolset.Core.WindowsInstaller/Bind') diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/AddBackSuppressedSequenceTablesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/AddBackSuppressedSequenceTablesCommand.cs index d83e3684..cbba6030 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/AddBackSuppressedSequenceTablesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/AddBackSuppressedSequenceTablesCommand.cs @@ -4,7 +4,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind { using System; using System.Collections.Generic; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; /// diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/AddCreateFoldersCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/AddCreateFoldersCommand.cs index ba844da4..c4fddb3e 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/AddCreateFoldersCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/AddCreateFoldersCommand.cs @@ -5,10 +5,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Collections.Generic; using System.Linq; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; /// - /// Add CreateFolder tuples, if not already present, for null-keypath components. + /// Add CreateFolder symbols, if not already present, for null-keypath components. /// internal class AddCreateFoldersCommand { @@ -21,15 +21,15 @@ namespace WixToolset.Core.WindowsInstaller.Bind public void Execute() { - var createFolderTuplesByComponentRef = new HashSet(this.Section.Tuples.OfType().Select(t => t.ComponentRef)); - foreach (var componentTuple in this.Section.Tuples.OfType().Where(t => t.KeyPathType == ComponentKeyPathType.Directory).ToList()) + var createFolderSymbolsByComponentRef = new HashSet(this.Section.Symbols.OfType().Select(t => t.ComponentRef)); + foreach (var componentSymbol in this.Section.Symbols.OfType().Where(t => t.KeyPathType == ComponentKeyPathType.Directory).ToList()) { - if (!createFolderTuplesByComponentRef.Contains(componentTuple.Id.Id)) + if (!createFolderSymbolsByComponentRef.Contains(componentSymbol.Id.Id)) { - this.Section.AddTuple(new CreateFolderTuple(componentTuple.SourceLineNumbers) + this.Section.AddSymbol(new CreateFolderSymbol(componentSymbol.SourceLineNumbers) { - DirectoryRef = componentTuple.DirectoryRef, - ComponentRef = componentTuple.Id.Id, + DirectoryRef = componentSymbol.DirectoryRef, + ComponentRef = componentSymbol.Id.Id, }); } } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs index 773b3225..eccc97d2 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs @@ -8,7 +8,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Linq; using WixToolset.Core.Bind; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Extensibility.Services; /// @@ -40,7 +40,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind /// /// Gets cabinets with their file rows. /// - public Dictionary> FileFacadesByCabinetMedia { get; private set; } + public Dictionary> FileFacadesByCabinetMedia { get; private set; } /// /// Get uncompressed file rows. This will contain file rows of File elements that are marked with compression=no. @@ -50,49 +50,49 @@ namespace WixToolset.Core.WindowsInstaller.Bind public void Execute() { - var mediaTuples = this.Section.Tuples.OfType().ToList(); - var mediaTemplateTuples = this.Section.Tuples.OfType().ToList(); + var mediaSymbols = this.Section.Symbols.OfType().ToList(); + var mediaTemplateSymbols = this.Section.Symbols.OfType().ToList(); - // If both tuples are authored, it is an error. - if (mediaTemplateTuples.Count > 0 && mediaTuples.Count > 1) + // If both symbols are authored, it is an error. + if (mediaTemplateSymbols.Count > 0 && mediaSymbols.Count > 1) { throw new WixException(ErrorMessages.MediaTableCollision(null)); } - // If neither tuple is authored, default to a media template. - if (SectionType.Product == this.Section.Type && mediaTemplateTuples.Count == 0 && mediaTuples.Count == 0) + // If neither symbol is authored, default to a media template. + if (SectionType.Product == this.Section.Type && mediaTemplateSymbols.Count == 0 && mediaSymbols.Count == 0) { - var mediaTemplate = new WixMediaTemplateTuple() + var mediaTemplate = new WixMediaTemplateSymbol() { CabinetTemplate = "cab{0}.cab", }; - this.Section.AddTuple(mediaTemplate); - mediaTemplateTuples.Add(mediaTemplate); + this.Section.AddSymbol(mediaTemplate); + mediaTemplateSymbols.Add(mediaTemplate); } // When building merge module, all the files go to "#MergeModule.CABinet". if (SectionType.Module == this.Section.Type) { - var mergeModuleMediaTuple = this.Section.AddTuple(new MediaTuple + var mergeModuleMediaSymbol = this.Section.AddSymbol(new MediaSymbol { Cabinet = "#MergeModule.CABinet", }); - this.FileFacadesByCabinetMedia = new Dictionary> + this.FileFacadesByCabinetMedia = new Dictionary> { - { mergeModuleMediaTuple, this.FileFacades } + { mergeModuleMediaSymbol, this.FileFacades } }; this.UncompressedFileFacades = Array.Empty(); } - else if (mediaTemplateTuples.Count == 0) + else if (mediaTemplateSymbols.Count == 0) { - var filesByCabinetMedia = new Dictionary>(); + var filesByCabinetMedia = new Dictionary>(); var uncompressedFiles = new List(); - this.ManuallyAssignFiles(mediaTuples, filesByCabinetMedia, uncompressedFiles); + this.ManuallyAssignFiles(mediaSymbols, filesByCabinetMedia, uncompressedFiles); this.FileFacadesByCabinetMedia = filesByCabinetMedia.ToDictionary(kvp => kvp.Key, kvp => (IEnumerable)kvp.Value); @@ -100,11 +100,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind } else { - var filesByCabinetMedia = new Dictionary>(); + var filesByCabinetMedia = new Dictionary>(); var uncompressedFiles = new List(); - this.AutoAssignFiles(mediaTuples, filesByCabinetMedia, uncompressedFiles); + this.AutoAssignFiles(mediaSymbols, filesByCabinetMedia, uncompressedFiles); this.FileFacadesByCabinetMedia = filesByCabinetMedia.ToDictionary(kvp => kvp.Key, kvp => (IEnumerable)kvp.Value); @@ -116,7 +116,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind /// Assign files to cabinets based on MediaTemplate authoring. /// /// FileRowCollection - private void AutoAssignFiles(List mediaTable, Dictionary> filesByCabinetMedia, List uncompressedFiles) + private void AutoAssignFiles(List mediaTable, Dictionary> filesByCabinetMedia, List uncompressedFiles) { const int MaxCabIndex = 999; @@ -125,15 +125,15 @@ namespace WixToolset.Core.WindowsInstaller.Bind var maxPreCabSizeInMB = 0; var currentCabIndex = 0; - MediaTuple currentMediaRow = null; + MediaSymbol currentMediaRow = null; - var mediaTemplateTable = this.Section.Tuples.OfType(); + var mediaTemplateTable = this.Section.Symbols.OfType(); - // Remove all previous media tuples since they will be replaced with + // Remove all previous media symbols since they will be replaced with // media template. - foreach (var mediaTuple in mediaTable) + foreach (var mediaSymbol in mediaTable) { - this.Section.Tuples.Remove(mediaTuple); + this.Section.Symbols.Remove(mediaSymbol); } // Auto assign files to cabinets based on maximum uncompressed media size @@ -169,7 +169,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind throw new WixException(ErrorMessages.MaximumUncompressedMediaSizeTooLarge(null, maxPreCabSizeInMB)); } - var mediaTuplesByDiskId = new Dictionary(); + var mediaSymbolsByDiskId = new Dictionary(); foreach (var facade in this.FileFacades) { @@ -193,8 +193,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind // Overflow due to current file if (currentPreCabSize > maxPreCabSizeInBytes) { - currentMediaRow = this.AddMediaTuple(mediaTemplateRow, ++currentCabIndex); - mediaTuplesByDiskId.Add(currentMediaRow.DiskId, currentMediaRow); + currentMediaRow = this.AddMediaSymbol(mediaTemplateRow, ++currentCabIndex); + mediaSymbolsByDiskId.Add(currentMediaRow.DiskId, currentMediaRow); filesByCabinetMedia.Add(currentMediaRow, new List()); // Now files larger than MaxUncompressedMediaSize will be the only file in its cabinet so as to respect MaxUncompressedMediaSize @@ -205,8 +205,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (currentMediaRow == null) { // Create new cab and MediaRow - currentMediaRow = this.AddMediaTuple(mediaTemplateRow, ++currentCabIndex); - mediaTuplesByDiskId.Add(currentMediaRow.DiskId, currentMediaRow); + currentMediaRow = this.AddMediaSymbol(mediaTemplateRow, ++currentCabIndex); + mediaSymbolsByDiskId.Add(currentMediaRow.DiskId, currentMediaRow); filesByCabinetMedia.Add(currentMediaRow, new List()); } } @@ -219,52 +219,52 @@ namespace WixToolset.Core.WindowsInstaller.Bind } // If there are uncompressed files and no MediaRow, create a default one. - if (uncompressedFiles.Count > 0 && !this.Section.Tuples.OfType().Any()) + if (uncompressedFiles.Count > 0 && !this.Section.Symbols.OfType().Any()) { - var defaultMediaRow = this.Section.AddTuple(new MediaTuple(null, new Identifier(AccessModifier.Private, 1)) + var defaultMediaRow = this.Section.AddSymbol(new MediaSymbol(null, new Identifier(AccessModifier.Private, 1)) { DiskId = 1, }); - mediaTuplesByDiskId.Add(1, defaultMediaRow); + mediaSymbolsByDiskId.Add(1, defaultMediaRow); } } /// /// Assign files to cabinets based on Media authoring. /// - private void ManuallyAssignFiles(List mediaTuples, Dictionary> filesByCabinetMedia, List uncompressedFiles) + private void ManuallyAssignFiles(List mediaSymbols, Dictionary> filesByCabinetMedia, List uncompressedFiles) { - var mediaTuplesByDiskId = new Dictionary(); + var mediaSymbolsByDiskId = new Dictionary(); - if (mediaTuples.Any()) + if (mediaSymbols.Any()) { - var cabinetMediaTuples = new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach (var mediaTuple in mediaTuples) + var cabinetMediaSymbols = new Dictionary(StringComparer.OrdinalIgnoreCase); + foreach (var mediaSymbol in mediaSymbols) { // If the Media row has a cabinet, make sure it is unique across all Media rows. - if (!String.IsNullOrEmpty(mediaTuple.Cabinet)) + if (!String.IsNullOrEmpty(mediaSymbol.Cabinet)) { - if (cabinetMediaTuples.TryGetValue(mediaTuple.Cabinet, out var existingRow)) + if (cabinetMediaSymbols.TryGetValue(mediaSymbol.Cabinet, out var existingRow)) { - this.Messaging.Write(ErrorMessages.DuplicateCabinetName(mediaTuple.SourceLineNumbers, mediaTuple.Cabinet)); + this.Messaging.Write(ErrorMessages.DuplicateCabinetName(mediaSymbol.SourceLineNumbers, mediaSymbol.Cabinet)); this.Messaging.Write(ErrorMessages.DuplicateCabinetName2(existingRow.SourceLineNumbers, existingRow.Cabinet)); } else { - cabinetMediaTuples.Add(mediaTuple.Cabinet, mediaTuple); + cabinetMediaSymbols.Add(mediaSymbol.Cabinet, mediaSymbol); } - filesByCabinetMedia.Add(mediaTuple, new List()); + filesByCabinetMedia.Add(mediaSymbol, new List()); } - mediaTuplesByDiskId.Add(mediaTuple.DiskId, mediaTuple); + mediaSymbolsByDiskId.Add(mediaSymbol.DiskId, mediaSymbol); } } foreach (var facade in this.FileFacades) { - if (!mediaTuplesByDiskId.TryGetValue(facade.DiskId, out var mediaTuple)) + if (!mediaSymbolsByDiskId.TryGetValue(facade.DiskId, out var mediaSymbol)) { this.Messaging.Write(ErrorMessages.MissingMedia(facade.SourceLineNumber, facade.DiskId)); continue; @@ -280,7 +280,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } else // file is marked compressed. { - if (filesByCabinetMedia.TryGetValue(mediaTuple, out var cabinetFiles)) + if (filesByCabinetMedia.TryGetValue(mediaSymbol, out var cabinetFiles)) { cabinetFiles.Add(facade); } @@ -293,18 +293,18 @@ namespace WixToolset.Core.WindowsInstaller.Bind } /// - /// Adds a tuple to the section with cab name template filled in. + /// Adds a symbol to the section with cab name template filled in. /// /// /// /// - private MediaTuple AddMediaTuple(WixMediaTemplateTuple mediaTemplateTuple, int cabIndex) + private MediaSymbol AddMediaSymbol(WixMediaTemplateSymbol mediaTemplateSymbol, int cabIndex) { - return this.Section.AddTuple(new MediaTuple(mediaTemplateTuple.SourceLineNumbers, new Identifier(AccessModifier.Private, cabIndex)) + return this.Section.AddSymbol(new MediaSymbol(mediaTemplateSymbol.SourceLineNumbers, new Identifier(AccessModifier.Private, cabIndex)) { DiskId = cabIndex, Cabinet = String.Format(CultureInfo.InvariantCulture, this.CabinetNameTemplate, cabIndex), - CompressionLevel = mediaTemplateTuple.CompressionLevel, + CompressionLevel = mediaTemplateSymbol.CompressionLevel, }); } } 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 using System.Text.RegularExpressions; using WixToolset.Core.WindowsInstaller.Msi; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; using WixToolset.Data.WindowsInstaller.Rows; using WixToolset.Extensibility.Services; @@ -85,25 +85,25 @@ namespace WixToolset.Core.WindowsInstaller.Bind var section = this.Intermediate.Sections.First(); - var tuples = this.Intermediate.Sections.SelectMany(s => s.Tuples).ToList(); + var symbols = this.Intermediate.Sections.SelectMany(s => s.Symbols).ToList(); - // Get the patch id from the WixPatchId tuple. - var patchIdTuple = tuples.OfType().FirstOrDefault(); + // Get the patch id from the WixPatchId symbol. + var patchIdSymbol = symbols.OfType().FirstOrDefault(); - if (String.IsNullOrEmpty(patchIdTuple.Id?.Id)) + if (String.IsNullOrEmpty(patchIdSymbol.Id?.Id)) { this.Messaging.Write(ErrorMessages.ExpectedPatchIdInWixMsp()); return subStorages; } - if (String.IsNullOrEmpty(patchIdTuple.ClientPatchId)) + if (String.IsNullOrEmpty(patchIdSymbol.ClientPatchId)) { this.Messaging.Write(ErrorMessages.ExpectedClientPatchIdInWixMsp()); return subStorages; } // enumerate patch.Media to map diskId to Media row - var patchMediaByDiskId = tuples.OfType().ToDictionary(t => t.DiskId); + var patchMediaByDiskId = symbols.OfType().ToDictionary(t => t.DiskId); if (patchMediaByDiskId.Count == 0) { @@ -112,23 +112,23 @@ namespace WixToolset.Core.WindowsInstaller.Bind } // populate MSP summary information - var patchMetadata = this.PopulateSummaryInformation(summaryInfo, tuples, patchIdTuple, section.Codepage); + var patchMetadata = this.PopulateSummaryInformation(summaryInfo, symbols, patchIdSymbol, section.Codepage); // enumerate transforms var productCodes = new SortedSet(); var transformNames = new List(); var validTransform = new List>(); - var baselineTuplesById = tuples.OfType().ToDictionary(t => t.Id.Id); + var baselineSymbolsById = symbols.OfType().ToDictionary(t => t.Id.Id); foreach (var mainTransform in this.Transforms) { - var baselineTuple = baselineTuplesById[mainTransform.Baseline]; + var baselineSymbol = baselineSymbolsById[mainTransform.Baseline]; - var patchRefTuples = tuples.OfType().ToList(); - if (patchRefTuples.Count > 0) + var patchRefSymbols = symbols.OfType().ToList(); + if (patchRefSymbols.Count > 0) { - if (!this.ReduceTransform(mainTransform.Transform, patchRefTuples)) + if (!this.ReduceTransform(mainTransform.Transform, patchRefSymbols)) { // transform has none of the content authored into this patch continue; @@ -139,7 +139,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind this.Validate(mainTransform); // ensure consistent File.Sequence within each Media - var mediaTuple = patchMediaByDiskId[baselineTuple.DiskId]; + var mediaSymbol = patchMediaByDiskId[baselineSymbol.DiskId]; // Ensure that files are sequenced after the last file in any transform. var transformMediaTable = mainTransform.Transform.Tables["Media"]; @@ -147,25 +147,25 @@ namespace WixToolset.Core.WindowsInstaller.Bind { foreach (MediaRow transformMediaRow in transformMediaTable.Rows) { - if (!mediaTuple.LastSequence.HasValue || mediaTuple.LastSequence < transformMediaRow.LastSequence) + if (!mediaSymbol.LastSequence.HasValue || mediaSymbol.LastSequence < transformMediaRow.LastSequence) { // The Binder will pre-increment the sequence. - mediaTuple.LastSequence = transformMediaRow.LastSequence; + mediaSymbol.LastSequence = transformMediaRow.LastSequence; } } } // Use the Media/@DiskId if greater than the last sequence for backward compatibility. - if (!mediaTuple.LastSequence.HasValue || mediaTuple.LastSequence < mediaTuple.DiskId) + if (!mediaSymbol.LastSequence.HasValue || mediaSymbol.LastSequence < mediaSymbol.DiskId) { - mediaTuple.LastSequence = mediaTuple.DiskId; + mediaSymbol.LastSequence = mediaSymbol.DiskId; } // Ignore media table in the transform. mainTransform.Transform.Tables.Remove("Media"); mainTransform.Transform.Tables.Remove("MsiDigitalSignature"); - var pairedTransform = this.BuildPairedTransform(summaryInfo, patchMetadata, patchIdTuple, mainTransform.Transform, mediaTuple, baselineTuple, out var productCode); + var pairedTransform = this.BuildPairedTransform(summaryInfo, patchMetadata, patchIdSymbol, mainTransform.Transform, mediaSymbol, baselineSymbol, out var productCode); productCode = productCode.ToUpperInvariant(); productCodes.Add(productCode); @@ -205,17 +205,17 @@ namespace WixToolset.Core.WindowsInstaller.Bind } // Finish filling tables with transform-dependent data. - productCodes = FinalizePatchProductCodes(tuples, productCodes); + productCodes = FinalizePatchProductCodes(symbols, productCodes); // Semicolon delimited list of the product codes that can accept the patch. - summaryInfo.Add(SummaryInformationType.PatchProductCodes, new SummaryInformationTuple(patchIdTuple.SourceLineNumbers) + summaryInfo.Add(SummaryInformationType.PatchProductCodes, new SummaryInformationSymbol(patchIdSymbol.SourceLineNumbers) { PropertyId = SummaryInformationType.PatchProductCodes, Value = String.Join(";", productCodes) }); // Semicolon delimited list of transform substorage names in the order they are applied. - summaryInfo.Add(SummaryInformationType.TransformNames, new SummaryInformationTuple(patchIdTuple.SourceLineNumbers) + summaryInfo.Add(SummaryInformationType.TransformNames, new SummaryInformationSymbol(patchIdSymbol.SourceLineNumbers) { PropertyId = SummaryInformationType.TransformNames, Value = String.Join(";", transformNames) @@ -224,7 +224,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // Put the summary information that was extracted back in now that it is updated. foreach (var readSummaryInfo in summaryInfo.Values.OrderBy(s => s.PropertyId)) { - section.AddTuple(readSummaryInfo); + section.AddSymbol(readSummaryInfo); } this.SubStorages = subStorages; @@ -232,19 +232,19 @@ namespace WixToolset.Core.WindowsInstaller.Bind return subStorages; } - private Dictionary ExtractPatchSummaryInfo() + private Dictionary ExtractPatchSummaryInfo() { - var result = new Dictionary(); + var result = new Dictionary(); foreach (var section in this.Intermediate.Sections) { - for (var i = section.Tuples.Count - 1; i >= 0; i--) + for (var i = section.Symbols.Count - 1; i >= 0; i--) { - if (section.Tuples[i] is SummaryInformationTuple patchSummaryInfo) + if (section.Symbols[i] is SummaryInformationSymbol patchSummaryInfo) { - // Remove all summary information from the tuples and remember those that + // Remove all summary information from the symbols and remember those that // are not calculated or reserved. - section.Tuples.RemoveAt(i); + section.Symbols.RemoveAt(i); if (patchSummaryInfo.PropertyId != SummaryInformationType.PatchProductCodes && patchSummaryInfo.PropertyId != SummaryInformationType.PatchCode && @@ -262,39 +262,39 @@ namespace WixToolset.Core.WindowsInstaller.Bind return result; } - private Dictionary PopulateSummaryInformation(Dictionary summaryInfo, List tuples, WixPatchIdTuple patchIdTuple, int codepage) + private Dictionary PopulateSummaryInformation(Dictionary summaryInfo, List symbols, WixPatchIdSymbol patchIdSymbol, int codepage) { // PID_CODEPAGE if (!summaryInfo.ContainsKey(SummaryInformationType.Codepage)) { // Set the code page by default to the same code page for the // string pool in the database. - AddSummaryInformation(SummaryInformationType.Codepage, codepage.ToString(CultureInfo.InvariantCulture), patchIdTuple.SourceLineNumbers); + AddSummaryInformation(SummaryInformationType.Codepage, codepage.ToString(CultureInfo.InvariantCulture), patchIdSymbol.SourceLineNumbers); } // GUID patch code for the patch. - AddSummaryInformation(SummaryInformationType.PatchCode, patchIdTuple.Id.Id, patchIdTuple.SourceLineNumbers); + AddSummaryInformation(SummaryInformationType.PatchCode, patchIdSymbol.Id.Id, patchIdSymbol.SourceLineNumbers); // Indicates the minimum Windows Installer version that is required to install the patch. - AddSummaryInformation(SummaryInformationType.PatchInstallerRequirement, ((int)SummaryInformation.InstallerRequirement.Version31).ToString(CultureInfo.InvariantCulture), patchIdTuple.SourceLineNumbers); + AddSummaryInformation(SummaryInformationType.PatchInstallerRequirement, ((int)SummaryInformation.InstallerRequirement.Version31).ToString(CultureInfo.InvariantCulture), patchIdSymbol.SourceLineNumbers); if (!summaryInfo.ContainsKey(SummaryInformationType.Security)) { - AddSummaryInformation(SummaryInformationType.Security, "4", patchIdTuple.SourceLineNumbers); // Read-only enforced; + AddSummaryInformation(SummaryInformationType.Security, "4", patchIdSymbol.SourceLineNumbers); // Read-only enforced; } // Use authored comments or default to display name. - MsiPatchMetadataTuple commentsTuple = null; + MsiPatchMetadataSymbol commentsSymbol = null; - var metadataTuples = tuples.OfType().Where(t => String.IsNullOrEmpty(t.Company)).ToDictionary(t => t.Property); + var metadataSymbols = symbols.OfType().Where(t => String.IsNullOrEmpty(t.Company)).ToDictionary(t => t.Property); if (!summaryInfo.ContainsKey(SummaryInformationType.Title) && - metadataTuples.TryGetValue("DisplayName", out var displayName)) + metadataSymbols.TryGetValue("DisplayName", out var displayName)) { AddSummaryInformation(SummaryInformationType.Title, displayName.Value, displayName.SourceLineNumbers); // Default comments to use display name as-is. - commentsTuple = displayName; + commentsSymbol = displayName; } // 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 //} if (!summaryInfo.ContainsKey(SummaryInformationType.PatchPackageName) && - metadataTuples.TryGetValue("Description", out var description)) + metadataSymbols.TryGetValue("Description", out var description)) { AddSummaryInformation(SummaryInformationType.PatchPackageName, description.Value, description.SourceLineNumbers); } if (!summaryInfo.ContainsKey(SummaryInformationType.Author) && - metadataTuples.TryGetValue("ManufacturerName", out var manufacturer)) + metadataSymbols.TryGetValue("ManufacturerName", out var manufacturer)) { AddSummaryInformation(SummaryInformationType.Author, manufacturer.Value, manufacturer.SourceLineNumbers); } // Special metadata marshalled through the build. - //var wixMetadataValues = tuples.OfType().ToDictionary(t => t.Id.Id, t => t.Value); + //var wixMetadataValues = symbols.OfType().ToDictionary(t => t.Id.Id, t => t.Value); //if (wixMetadataValues.TryGetValue("Comments", out var wixComments)) - if (metadataTuples.TryGetValue("Comments", out var wixComments)) + if (metadataSymbols.TryGetValue("Comments", out var wixComments)) { - commentsTuple = wixComments; + commentsSymbol = wixComments; } // Write the package comments to summary info. if (!summaryInfo.ContainsKey(SummaryInformationType.Comments) && - commentsTuple != null) + commentsSymbol != null) { - AddSummaryInformation(SummaryInformationType.Comments, commentsTuple.Value, commentsTuple.SourceLineNumbers); + AddSummaryInformation(SummaryInformationType.Comments, commentsSymbol.Value, commentsSymbol.SourceLineNumbers); } - return metadataTuples; + return metadataSymbols; void AddSummaryInformation(SummaryInformationType type, string value, SourceLineNumber sourceLineNumber) { - summaryInfo.Add(type, new SummaryInformationTuple(sourceLineNumber) + summaryInfo.Add(type, new SummaryInformationSymbol(sourceLineNumber) { PropertyId = type, Value = value @@ -379,9 +379,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind /// Reduce the transform according to the patch references. /// /// transform generated by torch. - /// Table contains patch family filter. + /// Table contains patch family filter. /// true if the transform is not empty - private bool ReduceTransform(WindowsInstallerData transform, IEnumerable patchRefTuples) + private bool ReduceTransform(WindowsInstallerData transform, IEnumerable patchRefSymbols) { // identify sections to keep var oldSections = new Dictionary(); @@ -402,10 +402,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind var directoryLockPermissionsIndex = new Dictionary>(); var directoryMsiLockPermissionsExIndex = new Dictionary>(); - foreach (var patchRefTuple in patchRefTuples) + foreach (var patchRefSymbol in patchRefSymbols) { - var tableName = patchRefTuple.Table; - var key = patchRefTuple.PrimaryKeys; + var tableName = patchRefSymbol.Table; + var key = patchRefSymbol.PrimaryKeys; // Short circuit filtering if all changes should be included. if ("*" == tableName && "*" == key) @@ -1090,7 +1090,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind /// /// Create the #transform for the given main transform. /// - private WindowsInstallerData BuildPairedTransform(Dictionary summaryInfo, Dictionary patchMetadata, WixPatchIdTuple patchIdTuple, WindowsInstallerData mainTransform, MediaTuple mediaTuple, WixPatchBaselineTuple baselineTuple, out string productCode) + private WindowsInstallerData BuildPairedTransform(Dictionary summaryInfo, Dictionary patchMetadata, WixPatchIdSymbol patchIdSymbol, WindowsInstallerData mainTransform, MediaSymbol mediaSymbol, WixPatchBaselineSymbol baselineSymbol, out string productCode) { productCode = null; @@ -1106,11 +1106,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind var mainSummaryTable = mainTransform.Tables["_SummaryInformation"]; var mainSummaryRows = mainSummaryTable.Rows.ToDictionary(r => r.FieldAsInteger(0)); - var baselineValidationFlags = ((int)baselineTuple.ValidationFlags).ToString(CultureInfo.InvariantCulture); + var baselineValidationFlags = ((int)baselineSymbol.ValidationFlags).ToString(CultureInfo.InvariantCulture); if (!mainSummaryRows.ContainsKey((int)SummaryInformationType.TransformValidationFlags)) { - var mainSummaryRow = mainSummaryTable.CreateRow(baselineTuple.SourceLineNumbers); + var mainSummaryRow = mainSummaryTable.CreateRow(baselineSymbol.SourceLineNumbers); mainSummaryRow[0] = (int)SummaryInformationType.TransformValidationFlags; mainSummaryRow[1] = baselineValidationFlags; } @@ -1177,7 +1177,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind mainFileRow.CopyTo(pairedFileRow); // Override authored media for patch bind. - mainFileRow.DiskId = mediaTuple.DiskId; + mainFileRow.DiskId = mediaSymbol.DiskId; // Suppress any change to File.Sequence to avoid bloat. mainFileRow.Fields[7].Modified = false; @@ -1200,78 +1200,78 @@ namespace WixToolset.Core.WindowsInstaller.Bind // Add Media row to pairedTransform var pairedMediaTable = pairedTransform.EnsureTable(this.tableDefinitions["Media"]); - var pairedMediaRow = (MediaRow)pairedMediaTable.CreateRow(mediaTuple.SourceLineNumbers); + var pairedMediaRow = (MediaRow)pairedMediaTable.CreateRow(mediaSymbol.SourceLineNumbers); pairedMediaRow.Operation = RowOperation.Add; - pairedMediaRow.DiskId = mediaTuple.DiskId; - pairedMediaRow.LastSequence = mediaTuple.LastSequence ?? 0; - pairedMediaRow.DiskPrompt = mediaTuple.DiskPrompt; - pairedMediaRow.Cabinet = mediaTuple.Cabinet; - pairedMediaRow.VolumeLabel = mediaTuple.VolumeLabel; - pairedMediaRow.Source = mediaTuple.Source; + pairedMediaRow.DiskId = mediaSymbol.DiskId; + pairedMediaRow.LastSequence = mediaSymbol.LastSequence ?? 0; + pairedMediaRow.DiskPrompt = mediaSymbol.DiskPrompt; + pairedMediaRow.Cabinet = mediaSymbol.Cabinet; + pairedMediaRow.VolumeLabel = mediaSymbol.VolumeLabel; + pairedMediaRow.Source = mediaSymbol.Source; // Add PatchPackage for this Media var pairedPackageTable = pairedTransform.EnsureTable(this.tableDefinitions["PatchPackage"]); pairedPackageTable.Operation = TableOperation.Add; - var pairedPackageRow = pairedPackageTable.CreateRow(mediaTuple.SourceLineNumbers); + var pairedPackageRow = pairedPackageTable.CreateRow(mediaSymbol.SourceLineNumbers); pairedPackageRow.Operation = RowOperation.Add; - pairedPackageRow[0] = patchIdTuple.Id.Id; - pairedPackageRow[1] = mediaTuple.DiskId; + pairedPackageRow[0] = patchIdSymbol.Id.Id; + pairedPackageRow[1] = mediaSymbol.DiskId; // Add the property to the patch transform's Property table. var pairedPropertyTable = pairedTransform.EnsureTable(this.tableDefinitions["Property"]); pairedPropertyTable.Operation = TableOperation.Add; // Add property to both identify client patches and whether those patches are removable or not - patchMetadata.TryGetValue("AllowRemoval", out var allowRemovalTuple); + patchMetadata.TryGetValue("AllowRemoval", out var allowRemovalSymbol); - var pairedPropertyRow = pairedPropertyTable.CreateRow(allowRemovalTuple?.SourceLineNumbers); + var pairedPropertyRow = pairedPropertyTable.CreateRow(allowRemovalSymbol?.SourceLineNumbers); pairedPropertyRow.Operation = RowOperation.Add; - pairedPropertyRow[0] = String.Concat(patchIdTuple.ClientPatchId, ".AllowRemoval"); - pairedPropertyRow[1] = allowRemovalTuple?.Value ?? "0"; + pairedPropertyRow[0] = String.Concat(patchIdSymbol.ClientPatchId, ".AllowRemoval"); + pairedPropertyRow[1] = allowRemovalSymbol?.Value ?? "0"; // Add this patch code GUID to the patch transform to identify // which patches are installed, including in multi-patch // installations. - pairedPropertyRow = pairedPropertyTable.CreateRow(patchIdTuple.SourceLineNumbers); + pairedPropertyRow = pairedPropertyTable.CreateRow(patchIdSymbol.SourceLineNumbers); pairedPropertyRow.Operation = RowOperation.Add; - pairedPropertyRow[0] = String.Concat(patchIdTuple.ClientPatchId, ".PatchCode"); - pairedPropertyRow[1] = patchIdTuple.Id.Id; + pairedPropertyRow[0] = String.Concat(patchIdSymbol.ClientPatchId, ".PatchCode"); + pairedPropertyRow[1] = patchIdSymbol.Id.Id; // Add PATCHNEWPACKAGECODE to apply to admin layouts. - pairedPropertyRow = pairedPropertyTable.CreateRow(patchIdTuple.SourceLineNumbers); + pairedPropertyRow = pairedPropertyTable.CreateRow(patchIdSymbol.SourceLineNumbers); pairedPropertyRow.Operation = RowOperation.Add; pairedPropertyRow[0] = "PATCHNEWPACKAGECODE"; - pairedPropertyRow[1] = patchIdTuple.Id.Id; + pairedPropertyRow[1] = patchIdSymbol.Id.Id; // Add PATCHNEWSUMMARYCOMMENTS and PATCHNEWSUMMARYSUBJECT to apply to admin layouts. - if (summaryInfo.TryGetValue(SummaryInformationType.Subject, out var subjectTuple)) + if (summaryInfo.TryGetValue(SummaryInformationType.Subject, out var subjectSymbol)) { - pairedPropertyRow = pairedPropertyTable.CreateRow(subjectTuple.SourceLineNumbers); + pairedPropertyRow = pairedPropertyTable.CreateRow(subjectSymbol.SourceLineNumbers); pairedPropertyRow.Operation = RowOperation.Add; pairedPropertyRow[0] = "PATCHNEWSUMMARYSUBJECT"; - pairedPropertyRow[1] = subjectTuple.Value; + pairedPropertyRow[1] = subjectSymbol.Value; } - if (summaryInfo.TryGetValue(SummaryInformationType.Comments, out var commentsTuple)) + if (summaryInfo.TryGetValue(SummaryInformationType.Comments, out var commentsSymbol)) { - pairedPropertyRow = pairedPropertyTable.CreateRow(commentsTuple.SourceLineNumbers); + pairedPropertyRow = pairedPropertyTable.CreateRow(commentsSymbol.SourceLineNumbers); pairedPropertyRow.Operation = RowOperation.Add; pairedPropertyRow[0] = "PATCHNEWSUMMARYCOMMENTS"; - pairedPropertyRow[1] = commentsTuple.Value; + pairedPropertyRow[1] = commentsSymbol.Value; } return pairedTransform; } - private static SortedSet FinalizePatchProductCodes(List tuples, SortedSet productCodes) + private static SortedSet FinalizePatchProductCodes(List symbols, SortedSet productCodes) { - var patchTargetTuples = tuples.OfType().ToList(); + var patchTargetSymbols = symbols.OfType().ToList(); - if (patchTargetTuples.Any()) + if (patchTargetSymbols.Any()) { var targets = new SortedSet(); var replace = true; - foreach (var wixPatchTargetRow in patchTargetTuples) + foreach (var wixPatchTargetRow in patchTargetSymbols) { var target = wixPatchTargetRow.ProductCode.ToUpperInvariant(); if (target == "*") diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs index ea6d49a0..950fe1c1 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs @@ -8,7 +8,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Linq; using WixToolset.Core.Bind; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; using WixToolset.Extensibility; using WixToolset.Extensibility.Data; @@ -147,7 +147,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // Add binder variables for all properties. if (SectionType.Product == section.Type || variableCache != null) { - foreach (var propertyRow in section.Tuples.OfType()) + foreach (var propertyRow in section.Symbols.OfType()) { // Set the ProductCode if it is to be generated. if ("ProductCode".Equals(propertyRow.Id.Id, StringComparison.Ordinal) && "*".Equals(propertyRow.Value, StringComparison.Ordinal)) @@ -256,13 +256,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind // Retrieve file information from merge modules. if (SectionType.Product == section.Type) { - var wixMergeTuples = section.Tuples.OfType().ToList(); + var wixMergeSymbols = section.Symbols.OfType().ToList(); - if (wixMergeTuples.Any()) + if (wixMergeSymbols.Any()) { containsMergeModules = true; - var command = new ExtractMergeModuleFilesCommand(this.Messaging, wixMergeTuples, fileFacades, installerVersion, this.IntermediateFolder, this.SuppressLayout); + var command = new ExtractMergeModuleFilesCommand(this.Messaging, wixMergeSymbols, fileFacades, installerVersion, this.IntermediateFolder, this.SuppressLayout); command.Execute(); fileFacades.AddRange(command.MergeModulesFileFacades); @@ -294,7 +294,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind command.Execute(); } -#if TODO_FINISH_UPDATE // use tuples instead of rows +#if TODO_FINISH_UPDATE // use symbols instead of rows // Extended binder extensions can be called now that fields are resolved. { Table updatedFiles = this.Output.EnsureTable(this.TableDefinitions["WixBindUpdatedFiles"]); @@ -341,20 +341,20 @@ namespace WixToolset.Core.WindowsInstaller.Bind command.Execute(); } - // Add missing CreateFolder tuples to null-keypath components. + // Add missing CreateFolder symbols to null-keypath components. { var command = new AddCreateFoldersCommand(section); command.Execute(); } - // Update tuples that reference text files on disk. + // Update symbols that reference text files on disk. { var command = new UpdateFromTextFilesCommand(this.Messaging, section); command.Execute(); } // Assign files to media and update file sequences. - Dictionary> filesByCabinetMedia; + Dictionary> filesByCabinetMedia; IEnumerable uncompressedFiles; { var order = new OptimizeFileFacadesOrderCommand(fileFacades); @@ -391,7 +391,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (output.Type == OutputType.Module) { // Modularize identifiers. - var modularize = new ModularizeCommand(output, modularizationSuffix, section.Tuples.OfType()); + var modularize = new ModularizeCommand(output, modularizationSuffix, section.Symbols.OfType()); modularize.Execute(); // Ensure all sequence tables in place because, mergemod.dll requires them. @@ -418,7 +418,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (SectionType.Patch == section.Type && this.DeltaBinaryPatch) { - var command = new CreateDeltaPatchesCommand(fileFacades, this.IntermediateFolder, section.Tuples.OfType().FirstOrDefault()); + var command = new CreateDeltaPatchesCommand(fileFacades, this.IntermediateFolder, section.Symbols.OfType().FirstOrDefault()); command.Execute(); } @@ -428,7 +428,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind { this.Messaging.Write(VerboseMessages.CreatingCabinetFiles()); - var mediaTemplate = section.Tuples.OfType().FirstOrDefault(); + var mediaTemplate = section.Symbols.OfType().FirstOrDefault(); var command = new CreateCabinetsCommand(this.ServiceProvider, this.BackendHelper, mediaTemplate); command.CabbingThreadCount = this.CabbingThreadCount; @@ -578,7 +578,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind return wixout; } - private string ResolveMedia(MediaTuple media, string mediaLayoutDirectory, string layoutDirectory) + private string ResolveMedia(MediaSymbol media, string mediaLayoutDirectory, string layoutDirectory) { string layout = null; diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindSummaryInfoCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindSummaryInfoCommand.cs index d5806fee..82688edf 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/BindSummaryInfoCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindSummaryInfoCommand.cs @@ -6,7 +6,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Globalization; using System.Linq; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; /// /// Binds the summary information table of a database. @@ -49,13 +49,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind var foundCreatingApplication = false; var now = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss", CultureInfo.InvariantCulture); - foreach (var summaryInformationTuple in this.Section.Tuples.OfType()) + foreach (var summaryInformationSymbol in this.Section.Symbols.OfType()) { - switch (summaryInformationTuple.PropertyId) + switch (summaryInformationSymbol.PropertyId) { case SummaryInformationType.Codepage: // PID_CODEPAGE // make sure the code page is an int and not a web name or null - var codepage = summaryInformationTuple.Value; + var codepage = summaryInformationSymbol.Value; if (String.IsNullOrEmpty(codepage)) { @@ -63,11 +63,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind } else { - summaryInformationTuple.Value = Common.GetValidCodePage(codepage, false, false, summaryInformationTuple.SourceLineNumbers).ToString(CultureInfo.InvariantCulture); + summaryInformationSymbol.Value = Common.GetValidCodePage(codepage, false, false, summaryInformationSymbol.SourceLineNumbers).ToString(CultureInfo.InvariantCulture); } break; case SummaryInformationType.PackageCode: // PID_REVNUMBER - var packageCode = summaryInformationTuple.Value; + var packageCode = summaryInformationSymbol.Value; if (SectionType.Module == this.Section.Type) { @@ -76,7 +76,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind else if ("*" == packageCode) { // set the revision number (package/patch code) if it should be automatically generated - summaryInformationTuple.Value = Common.GenerateGuid(); + summaryInformationSymbol.Value = Common.GenerateGuid(); } break; case SummaryInformationType.Created: @@ -86,7 +86,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind foundLastSaveDataTime = true; break; case SummaryInformationType.WindowsInstallerVersion: - this.InstallerVersion = summaryInformationTuple[SummaryInformationTupleFields.Value].AsNumber(); + this.InstallerVersion = summaryInformationSymbol[SummaryInformationSymbolFields.Value].AsNumber(); break; case SummaryInformationType.WordCount: if (SectionType.Patch == this.Section.Type) @@ -96,7 +96,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } else { - var attributes = summaryInformationTuple[SummaryInformationTupleFields.Value].AsNumber(); + var attributes = summaryInformationSymbol[SummaryInformationSymbolFields.Value].AsNumber(); this.LongNames = (0 == (attributes & 1)); this.Compressed = (2 == (attributes & 2)); } @@ -110,7 +110,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // add a summary information row for the create time/date property if its not already set if (!foundCreateDataTime) { - this.Section.AddTuple(new SummaryInformationTuple(null) + this.Section.AddSymbol(new SummaryInformationSymbol(null) { PropertyId = SummaryInformationType.Created, Value = now, @@ -120,7 +120,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // add a summary information row for the last save time/date property if its not already set if (!foundLastSaveDataTime) { - this.Section.AddTuple(new SummaryInformationTuple(null) + this.Section.AddSymbol(new SummaryInformationSymbol(null) { PropertyId = SummaryInformationType.LastSaved, Value = now, @@ -130,7 +130,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // add a summary information row for the creating application property if its not already set if (!foundCreatingApplication) { - this.Section.AddTuple(new SummaryInformationTuple(null) + this.Section.AddSymbol(new SummaryInformationSymbol(null) { PropertyId = SummaryInformationType.CreatingApplication, Value = String.Format(CultureInfo.InvariantCulture, AppCommon.GetCreatingApplicationString()), diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindTransformCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindTransformCommand.cs index ac98c82d..bc5c6853 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/BindTransformCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindTransformCommand.cs @@ -7,7 +7,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.IO; using WixToolset.Core.WindowsInstaller.Msi; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; using WixToolset.Extensibility.Services; diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs index 8135ae2e..a1e3ac83 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs @@ -7,7 +7,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.IO; using System.Linq; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; @@ -34,38 +34,38 @@ namespace WixToolset.Core.WindowsInstaller.Bind public void Execute() { - Dictionary registryKeyRows = null; + Dictionary registryKeyRows = null; Dictionary targetPathsByDirectoryId = null; Dictionary componentIdGenSeeds = null; - Dictionary> filesByComponentId = null; + Dictionary> filesByComponentId = null; // Find components with generatable guids. - foreach (var componentTuple in this.Section.Tuples.OfType()) + foreach (var componentSymbol in this.Section.Symbols.OfType()) { // Skip components that do not specify generate guid. - if (componentTuple.ComponentId != "*") + if (componentSymbol.ComponentId != "*") { continue; } - if (String.IsNullOrEmpty(componentTuple.KeyPath) || ComponentKeyPathType.OdbcDataSource == componentTuple.KeyPathType) + if (String.IsNullOrEmpty(componentSymbol.KeyPath) || ComponentKeyPathType.OdbcDataSource == componentSymbol.KeyPathType) { - this.Messaging.Write(ErrorMessages.IllegalComponentWithAutoGeneratedGuid(componentTuple.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.IllegalComponentWithAutoGeneratedGuid(componentSymbol.SourceLineNumbers)); continue; } - if (ComponentKeyPathType.Registry == componentTuple.KeyPathType) + if (ComponentKeyPathType.Registry == componentSymbol.KeyPathType) { if (registryKeyRows is null) { - registryKeyRows = this.Section.Tuples.OfType().ToDictionary(t => t.Id.Id); + registryKeyRows = this.Section.Symbols.OfType().ToDictionary(t => t.Id.Id); } - if (registryKeyRows.TryGetValue(componentTuple.KeyPath, out var foundRow)) + if (registryKeyRows.TryGetValue(componentSymbol.KeyPath, out var foundRow)) { - var bitness = componentTuple.Win64 ? "64" : String.Empty; + var bitness = componentSymbol.Win64 ? "64" : String.Empty; var regkey = String.Concat(bitness, foundRow.AsString(1), "\\", foundRow.AsString(2), "\\", foundRow.AsString(3)); - componentTuple.ComponentId = this.BackendHelper.CreateGuid(BindDatabaseCommand.WixComponentGuidNamespace, regkey.ToLowerInvariant()); + componentSymbol.ComponentId = this.BackendHelper.CreateGuid(BindDatabaseCommand.WixComponentGuidNamespace, regkey.ToLowerInvariant()); } } else // must be a File KeyPath. @@ -74,7 +74,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // of directory ids to target names do that now. if (targetPathsByDirectoryId is null) { - var directories = this.Section.Tuples.OfType().ToList(); + var directories = this.Section.Symbols.OfType().ToList(); targetPathsByDirectoryId = new Dictionary(directories.Count); @@ -95,12 +95,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind } // If the component id generation seeds have not been indexed - // from the Directory tuples do that now. + // from the Directory symbols do that now. if (componentIdGenSeeds is null) { - // If there are any Directory tuples, build up the Component Guid + // If there are any Directory symbols, build up the Component Guid // generation seeds indexed by Directory/@Id. - componentIdGenSeeds = this.Section.Tuples.OfType() + componentIdGenSeeds = this.Section.Symbols.OfType() .Where(t => !String.IsNullOrEmpty(t.ComponentGuidGenerationSeed)) .ToDictionary(t => t.Id.Id, t => t.ComponentGuidGenerationSeed); } @@ -109,15 +109,15 @@ namespace WixToolset.Core.WindowsInstaller.Bind // then do that now if (filesByComponentId is null) { - var files = this.Section.Tuples.OfType().ToList(); + var files = this.Section.Symbols.OfType().ToList(); - filesByComponentId = new Dictionary>(files.Count); + filesByComponentId = new Dictionary>(files.Count); foreach (var file in files) { if (!filesByComponentId.TryGetValue(file.ComponentRef, out var componentFiles)) { - componentFiles = new List(); + componentFiles = new List(); filesByComponentId.Add(file.ComponentRef, componentFiles); } @@ -126,16 +126,16 @@ namespace WixToolset.Core.WindowsInstaller.Bind } // validate component meets all the conditions to have a generated guid - var currentComponentFiles = filesByComponentId[componentTuple.Id.Id]; + var currentComponentFiles = filesByComponentId[componentSymbol.Id.Id]; var numFilesInComponent = currentComponentFiles.Count; string path = null; foreach (var fileRow in currentComponentFiles) { - if (fileRow.Id.Id == componentTuple.KeyPath) + if (fileRow.Id.Id == componentSymbol.KeyPath) { // calculate the key file's canonical target path - string directoryPath = this.PathResolver.GetDirectoryPath(targetPathsByDirectoryId, componentIdGenSeeds, componentTuple.DirectoryRef, true); + string directoryPath = this.PathResolver.GetDirectoryPath(targetPathsByDirectoryId, componentIdGenSeeds, componentSymbol.DirectoryRef, true); string fileName = Common.GetName(fileRow.Name, false, true).ToLowerInvariant(); path = Path.Combine(directoryPath, fileName); @@ -147,13 +147,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind path.StartsWith(@"StartMenuFolder\programs", StringComparison.Ordinal) || path.StartsWith(@"WindowsFolder\fonts", StringComparison.Ordinal)) { - this.Messaging.Write(ErrorMessages.IllegalPathForGeneratedComponentGuid(componentTuple.SourceLineNumbers, fileRow.ComponentRef, path)); + this.Messaging.Write(ErrorMessages.IllegalPathForGeneratedComponentGuid(componentSymbol.SourceLineNumbers, fileRow.ComponentRef, path)); } // if component has more than one file, the key path must be versioned if (1 < numFilesInComponent && String.IsNullOrEmpty(fileRow.Version)) { - this.Messaging.Write(ErrorMessages.IllegalGeneratedGuidComponentUnversionedKeypath(componentTuple.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.IllegalGeneratedGuidComponentUnversionedKeypath(componentSymbol.SourceLineNumbers)); } } else @@ -161,7 +161,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // not a key path, so it must be an unversioned file if component has more than one file if (1 < numFilesInComponent && !String.IsNullOrEmpty(fileRow.Version)) { - this.Messaging.Write(ErrorMessages.IllegalGeneratedGuidComponentVersionedNonkeypath(componentTuple.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.IllegalGeneratedGuidComponentVersionedNonkeypath(componentSymbol.SourceLineNumbers)); } } } @@ -169,7 +169,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // if the rules were followed, reward with a generated guid if (!this.Messaging.EncounteredError) { - componentTuple.ComponentId = this.BackendHelper.CreateGuid(BindDatabaseCommand.WixComponentGuidNamespace, path); + componentSymbol.ComponentId = this.BackendHelper.CreateGuid(BindDatabaseCommand.WixComponentGuidNamespace, path); } } } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CopyTransformDataCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CopyTransformDataCommand.cs index 0dcce61b..8a85a975 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CopyTransformDataCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CopyTransformDataCommand.cs @@ -11,7 +11,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Linq; using WixToolset.Core.Bind; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; using WixToolset.Data.WindowsInstaller.Rows; using WixToolset.Extensibility; @@ -463,9 +463,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind ref duplicateFilesSequence); if (!hasPatchFilesAction) { - WindowsInstallerStandard.TryGetStandardAction(tableName, "PatchFiles", out var patchFilesActionTuple); + WindowsInstallerStandard.TryGetStandardAction(tableName, "PatchFiles", out var patchFilesActionSymbol); - var sequence = patchFilesActionTuple.Sequence; + var sequence = patchFilesActionSymbol.Sequence; // Test for default sequence value's appropriateness if (installFilesSequence >= sequence || (0 != duplicateFilesSequence && duplicateFilesSequence <= sequence)) @@ -474,14 +474,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (duplicateFilesSequence < installFilesSequence) { - throw new WixException(ErrorMessages.InsertInvalidSequenceActionOrder(mainFileRow.SourceLineNumbers, tableName, "InstallFiles", "DuplicateFiles", patchFilesActionTuple.Action)); + throw new WixException(ErrorMessages.InsertInvalidSequenceActionOrder(mainFileRow.SourceLineNumbers, tableName, "InstallFiles", "DuplicateFiles", patchFilesActionSymbol.Action)); } else { sequence = (duplicateFilesSequence + installFilesSequence) / 2; if (installFilesSequence == sequence || duplicateFilesSequence == sequence) { - throw new WixException(ErrorMessages.InsertSequenceNoSpace(mainFileRow.SourceLineNumbers, tableName, "InstallFiles", "DuplicateFiles", patchFilesActionTuple.Action)); + throw new WixException(ErrorMessages.InsertSequenceNoSpace(mainFileRow.SourceLineNumbers, tableName, "InstallFiles", "DuplicateFiles", patchFilesActionSymbol.Action)); } } } @@ -498,8 +498,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind } var patchAction = sequenceTable.CreateRow(null); - patchAction[0] = patchFilesActionTuple.Action; - patchAction[1] = patchFilesActionTuple.Condition; + patchAction[0] = patchFilesActionSymbol.Action; + patchAction[1] = patchFilesActionSymbol.Condition; patchAction[2] = sequence; patchAction.Operation = RowOperation.Add; } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs index 9741fcd9..5c296f74 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs @@ -10,7 +10,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Runtime.InteropServices; using WixToolset.Core.Bind; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; using WixToolset.Extensibility; using WixToolset.Extensibility.Data; @@ -32,7 +32,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind private Dictionary lastCabinetAddedToMediaTable; // Key is First Cabinet Name, Value is Last Cabinet Added in the Split Sequence - public CreateCabinetsCommand(IWixToolsetServiceProvider serviceProvider, IBackendHelper backendHelper, WixMediaTemplateTuple mediaTemplate) + public CreateCabinetsCommand(IWixToolsetServiceProvider serviceProvider, IBackendHelper backendHelper, WixMediaTemplateSymbol mediaTemplate) { this.fileTransfers = new List(); @@ -51,7 +51,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind private IBackendHelper BackendHelper { get; } - private WixMediaTemplateTuple MediaTemplate { get; } + private WixMediaTemplateSymbol MediaTemplate { get; } /// /// Sets the number of threads to use for cabinet creation. @@ -80,9 +80,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind public string ModularizationSuffix { private get; set; } - public Dictionary> FileFacadesByCabinet { private get; set; } + public Dictionary> FileFacadesByCabinet { private get; set; } - public Func ResolveMedia { private get; set; } + public Func ResolveMedia { private get; set; } public TableDefinitionCollection TableDefinitions { private get; set; } @@ -113,12 +113,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind foreach (var entry in this.FileFacadesByCabinet) { - var mediaTuple = entry.Key; + var mediaSymbol = entry.Key; var files = entry.Value; - var compressionLevel = mediaTuple.CompressionLevel ?? this.DefaultCompressionLevel ?? CompressionLevel.Medium; - var cabinetDir = this.ResolveMedia(mediaTuple, mediaTuple.Layout, this.LayoutDirectory); + var compressionLevel = mediaSymbol.CompressionLevel ?? this.DefaultCompressionLevel ?? CompressionLevel.Medium; + var cabinetDir = this.ResolveMedia(mediaSymbol, mediaSymbol.Layout, this.LayoutDirectory); - var cabinetWorkItem = this.CreateCabinetWorkItem(this.Output, cabinetDir, mediaTuple, compressionLevel, files); + var cabinetWorkItem = this.CreateCabinetWorkItem(this.Output, cabinetDir, mediaSymbol, compressionLevel, files); if (null != cabinetWorkItem) { cabinetBuilder.Enqueue(cabinetWorkItem); @@ -176,28 +176,28 @@ namespace WixToolset.Core.WindowsInstaller.Bind /// /// Output for the current database. /// Directory to create cabinet in. - /// Media tuple containing information about the cabinet. + /// Media symbol containing information about the cabinet. /// Collection of files in this cabinet. /// created CabinetWorkItem object - private CabinetWorkItem CreateCabinetWorkItem(WindowsInstallerData output, string cabinetDir, MediaTuple mediaTuple, CompressionLevel compressionLevel, IEnumerable fileFacades) + private CabinetWorkItem CreateCabinetWorkItem(WindowsInstallerData output, string cabinetDir, MediaSymbol mediaSymbol, CompressionLevel compressionLevel, IEnumerable fileFacades) { CabinetWorkItem cabinetWorkItem = null; - var tempCabinetFileX = Path.Combine(this.IntermediateFolder, mediaTuple.Cabinet); + var tempCabinetFileX = Path.Combine(this.IntermediateFolder, mediaSymbol.Cabinet); // check for an empty cabinet if (!fileFacades.Any()) { // Remove the leading '#' from the embedded cabinet name to make the warning easier to understand - var cabinetName = mediaTuple.Cabinet.TrimStart('#'); + var cabinetName = mediaSymbol.Cabinet.TrimStart('#'); // If building a patch, remind them to run -p for torch. if (OutputType.Patch == output.Type) { - this.Messaging.Write(WarningMessages.EmptyCabinet(mediaTuple.SourceLineNumbers, cabinetName, true)); + this.Messaging.Write(WarningMessages.EmptyCabinet(mediaSymbol.SourceLineNumbers, cabinetName, true)); } else { - this.Messaging.Write(WarningMessages.EmptyCabinet(mediaTuple.SourceLineNumbers, cabinetName)); + this.Messaging.Write(WarningMessages.EmptyCabinet(mediaSymbol.SourceLineNumbers, cabinetName)); } } @@ -213,7 +213,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } else // reuse the cabinet from the cabinet cache. { - this.Messaging.Write(VerboseMessages.ReusingCabCache(mediaTuple.SourceLineNumbers, mediaTuple.Cabinet, resolvedCabinet.Path)); + this.Messaging.Write(VerboseMessages.ReusingCabCache(mediaSymbol.SourceLineNumbers, mediaSymbol.Cabinet, resolvedCabinet.Path)); try { @@ -227,27 +227,27 @@ namespace WixToolset.Core.WindowsInstaller.Bind } catch (Exception e) { - this.Messaging.Write(WarningMessages.CannotUpdateCabCache(mediaTuple.SourceLineNumbers, resolvedCabinet.Path, e.Message)); + this.Messaging.Write(WarningMessages.CannotUpdateCabCache(mediaSymbol.SourceLineNumbers, resolvedCabinet.Path, e.Message)); } } - var trackResolvedCabinet = this.BackendHelper.TrackFile(resolvedCabinet.Path, TrackedFileType.Intermediate, mediaTuple.SourceLineNumbers); + var trackResolvedCabinet = this.BackendHelper.TrackFile(resolvedCabinet.Path, TrackedFileType.Intermediate, mediaSymbol.SourceLineNumbers); this.trackedFiles.Add(trackResolvedCabinet); - if (mediaTuple.Cabinet.StartsWith("#", StringComparison.Ordinal)) + if (mediaSymbol.Cabinet.StartsWith("#", StringComparison.Ordinal)) { var streamsTable = output.EnsureTable(this.TableDefinitions["_Streams"]); - var streamRow = streamsTable.CreateRow(mediaTuple.SourceLineNumbers); - streamRow[0] = mediaTuple.Cabinet.Substring(1); + var streamRow = streamsTable.CreateRow(mediaSymbol.SourceLineNumbers); + streamRow[0] = mediaSymbol.Cabinet.Substring(1); streamRow[1] = resolvedCabinet.Path; } else { - var trackDestination = this.BackendHelper.TrackFile(Path.Combine(cabinetDir, mediaTuple.Cabinet), TrackedFileType.Final, mediaTuple.SourceLineNumbers); + var trackDestination = this.BackendHelper.TrackFile(Path.Combine(cabinetDir, mediaSymbol.Cabinet), TrackedFileType.Final, mediaSymbol.SourceLineNumbers); this.trackedFiles.Add(trackDestination); - var transfer = this.BackendHelper.CreateFileTransfer(resolvedCabinet.Path, trackDestination.Path, resolvedCabinet.BuildOption == CabinetBuildOption.BuildAndMove, mediaTuple.SourceLineNumbers); + var transfer = this.BackendHelper.CreateFileTransfer(resolvedCabinet.Path, trackDestination.Path, resolvedCabinet.BuildOption == CabinetBuildOption.BuildAndMove, mediaSymbol.SourceLineNumbers); this.fileTransfers.Add(transfer); } @@ -372,7 +372,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } // The new Row has to be inserted just after the last cab in this cabinet split chain according to DiskID Sort - // This is because the FDI Extract requires DiskID of Split Cabinets to be continuous. It Fails otherwise with + // This is because the FDI Extract requires DiskID of Split Cabinets to be continuous. It Fails otherwise with // Error 2350 (FDI Server Error) as next DiskID did not have the right split cabinet during extraction MediaRow newMediaRow = (MediaRow)mediaTable.CreateRow(null); newMediaRow.Cabinet = newCabinetName; diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateDeltaPatchesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateDeltaPatchesCommand.cs index c54e9c53..93ac50ff 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateDeltaPatchesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateDeltaPatchesCommand.cs @@ -8,14 +8,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.IO; using WixToolset.Core.Bind; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; /// /// Creates delta patches and updates the appropriate rows to point to the newly generated patches. /// internal class CreateDeltaPatchesCommand { - public CreateDeltaPatchesCommand(List fileFacades, string intermediateFolder, WixPatchIdTuple wixPatchId) + public CreateDeltaPatchesCommand(List fileFacades, string intermediateFolder, WixPatchIdSymbol wixPatchId) { this.FileFacades = fileFacades; this.IntermediateFolder = intermediateFolder; @@ -24,7 +24,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind private IEnumerable FileFacades { get; } - private WixPatchIdTuple WixPatchId { get; } + private WixPatchIdSymbol WixPatchId { get; } private string IntermediateFolder { get; } @@ -73,7 +73,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } } } -#endif +#endif throw new NotImplementedException(); } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateInstanceTransformsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateInstanceTransformsCommand.cs index 772100ca..33afca77 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateInstanceTransformsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateInstanceTransformsCommand.cs @@ -7,7 +7,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Linq; using WixToolset.Core.WindowsInstaller.Msi; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; using WixToolset.Data.WindowsInstaller.Rows; using WixToolset.Extensibility.Services; @@ -33,9 +33,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind public void Execute() { // Create and add substorages for instance transforms. - var wixInstanceTransformsTuples = this.Section.Tuples.OfType(); + var wixInstanceTransformsSymbols = this.Section.Symbols.OfType(); - if (wixInstanceTransformsTuples.Any()) + if (wixInstanceTransformsSymbols.Any()) { string targetProductCode = null; string targetUpgradeCode = null; @@ -62,7 +62,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } // Index the Instance Component Rows, we'll get the Components rows from the real Component table. - var targetInstanceComponentTable = this.Section.Tuples.OfType(); + var targetInstanceComponentTable = this.Section.Symbols.OfType(); var instanceComponentGuids = targetInstanceComponentTable.ToDictionary(t => t.Id.Id, t => (ComponentRow)null); if (instanceComponentGuids.Any()) @@ -79,11 +79,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind } // Generate the instance transforms - foreach (var instanceTuple in wixInstanceTransformsTuples) + foreach (var instanceSymbol in wixInstanceTransformsSymbols) { - var instanceId = instanceTuple.Id.Id; + var instanceId = instanceSymbol.Id.Id; - var instanceTransform = new WindowsInstallerData(instanceTuple.SourceLineNumbers); + var instanceTransform = new WindowsInstallerData(instanceSymbol.SourceLineNumbers); instanceTransform.Type = OutputType.Transform; instanceTransform.Codepage = this.Output.Codepage; @@ -107,49 +107,49 @@ namespace WixToolset.Core.WindowsInstaller.Bind var propertyTable = instanceTransform.EnsureTable(this.TableDefinitions["Property"]); // Change the ProductCode property - var productCode = instanceTuple.ProductCode; + var productCode = instanceSymbol.ProductCode; if ("*" == productCode) { productCode = Common.GenerateGuid(); } - var productCodeRow = propertyTable.CreateRow(instanceTuple.SourceLineNumbers); + var productCodeRow = propertyTable.CreateRow(instanceSymbol.SourceLineNumbers); productCodeRow.Operation = RowOperation.Modify; productCodeRow.Fields[1].Modified = true; productCodeRow[0] = "ProductCode"; productCodeRow[1] = productCode; // Change the instance property - var instanceIdRow = propertyTable.CreateRow(instanceTuple.SourceLineNumbers); + var instanceIdRow = propertyTable.CreateRow(instanceSymbol.SourceLineNumbers); instanceIdRow.Operation = RowOperation.Modify; instanceIdRow.Fields[1].Modified = true; - instanceIdRow[0] = instanceTuple.PropertyId; + instanceIdRow[0] = instanceSymbol.PropertyId; instanceIdRow[1] = instanceId; - if (!String.IsNullOrEmpty(instanceTuple.ProductName)) + if (!String.IsNullOrEmpty(instanceSymbol.ProductName)) { // Change the ProductName property - var productNameRow = propertyTable.CreateRow(instanceTuple.SourceLineNumbers); + var productNameRow = propertyTable.CreateRow(instanceSymbol.SourceLineNumbers); productNameRow.Operation = RowOperation.Modify; productNameRow.Fields[1].Modified = true; productNameRow[0] = "ProductName"; - productNameRow[1] = instanceTuple.ProductName; + productNameRow[1] = instanceSymbol.ProductName; } - if (!String.IsNullOrEmpty(instanceTuple.UpgradeCode)) + if (!String.IsNullOrEmpty(instanceSymbol.UpgradeCode)) { // Change the UpgradeCode property - var upgradeCodeRow = propertyTable.CreateRow(instanceTuple.SourceLineNumbers); + var upgradeCodeRow = propertyTable.CreateRow(instanceSymbol.SourceLineNumbers); upgradeCodeRow.Operation = RowOperation.Modify; upgradeCodeRow.Fields[1].Modified = true; upgradeCodeRow[0] = "UpgradeCode"; - upgradeCodeRow[1] = instanceTuple.UpgradeCode; + upgradeCodeRow[1] = instanceSymbol.UpgradeCode; // Change the Upgrade table var targetUpgradeTable = this.Output.Tables["Upgrade"]; if (null != targetUpgradeTable && 0 <= targetUpgradeTable.Rows.Count) { - var upgradeId = instanceTuple.UpgradeCode; + var upgradeId = instanceSymbol.UpgradeCode; var upgradeTable = instanceTransform.EnsureTable(this.TableDefinitions["Upgrade"]); foreach (var row in targetUpgradeTable.Rows) { @@ -235,19 +235,19 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (!summaryRows.ContainsKey((int)SummaryInformation.Transform.UpdatedPlatformAndLanguage)) { - var summaryRow = instanceSummaryInformationTable.CreateRow(instanceTuple.SourceLineNumbers); + var summaryRow = instanceSummaryInformationTable.CreateRow(instanceSymbol.SourceLineNumbers); summaryRow[0] = (int)SummaryInformation.Transform.UpdatedPlatformAndLanguage; summaryRow[1] = targetPlatformAndLanguage; } else if (!summaryRows.ContainsKey((int)SummaryInformation.Transform.ValidationFlags)) { - var summaryRow = instanceSummaryInformationTable.CreateRow(instanceTuple.SourceLineNumbers); + var summaryRow = instanceSummaryInformationTable.CreateRow(instanceSymbol.SourceLineNumbers); summaryRow[0] = (int)SummaryInformation.Transform.ValidationFlags; summaryRow[1] = "0"; } else if (!summaryRows.ContainsKey((int)SummaryInformation.Transform.Security)) { - var summaryRow = instanceSummaryInformationTable.CreateRow(instanceTuple.SourceLineNumbers); + var summaryRow = instanceSummaryInformationTable.CreateRow(instanceSymbol.SourceLineNumbers); summaryRow[0] = (int)SummaryInformation.Transform.Security; summaryRow[1] = "4"; } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs index 90d1c148..052b30e3 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs @@ -7,7 +7,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Globalization; using System.Linq; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; using WixToolset.Data.WindowsInstaller.Rows; using WixToolset.Extensibility; @@ -38,7 +38,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind public void Execute() { - this.Output = new WindowsInstallerData(this.Section.Tuples.First().SourceLineNumbers) + this.Output = new WindowsInstallerData(this.Section.Symbols.First().SourceLineNumbers) { Codepage = this.Section.Codepage, Type = SectionTypeToOutputType(this.Section.Type) @@ -49,388 +49,388 @@ namespace WixToolset.Core.WindowsInstaller.Bind private void AddSectionToOutput() { - var cellsByTableAndRowId = new Dictionary>(); + var cellsByTableAndRowId = new Dictionary>(); - foreach (var tuple in this.Section.Tuples) + foreach (var symbol in this.Section.Symbols) { - var unknownTuple = false; - switch (tuple.Definition.Type) + var unknownSymbol = false; + switch (symbol.Definition.Type) { - case TupleDefinitionType.AppSearch: - this.AddTupleDefaultly(tuple); + case SymbolDefinitionType.AppSearch: + this.AddSymbolDefaultly(symbol); this.Output.EnsureTable(this.TableDefinitions["Signature"]); break; - case TupleDefinitionType.Assembly: - this.AddAssemblyTuple((AssemblyTuple)tuple); + case SymbolDefinitionType.Assembly: + this.AddAssemblySymbol((AssemblySymbol)symbol); break; - case TupleDefinitionType.BBControl: - this.AddBBControlTuple((BBControlTuple)tuple); + case SymbolDefinitionType.BBControl: + this.AddBBControlSymbol((BBControlSymbol)symbol); break; - case TupleDefinitionType.Class: - this.AddClassTuple((ClassTuple)tuple); + case SymbolDefinitionType.Class: + this.AddClassSymbol((ClassSymbol)symbol); break; - case TupleDefinitionType.Control: - this.AddControlTuple((ControlTuple)tuple); + case SymbolDefinitionType.Control: + this.AddControlSymbol((ControlSymbol)symbol); break; - case TupleDefinitionType.Component: - this.AddComponentTuple((ComponentTuple)tuple); + case SymbolDefinitionType.Component: + this.AddComponentSymbol((ComponentSymbol)symbol); break; - case TupleDefinitionType.CustomAction: - this.AddCustomActionTuple((CustomActionTuple)tuple); + case SymbolDefinitionType.CustomAction: + this.AddCustomActionSymbol((CustomActionSymbol)symbol); break; - case TupleDefinitionType.Dialog: - this.AddDialogTuple((DialogTuple)tuple); + case SymbolDefinitionType.Dialog: + this.AddDialogSymbol((DialogSymbol)symbol); break; - case TupleDefinitionType.Directory: - this.AddDirectoryTuple((DirectoryTuple)tuple); + case SymbolDefinitionType.Directory: + this.AddDirectorySymbol((DirectorySymbol)symbol); break; - case TupleDefinitionType.Environment: - this.AddEnvironmentTuple((EnvironmentTuple)tuple); + case SymbolDefinitionType.Environment: + this.AddEnvironmentSymbol((EnvironmentSymbol)symbol); break; - case TupleDefinitionType.Error: - this.AddErrorTuple((ErrorTuple)tuple); + case SymbolDefinitionType.Error: + this.AddErrorSymbol((ErrorSymbol)symbol); break; - case TupleDefinitionType.Feature: - this.AddFeatureTuple((FeatureTuple)tuple); + case SymbolDefinitionType.Feature: + this.AddFeatureSymbol((FeatureSymbol)symbol); break; - case TupleDefinitionType.File: - this.AddFileTuple((FileTuple)tuple); + case SymbolDefinitionType.File: + this.AddFileSymbol((FileSymbol)symbol); break; - case TupleDefinitionType.IniFile: - this.AddIniFileTuple((IniFileTuple)tuple); + case SymbolDefinitionType.IniFile: + this.AddIniFileSymbol((IniFileSymbol)symbol); break; - case TupleDefinitionType.Media: - this.AddMediaTuple((MediaTuple)tuple); + case SymbolDefinitionType.Media: + this.AddMediaSymbol((MediaSymbol)symbol); break; - case TupleDefinitionType.ModuleConfiguration: - this.AddModuleConfigurationTuple((ModuleConfigurationTuple)tuple); + case SymbolDefinitionType.ModuleConfiguration: + this.AddModuleConfigurationSymbol((ModuleConfigurationSymbol)symbol); break; - case TupleDefinitionType.MsiEmbeddedUI: - this.AddMsiEmbeddedUITuple((MsiEmbeddedUITuple)tuple); + case SymbolDefinitionType.MsiEmbeddedUI: + this.AddMsiEmbeddedUISymbol((MsiEmbeddedUISymbol)symbol); break; - case TupleDefinitionType.MsiServiceConfig: - this.AddMsiServiceConfigTuple((MsiServiceConfigTuple)tuple); + case SymbolDefinitionType.MsiServiceConfig: + this.AddMsiServiceConfigSymbol((MsiServiceConfigSymbol)symbol); break; - case TupleDefinitionType.MsiServiceConfigFailureActions: - this.AddMsiServiceConfigFailureActionsTuple((MsiServiceConfigFailureActionsTuple)tuple); + case SymbolDefinitionType.MsiServiceConfigFailureActions: + this.AddMsiServiceConfigFailureActionsSymbol((MsiServiceConfigFailureActionsSymbol)symbol); break; - case TupleDefinitionType.MoveFile: - this.AddMoveFileTuple((MoveFileTuple)tuple); + case SymbolDefinitionType.MoveFile: + this.AddMoveFileSymbol((MoveFileSymbol)symbol); break; - case TupleDefinitionType.ProgId: - this.AddTupleDefaultly(tuple); + case SymbolDefinitionType.ProgId: + this.AddSymbolDefaultly(symbol); this.Output.EnsureTable(this.TableDefinitions["Extension"]); break; - case TupleDefinitionType.Property: - this.AddPropertyTuple((PropertyTuple)tuple); + case SymbolDefinitionType.Property: + this.AddPropertySymbol((PropertySymbol)symbol); break; - case TupleDefinitionType.RemoveFile: - this.AddRemoveFileTuple((RemoveFileTuple)tuple); + case SymbolDefinitionType.RemoveFile: + this.AddRemoveFileSymbol((RemoveFileSymbol)symbol); break; - case TupleDefinitionType.Registry: - this.AddRegistryTuple((RegistryTuple)tuple); + case SymbolDefinitionType.Registry: + this.AddRegistrySymbol((RegistrySymbol)symbol); break; - case TupleDefinitionType.RegLocator: - this.AddRegLocatorTuple((RegLocatorTuple)tuple); + case SymbolDefinitionType.RegLocator: + this.AddRegLocatorSymbol((RegLocatorSymbol)symbol); break; - case TupleDefinitionType.RemoveRegistry: - this.AddRemoveRegistryTuple((RemoveRegistryTuple)tuple); + case SymbolDefinitionType.RemoveRegistry: + this.AddRemoveRegistrySymbol((RemoveRegistrySymbol)symbol); break; - case TupleDefinitionType.ServiceControl: - this.AddServiceControlTuple((ServiceControlTuple)tuple); + case SymbolDefinitionType.ServiceControl: + this.AddServiceControlSymbol((ServiceControlSymbol)symbol); break; - case TupleDefinitionType.ServiceInstall: - this.AddServiceInstallTuple((ServiceInstallTuple)tuple); + case SymbolDefinitionType.ServiceInstall: + this.AddServiceInstallSymbol((ServiceInstallSymbol)symbol); break; - case TupleDefinitionType.Shortcut: - this.AddShortcutTuple((ShortcutTuple)tuple); + case SymbolDefinitionType.Shortcut: + this.AddShortcutSymbol((ShortcutSymbol)symbol); break; - case TupleDefinitionType.TextStyle: - this.AddTextStyleTuple((TextStyleTuple)tuple); + case SymbolDefinitionType.TextStyle: + this.AddTextStyleSymbol((TextStyleSymbol)symbol); break; - case TupleDefinitionType.Upgrade: - this.AddUpgradeTuple((UpgradeTuple)tuple); + case SymbolDefinitionType.Upgrade: + this.AddUpgradeSymbol((UpgradeSymbol)symbol); break; - case TupleDefinitionType.WixAction: - this.AddWixActionTuple((WixActionTuple)tuple); + case SymbolDefinitionType.WixAction: + this.AddWixActionSymbol((WixActionSymbol)symbol); break; - case TupleDefinitionType.WixCustomTableCell: - this.IndexCustomTableCellTuple((WixCustomTableCellTuple)tuple, cellsByTableAndRowId); + case SymbolDefinitionType.WixCustomTableCell: + this.IndexCustomTableCellSymbol((WixCustomTableCellSymbol)symbol, cellsByTableAndRowId); break; - case TupleDefinitionType.WixEnsureTable: - this.AddWixEnsureTableTuple((WixEnsureTableTuple)tuple); + case SymbolDefinitionType.WixEnsureTable: + this.AddWixEnsureTableSymbol((WixEnsureTableSymbol)symbol); break; - // Tuples used internally and are not added to the output. - case TupleDefinitionType.WixBuildInfo: - case TupleDefinitionType.WixBindUpdatedFiles: - case TupleDefinitionType.WixComponentGroup: - case TupleDefinitionType.WixComplexReference: - case TupleDefinitionType.WixDeltaPatchFile: - case TupleDefinitionType.WixDeltaPatchSymbolPaths: - case TupleDefinitionType.WixFragment: - case TupleDefinitionType.WixFeatureGroup: - case TupleDefinitionType.WixInstanceComponent: - case TupleDefinitionType.WixInstanceTransforms: - case TupleDefinitionType.WixFeatureModules: - case TupleDefinitionType.WixGroup: - case TupleDefinitionType.WixMediaTemplate: - case TupleDefinitionType.WixMerge: - case TupleDefinitionType.WixOrdering: - case TupleDefinitionType.WixPatchBaseline: - case TupleDefinitionType.WixPatchFamilyGroup: - case TupleDefinitionType.WixPatchId: - case TupleDefinitionType.WixPatchRef: - case TupleDefinitionType.WixPatchTarget: - case TupleDefinitionType.WixProperty: - case TupleDefinitionType.WixSimpleReference: - case TupleDefinitionType.WixSuppressAction: - case TupleDefinitionType.WixSuppressModularization: - case TupleDefinitionType.WixUI: - case TupleDefinitionType.WixVariable: + // Symbols used internally and are not added to the output. + case SymbolDefinitionType.WixBuildInfo: + case SymbolDefinitionType.WixBindUpdatedFiles: + case SymbolDefinitionType.WixComponentGroup: + case SymbolDefinitionType.WixComplexReference: + case SymbolDefinitionType.WixDeltaPatchFile: + case SymbolDefinitionType.WixDeltaPatchSymbolPaths: + case SymbolDefinitionType.WixFragment: + case SymbolDefinitionType.WixFeatureGroup: + case SymbolDefinitionType.WixInstanceComponent: + case SymbolDefinitionType.WixInstanceTransforms: + case SymbolDefinitionType.WixFeatureModules: + case SymbolDefinitionType.WixGroup: + case SymbolDefinitionType.WixMediaTemplate: + case SymbolDefinitionType.WixMerge: + case SymbolDefinitionType.WixOrdering: + case SymbolDefinitionType.WixPatchBaseline: + case SymbolDefinitionType.WixPatchFamilyGroup: + case SymbolDefinitionType.WixPatchId: + case SymbolDefinitionType.WixPatchRef: + case SymbolDefinitionType.WixPatchTarget: + case SymbolDefinitionType.WixProperty: + case SymbolDefinitionType.WixSimpleReference: + case SymbolDefinitionType.WixSuppressAction: + case SymbolDefinitionType.WixSuppressModularization: + case SymbolDefinitionType.WixUI: + case SymbolDefinitionType.WixVariable: break; // Already processed by LoadTableDefinitions. - case TupleDefinitionType.WixCustomTable: - case TupleDefinitionType.WixCustomTableColumn: + case SymbolDefinitionType.WixCustomTable: + case SymbolDefinitionType.WixCustomTableColumn: break; - case TupleDefinitionType.MustBeFromAnExtension: - unknownTuple = !this.AddTupleFromExtension(tuple); + case SymbolDefinitionType.MustBeFromAnExtension: + unknownSymbol = !this.AddSymbolFromExtension(symbol); break; default: - unknownTuple = !this.AddTupleDefaultly(tuple); + unknownSymbol = !this.AddSymbolDefaultly(symbol); break; } - if (unknownTuple) + if (unknownSymbol) { - this.Messaging.Write(WarningMessages.TupleNotTranslatedToOutput(tuple)); + this.Messaging.Write(WarningMessages.SymbolNotTranslatedToOutput(symbol)); } } - this.AddIndexedCellTuples(cellsByTableAndRowId); + this.AddIndexedCellSymbols(cellsByTableAndRowId); } - private void AddAssemblyTuple(AssemblyTuple tuple) + private void AddAssemblySymbol(AssemblySymbol symbol) { - var attributes = tuple.Type == AssemblyType.Win32Assembly ? 1 : (int?)null; + var attributes = symbol.Type == AssemblyType.Win32Assembly ? 1 : (int?)null; - var row = this.CreateRow(tuple, "MsiAssembly"); - row[0] = tuple.ComponentRef; - row[1] = tuple.FeatureRef; - row[2] = tuple.ManifestFileRef; - row[3] = tuple.ApplicationFileRef; + var row = this.CreateRow(symbol, "MsiAssembly"); + row[0] = symbol.ComponentRef; + row[1] = symbol.FeatureRef; + row[2] = symbol.ManifestFileRef; + row[3] = symbol.ApplicationFileRef; row[4] = attributes; } - private void AddBBControlTuple(BBControlTuple tuple) + private void AddBBControlSymbol(BBControlSymbol symbol) { - var attributes = tuple.Attributes; - attributes |= tuple.Enabled ? WindowsInstallerConstants.MsidbControlAttributesEnabled : 0; - attributes |= tuple.Indirect ? WindowsInstallerConstants.MsidbControlAttributesIndirect : 0; - attributes |= tuple.Integer ? WindowsInstallerConstants.MsidbControlAttributesInteger : 0; - attributes |= tuple.LeftScroll ? WindowsInstallerConstants.MsidbControlAttributesLeftScroll : 0; - attributes |= tuple.RightAligned ? WindowsInstallerConstants.MsidbControlAttributesRightAligned : 0; - attributes |= tuple.RightToLeft ? WindowsInstallerConstants.MsidbControlAttributesRTLRO : 0; - attributes |= tuple.Sunken ? WindowsInstallerConstants.MsidbControlAttributesSunken : 0; - attributes |= tuple.Visible ? WindowsInstallerConstants.MsidbControlAttributesVisible : 0; - - var row = this.CreateRow(tuple, "BBControl"); - row[0] = tuple.BillboardRef; - row[1] = tuple.BBControl; - row[2] = tuple.Type; - row[3] = tuple.X; - row[4] = tuple.Y; - row[5] = tuple.Width; - row[6] = tuple.Height; + var attributes = symbol.Attributes; + attributes |= symbol.Enabled ? WindowsInstallerConstants.MsidbControlAttributesEnabled : 0; + attributes |= symbol.Indirect ? WindowsInstallerConstants.MsidbControlAttributesIndirect : 0; + attributes |= symbol.Integer ? WindowsInstallerConstants.MsidbControlAttributesInteger : 0; + attributes |= symbol.LeftScroll ? WindowsInstallerConstants.MsidbControlAttributesLeftScroll : 0; + attributes |= symbol.RightAligned ? WindowsInstallerConstants.MsidbControlAttributesRightAligned : 0; + attributes |= symbol.RightToLeft ? WindowsInstallerConstants.MsidbControlAttributesRTLRO : 0; + attributes |= symbol.Sunken ? WindowsInstallerConstants.MsidbControlAttributesSunken : 0; + attributes |= symbol.Visible ? WindowsInstallerConstants.MsidbControlAttributesVisible : 0; + + var row = this.CreateRow(symbol, "BBControl"); + row[0] = symbol.BillboardRef; + row[1] = symbol.BBControl; + row[2] = symbol.Type; + row[3] = symbol.X; + row[4] = symbol.Y; + row[5] = symbol.Width; + row[6] = symbol.Height; row[7] = attributes; - row[8] = tuple.Text; + row[8] = symbol.Text; } - private void AddClassTuple(ClassTuple tuple) + private void AddClassSymbol(ClassSymbol symbol) { - var row = this.CreateRow(tuple, "Class"); - row[0] = tuple.CLSID; - row[1] = tuple.Context; - row[2] = tuple.ComponentRef; - row[3] = tuple.DefaultProgIdRef; - row[4] = tuple.Description; - row[5] = tuple.AppIdRef; - row[6] = tuple.FileTypeMask; - row[7] = tuple.IconRef; - row[8] = tuple.IconIndex; - row[9] = tuple.DefInprocHandler; - row[10] = tuple.Argument; - row[11] = tuple.FeatureRef; - row[12] = tuple.RelativePath ? (int?)1 : null; + var row = this.CreateRow(symbol, "Class"); + row[0] = symbol.CLSID; + row[1] = symbol.Context; + row[2] = symbol.ComponentRef; + row[3] = symbol.DefaultProgIdRef; + row[4] = symbol.Description; + row[5] = symbol.AppIdRef; + row[6] = symbol.FileTypeMask; + row[7] = symbol.IconRef; + row[8] = symbol.IconIndex; + row[9] = symbol.DefInprocHandler; + row[10] = symbol.Argument; + row[11] = symbol.FeatureRef; + row[12] = symbol.RelativePath ? (int?)1 : null; } - private void AddControlTuple(ControlTuple tuple) + private void AddControlSymbol(ControlSymbol symbol) { - var text = tuple.Text; - var attributes = tuple.Attributes; - attributes |= tuple.Enabled ? WindowsInstallerConstants.MsidbControlAttributesEnabled : 0; - attributes |= tuple.Indirect ? WindowsInstallerConstants.MsidbControlAttributesIndirect : 0; - attributes |= tuple.Integer ? WindowsInstallerConstants.MsidbControlAttributesInteger : 0; - attributes |= tuple.LeftScroll ? WindowsInstallerConstants.MsidbControlAttributesLeftScroll : 0; - attributes |= tuple.RightAligned ? WindowsInstallerConstants.MsidbControlAttributesRightAligned : 0; - attributes |= tuple.RightToLeft ? WindowsInstallerConstants.MsidbControlAttributesRTLRO : 0; - attributes |= tuple.Sunken ? WindowsInstallerConstants.MsidbControlAttributesSunken : 0; - attributes |= tuple.Visible ? WindowsInstallerConstants.MsidbControlAttributesVisible : 0; + var text = symbol.Text; + var attributes = symbol.Attributes; + attributes |= symbol.Enabled ? WindowsInstallerConstants.MsidbControlAttributesEnabled : 0; + attributes |= symbol.Indirect ? WindowsInstallerConstants.MsidbControlAttributesIndirect : 0; + attributes |= symbol.Integer ? WindowsInstallerConstants.MsidbControlAttributesInteger : 0; + attributes |= symbol.LeftScroll ? WindowsInstallerConstants.MsidbControlAttributesLeftScroll : 0; + attributes |= symbol.RightAligned ? WindowsInstallerConstants.MsidbControlAttributesRightAligned : 0; + attributes |= symbol.RightToLeft ? WindowsInstallerConstants.MsidbControlAttributesRTLRO : 0; + attributes |= symbol.Sunken ? WindowsInstallerConstants.MsidbControlAttributesSunken : 0; + attributes |= symbol.Visible ? WindowsInstallerConstants.MsidbControlAttributesVisible : 0; // If we're tracking disk space, and this is a non-FormatSize Text control, // and the text attribute starts with '[' and ends with ']', add a space. // It is not necessary for the whole string to be a property, just those // two characters matter. - if (tuple.TrackDiskSpace && - "Text" == tuple.Type && + if (symbol.TrackDiskSpace && + "Text" == symbol.Type && WindowsInstallerConstants.MsidbControlAttributesFormatSize != (attributes & WindowsInstallerConstants.MsidbControlAttributesFormatSize) && null != text && text.StartsWith("[", StringComparison.Ordinal) && text.EndsWith("]", StringComparison.Ordinal)) { text = String.Concat(text, " "); } - var row = this.CreateRow(tuple, "Control"); - row[0] = tuple.DialogRef; - row[1] = tuple.Control; - row[2] = tuple.Type; - row[3] = tuple.X; - row[4] = tuple.Y; - row[5] = tuple.Width; - row[6] = tuple.Height; + var row = this.CreateRow(symbol, "Control"); + row[0] = symbol.DialogRef; + row[1] = symbol.Control; + row[2] = symbol.Type; + row[3] = symbol.X; + row[4] = symbol.Y; + row[5] = symbol.Width; + row[6] = symbol.Height; row[7] = attributes; row[8] = text; - row[9] = tuple.NextControlRef; - row[10] = tuple.Help; + row[9] = symbol.NextControlRef; + row[10] = symbol.Help; } - private void AddComponentTuple(ComponentTuple tuple) + private void AddComponentSymbol(ComponentSymbol symbol) { - var attributes = ComponentLocation.Either == tuple.Location ? WindowsInstallerConstants.MsidbComponentAttributesOptional : 0; - attributes |= ComponentLocation.SourceOnly == tuple.Location ? WindowsInstallerConstants.MsidbComponentAttributesSourceOnly : 0; - attributes |= ComponentKeyPathType.Registry == tuple.KeyPathType ? WindowsInstallerConstants.MsidbComponentAttributesRegistryKeyPath : 0; - attributes |= ComponentKeyPathType.OdbcDataSource == tuple.KeyPathType ? WindowsInstallerConstants.MsidbComponentAttributesODBCDataSource : 0; - attributes |= tuple.DisableRegistryReflection ? WindowsInstallerConstants.MsidbComponentAttributesDisableRegistryReflection : 0; - attributes |= tuple.NeverOverwrite ? WindowsInstallerConstants.MsidbComponentAttributesNeverOverwrite : 0; - attributes |= tuple.Permanent ? WindowsInstallerConstants.MsidbComponentAttributesPermanent : 0; - attributes |= tuple.SharedDllRefCount ? WindowsInstallerConstants.MsidbComponentAttributesSharedDllRefCount : 0; - attributes |= tuple.Shared ? WindowsInstallerConstants.MsidbComponentAttributesShared : 0; - attributes |= tuple.Transitive ? WindowsInstallerConstants.MsidbComponentAttributesTransitive : 0; - attributes |= tuple.UninstallWhenSuperseded ? WindowsInstallerConstants.MsidbComponentAttributesUninstallOnSupersedence : 0; - attributes |= tuple.Win64 ? WindowsInstallerConstants.MsidbComponentAttributes64bit : 0; - - var row = this.CreateRow(tuple, "Component"); - row[0] = tuple.Id.Id; - row[1] = tuple.ComponentId; - row[2] = tuple.DirectoryRef; + var attributes = ComponentLocation.Either == symbol.Location ? WindowsInstallerConstants.MsidbComponentAttributesOptional : 0; + attributes |= ComponentLocation.SourceOnly == symbol.Location ? WindowsInstallerConstants.MsidbComponentAttributesSourceOnly : 0; + attributes |= ComponentKeyPathType.Registry == symbol.KeyPathType ? WindowsInstallerConstants.MsidbComponentAttributesRegistryKeyPath : 0; + attributes |= ComponentKeyPathType.OdbcDataSource == symbol.KeyPathType ? WindowsInstallerConstants.MsidbComponentAttributesODBCDataSource : 0; + attributes |= symbol.DisableRegistryReflection ? WindowsInstallerConstants.MsidbComponentAttributesDisableRegistryReflection : 0; + attributes |= symbol.NeverOverwrite ? WindowsInstallerConstants.MsidbComponentAttributesNeverOverwrite : 0; + attributes |= symbol.Permanent ? WindowsInstallerConstants.MsidbComponentAttributesPermanent : 0; + attributes |= symbol.SharedDllRefCount ? WindowsInstallerConstants.MsidbComponentAttributesSharedDllRefCount : 0; + attributes |= symbol.Shared ? WindowsInstallerConstants.MsidbComponentAttributesShared : 0; + attributes |= symbol.Transitive ? WindowsInstallerConstants.MsidbComponentAttributesTransitive : 0; + attributes |= symbol.UninstallWhenSuperseded ? WindowsInstallerConstants.MsidbComponentAttributesUninstallOnSupersedence : 0; + attributes |= symbol.Win64 ? WindowsInstallerConstants.MsidbComponentAttributes64bit : 0; + + var row = this.CreateRow(symbol, "Component"); + row[0] = symbol.Id.Id; + row[1] = symbol.ComponentId; + row[2] = symbol.DirectoryRef; row[3] = attributes; - row[4] = tuple.Condition; - row[5] = tuple.KeyPath; + row[4] = symbol.Condition; + row[5] = symbol.KeyPath; } - private void AddCustomActionTuple(CustomActionTuple tuple) + private void AddCustomActionSymbol(CustomActionSymbol symbol) { - var type = tuple.Win64 ? WindowsInstallerConstants.MsidbCustomActionType64BitScript : 0; - type |= tuple.IgnoreResult ? WindowsInstallerConstants.MsidbCustomActionTypeContinue : 0; - type |= tuple.Hidden ? WindowsInstallerConstants.MsidbCustomActionTypeHideTarget : 0; - type |= tuple.Async ? WindowsInstallerConstants.MsidbCustomActionTypeAsync : 0; - type |= CustomActionExecutionType.FirstSequence == tuple.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeFirstSequence : 0; - type |= CustomActionExecutionType.OncePerProcess == tuple.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeOncePerProcess : 0; - type |= CustomActionExecutionType.ClientRepeat == tuple.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeClientRepeat : 0; - type |= CustomActionExecutionType.Deferred == tuple.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeInScript : 0; - type |= CustomActionExecutionType.Rollback == tuple.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeInScript | WindowsInstallerConstants.MsidbCustomActionTypeRollback : 0; - type |= CustomActionExecutionType.Commit == tuple.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeInScript | WindowsInstallerConstants.MsidbCustomActionTypeCommit : 0; - type |= CustomActionSourceType.File == tuple.SourceType ? WindowsInstallerConstants.MsidbCustomActionTypeSourceFile : 0; - type |= CustomActionSourceType.Directory == tuple.SourceType ? WindowsInstallerConstants.MsidbCustomActionTypeDirectory : 0; - type |= CustomActionSourceType.Property == tuple.SourceType ? WindowsInstallerConstants.MsidbCustomActionTypeProperty : 0; - type |= CustomActionTargetType.Dll == tuple.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeDll : 0; - type |= CustomActionTargetType.Exe == tuple.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeExe : 0; - type |= CustomActionTargetType.TextData == tuple.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeTextData : 0; - type |= CustomActionTargetType.JScript == tuple.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeJScript : 0; - type |= CustomActionTargetType.VBScript == tuple.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeVBScript : 0; + var type = symbol.Win64 ? WindowsInstallerConstants.MsidbCustomActionType64BitScript : 0; + type |= symbol.IgnoreResult ? WindowsInstallerConstants.MsidbCustomActionTypeContinue : 0; + type |= symbol.Hidden ? WindowsInstallerConstants.MsidbCustomActionTypeHideTarget : 0; + type |= symbol.Async ? WindowsInstallerConstants.MsidbCustomActionTypeAsync : 0; + type |= CustomActionExecutionType.FirstSequence == symbol.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeFirstSequence : 0; + type |= CustomActionExecutionType.OncePerProcess == symbol.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeOncePerProcess : 0; + type |= CustomActionExecutionType.ClientRepeat == symbol.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeClientRepeat : 0; + type |= CustomActionExecutionType.Deferred == symbol.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeInScript : 0; + type |= CustomActionExecutionType.Rollback == symbol.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeInScript | WindowsInstallerConstants.MsidbCustomActionTypeRollback : 0; + type |= CustomActionExecutionType.Commit == symbol.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeInScript | WindowsInstallerConstants.MsidbCustomActionTypeCommit : 0; + type |= CustomActionSourceType.File == symbol.SourceType ? WindowsInstallerConstants.MsidbCustomActionTypeSourceFile : 0; + type |= CustomActionSourceType.Directory == symbol.SourceType ? WindowsInstallerConstants.MsidbCustomActionTypeDirectory : 0; + type |= CustomActionSourceType.Property == symbol.SourceType ? WindowsInstallerConstants.MsidbCustomActionTypeProperty : 0; + type |= CustomActionTargetType.Dll == symbol.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeDll : 0; + type |= CustomActionTargetType.Exe == symbol.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeExe : 0; + type |= CustomActionTargetType.TextData == symbol.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeTextData : 0; + type |= CustomActionTargetType.JScript == symbol.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeJScript : 0; + type |= CustomActionTargetType.VBScript == symbol.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeVBScript : 0; if (WindowsInstallerConstants.MsidbCustomActionTypeInScript == (type & WindowsInstallerConstants.MsidbCustomActionTypeInScript)) { - type |= tuple.Impersonate ? 0 : WindowsInstallerConstants.MsidbCustomActionTypeNoImpersonate; - type |= tuple.TSAware ? WindowsInstallerConstants.MsidbCustomActionTypeTSAware : 0; + type |= symbol.Impersonate ? 0 : WindowsInstallerConstants.MsidbCustomActionTypeNoImpersonate; + type |= symbol.TSAware ? WindowsInstallerConstants.MsidbCustomActionTypeTSAware : 0; } - var row = this.CreateRow(tuple, "CustomAction"); - row[0] = tuple.Id.Id; + var row = this.CreateRow(symbol, "CustomAction"); + row[0] = symbol.Id.Id; row[1] = type; - row[2] = tuple.Source; - row[3] = tuple.Target; - row[4] = tuple.PatchUninstall ? (int?)WindowsInstallerConstants.MsidbCustomActionTypePatchUninstall : null; + row[2] = symbol.Source; + row[3] = symbol.Target; + row[4] = symbol.PatchUninstall ? (int?)WindowsInstallerConstants.MsidbCustomActionTypePatchUninstall : null; } - private void AddDialogTuple(DialogTuple tuple) + private void AddDialogSymbol(DialogSymbol symbol) { - var attributes = tuple.Visible ? WindowsInstallerConstants.MsidbDialogAttributesVisible : 0; - attributes |= tuple.Modal ? WindowsInstallerConstants.MsidbDialogAttributesModal : 0; - attributes |= tuple.Minimize ? WindowsInstallerConstants.MsidbDialogAttributesMinimize : 0; - attributes |= tuple.CustomPalette ? WindowsInstallerConstants.MsidbDialogAttributesUseCustomPalette : 0; - attributes |= tuple.ErrorDialog ? WindowsInstallerConstants.MsidbDialogAttributesError : 0; - attributes |= tuple.LeftScroll ? WindowsInstallerConstants.MsidbDialogAttributesLeftScroll : 0; - attributes |= tuple.KeepModeless ? WindowsInstallerConstants.MsidbDialogAttributesKeepModeless : 0; - attributes |= tuple.RightAligned ? WindowsInstallerConstants.MsidbDialogAttributesRightAligned : 0; - attributes |= tuple.RightToLeft ? WindowsInstallerConstants.MsidbDialogAttributesRTLRO : 0; - attributes |= tuple.SystemModal ? WindowsInstallerConstants.MsidbDialogAttributesSysModal : 0; - attributes |= tuple.TrackDiskSpace ? WindowsInstallerConstants.MsidbDialogAttributesTrackDiskSpace : 0; - - var row = this.CreateRow(tuple, "Dialog"); - row[0] = tuple.Id.Id; - row[1] = tuple.HCentering; - row[2] = tuple.VCentering; - row[3] = tuple.Width; - row[4] = tuple.Height; + var attributes = symbol.Visible ? WindowsInstallerConstants.MsidbDialogAttributesVisible : 0; + attributes |= symbol.Modal ? WindowsInstallerConstants.MsidbDialogAttributesModal : 0; + attributes |= symbol.Minimize ? WindowsInstallerConstants.MsidbDialogAttributesMinimize : 0; + attributes |= symbol.CustomPalette ? WindowsInstallerConstants.MsidbDialogAttributesUseCustomPalette : 0; + attributes |= symbol.ErrorDialog ? WindowsInstallerConstants.MsidbDialogAttributesError : 0; + attributes |= symbol.LeftScroll ? WindowsInstallerConstants.MsidbDialogAttributesLeftScroll : 0; + attributes |= symbol.KeepModeless ? WindowsInstallerConstants.MsidbDialogAttributesKeepModeless : 0; + attributes |= symbol.RightAligned ? WindowsInstallerConstants.MsidbDialogAttributesRightAligned : 0; + attributes |= symbol.RightToLeft ? WindowsInstallerConstants.MsidbDialogAttributesRTLRO : 0; + attributes |= symbol.SystemModal ? WindowsInstallerConstants.MsidbDialogAttributesSysModal : 0; + attributes |= symbol.TrackDiskSpace ? WindowsInstallerConstants.MsidbDialogAttributesTrackDiskSpace : 0; + + var row = this.CreateRow(symbol, "Dialog"); + row[0] = symbol.Id.Id; + row[1] = symbol.HCentering; + row[2] = symbol.VCentering; + row[3] = symbol.Width; + row[4] = symbol.Height; row[5] = attributes; - row[6] = tuple.Title; - row[7] = tuple.FirstControlRef; - row[8] = tuple.DefaultControlRef; - row[9] = tuple.CancelControlRef; + row[6] = symbol.Title; + row[7] = symbol.FirstControlRef; + row[8] = symbol.DefaultControlRef; + row[9] = symbol.CancelControlRef; this.Output.EnsureTable(this.TableDefinitions["ListBox"]); } - private void AddDirectoryTuple(DirectoryTuple tuple) + private void AddDirectorySymbol(DirectorySymbol symbol) { - var sourceName = GetMsiFilenameValue(tuple.SourceShortName, tuple.SourceName); - var targetName = GetMsiFilenameValue(tuple.ShortName, tuple.Name); + var sourceName = GetMsiFilenameValue(symbol.SourceShortName, symbol.SourceName); + var targetName = GetMsiFilenameValue(symbol.ShortName, symbol.Name); if (String.IsNullOrEmpty(targetName)) { @@ -439,20 +439,20 @@ namespace WixToolset.Core.WindowsInstaller.Bind var defaultDir = String.IsNullOrEmpty(sourceName) ? targetName : targetName + ":" + sourceName; - var row = this.CreateRow(tuple, "Directory"); - row[0] = tuple.Id.Id; - row[1] = tuple.ParentDirectoryRef; + var row = this.CreateRow(symbol, "Directory"); + row[0] = symbol.Id.Id; + row[1] = symbol.ParentDirectoryRef; row[2] = defaultDir; } - private void AddEnvironmentTuple(EnvironmentTuple tuple) + private void AddEnvironmentSymbol(EnvironmentSymbol symbol) { var action = String.Empty; - var system = tuple.System ? "*" : String.Empty; - var uninstall = tuple.Permanent ? String.Empty : "-"; - var value = tuple.Value; + var system = symbol.System ? "*" : String.Empty; + var uninstall = symbol.Permanent ? String.Empty : "-"; + var value = symbol.Value; - switch (tuple.Action) + switch (symbol.Action) { case EnvironmentActionType.Create: action = "+"; @@ -465,219 +465,219 @@ namespace WixToolset.Core.WindowsInstaller.Bind break; } - switch (tuple.Part) + switch (symbol.Part) { case EnvironmentPartType.First: - value = String.Concat(value, tuple.Separator, "[~]"); + value = String.Concat(value, symbol.Separator, "[~]"); break; case EnvironmentPartType.Last: - value = String.Concat("[~]", tuple.Separator, value); + value = String.Concat("[~]", symbol.Separator, value); break; } - var row = this.CreateRow(tuple, "Environment"); - row[0] = tuple.Id.Id; - row[1] = String.Concat(action, uninstall, system, tuple.Name); + var row = this.CreateRow(symbol, "Environment"); + row[0] = symbol.Id.Id; + row[1] = String.Concat(action, uninstall, system, symbol.Name); row[2] = value; - row[3] = tuple.ComponentRef; + row[3] = symbol.ComponentRef; } - private void AddErrorTuple(ErrorTuple tuple) + private void AddErrorSymbol(ErrorSymbol symbol) { - var row = this.CreateRow(tuple, "Error"); - row[0] = Convert.ToInt32(tuple.Id.Id); - row[1] = tuple.Message; + var row = this.CreateRow(symbol, "Error"); + row[0] = Convert.ToInt32(symbol.Id.Id); + row[1] = symbol.Message; } - private void AddFeatureTuple(FeatureTuple tuple) + private void AddFeatureSymbol(FeatureSymbol symbol) { - var attributes = tuple.DisallowAbsent ? WindowsInstallerConstants.MsidbFeatureAttributesUIDisallowAbsent : 0; - attributes |= tuple.DisallowAdvertise ? WindowsInstallerConstants.MsidbFeatureAttributesDisallowAdvertise : 0; - attributes |= FeatureInstallDefault.FollowParent == tuple.InstallDefault ? WindowsInstallerConstants.MsidbFeatureAttributesFollowParent : 0; - attributes |= FeatureInstallDefault.Source == tuple.InstallDefault ? WindowsInstallerConstants.MsidbFeatureAttributesFavorSource : 0; - attributes |= FeatureTypicalDefault.Advertise == tuple.TypicalDefault ? WindowsInstallerConstants.MsidbFeatureAttributesFavorAdvertise : 0; - - var row = this.CreateRow(tuple, "Feature"); - row[0] = tuple.Id.Id; - row[1] = tuple.ParentFeatureRef; - row[2] = tuple.Title; - row[3] = tuple.Description; - row[4] = tuple.Display; - row[5] = tuple.Level; - row[6] = tuple.DirectoryRef; + var attributes = symbol.DisallowAbsent ? WindowsInstallerConstants.MsidbFeatureAttributesUIDisallowAbsent : 0; + attributes |= symbol.DisallowAdvertise ? WindowsInstallerConstants.MsidbFeatureAttributesDisallowAdvertise : 0; + attributes |= FeatureInstallDefault.FollowParent == symbol.InstallDefault ? WindowsInstallerConstants.MsidbFeatureAttributesFollowParent : 0; + attributes |= FeatureInstallDefault.Source == symbol.InstallDefault ? WindowsInstallerConstants.MsidbFeatureAttributesFavorSource : 0; + attributes |= FeatureTypicalDefault.Advertise == symbol.TypicalDefault ? WindowsInstallerConstants.MsidbFeatureAttributesFavorAdvertise : 0; + + var row = this.CreateRow(symbol, "Feature"); + row[0] = symbol.Id.Id; + row[1] = symbol.ParentFeatureRef; + row[2] = symbol.Title; + row[3] = symbol.Description; + row[4] = symbol.Display; + row[5] = symbol.Level; + row[6] = symbol.DirectoryRef; row[7] = attributes; } - private void AddFileTuple(FileTuple tuple) + private void AddFileSymbol(FileSymbol symbol) { - var row = (FileRow)this.CreateRow(tuple, "File"); - row.File = tuple.Id.Id; - row.Component = tuple.ComponentRef; - row.FileName = GetMsiFilenameValue(tuple.ShortName, tuple.Name); - row.FileSize = tuple.FileSize; - row.Version = tuple.Version; - row.Language = tuple.Language; - row.DiskId = tuple.DiskId ?? 1; // TODO: is 1 the correct thing to default here - row.Sequence = tuple.Sequence; - row.Source = tuple.Source.Path; - - var attributes = (tuple.Attributes & FileTupleAttributes.Checksum) == FileTupleAttributes.Checksum ? WindowsInstallerConstants.MsidbFileAttributesChecksum : 0; - attributes |= (tuple.Attributes & FileTupleAttributes.Compressed) == FileTupleAttributes.Compressed ? WindowsInstallerConstants.MsidbFileAttributesCompressed : 0; - attributes |= (tuple.Attributes & FileTupleAttributes.Uncompressed) == FileTupleAttributes.Uncompressed ? WindowsInstallerConstants.MsidbFileAttributesNoncompressed : 0; - attributes |= (tuple.Attributes & FileTupleAttributes.Hidden) == FileTupleAttributes.Hidden ? WindowsInstallerConstants.MsidbFileAttributesHidden : 0; - attributes |= (tuple.Attributes & FileTupleAttributes.ReadOnly) == FileTupleAttributes.ReadOnly ? WindowsInstallerConstants.MsidbFileAttributesReadOnly : 0; - attributes |= (tuple.Attributes & FileTupleAttributes.System) == FileTupleAttributes.System ? WindowsInstallerConstants.MsidbFileAttributesSystem : 0; - attributes |= (tuple.Attributes & FileTupleAttributes.Vital) == FileTupleAttributes.Vital ? WindowsInstallerConstants.MsidbFileAttributesVital : 0; + var row = (FileRow)this.CreateRow(symbol, "File"); + row.File = symbol.Id.Id; + row.Component = symbol.ComponentRef; + row.FileName = GetMsiFilenameValue(symbol.ShortName, symbol.Name); + row.FileSize = symbol.FileSize; + row.Version = symbol.Version; + row.Language = symbol.Language; + row.DiskId = symbol.DiskId ?? 1; // TODO: is 1 the correct thing to default here + row.Sequence = symbol.Sequence; + row.Source = symbol.Source.Path; + + var attributes = (symbol.Attributes & FileSymbolAttributes.Checksum) == FileSymbolAttributes.Checksum ? WindowsInstallerConstants.MsidbFileAttributesChecksum : 0; + attributes |= (symbol.Attributes & FileSymbolAttributes.Compressed) == FileSymbolAttributes.Compressed ? WindowsInstallerConstants.MsidbFileAttributesCompressed : 0; + attributes |= (symbol.Attributes & FileSymbolAttributes.Uncompressed) == FileSymbolAttributes.Uncompressed ? WindowsInstallerConstants.MsidbFileAttributesNoncompressed : 0; + attributes |= (symbol.Attributes & FileSymbolAttributes.Hidden) == FileSymbolAttributes.Hidden ? WindowsInstallerConstants.MsidbFileAttributesHidden : 0; + attributes |= (symbol.Attributes & FileSymbolAttributes.ReadOnly) == FileSymbolAttributes.ReadOnly ? WindowsInstallerConstants.MsidbFileAttributesReadOnly : 0; + attributes |= (symbol.Attributes & FileSymbolAttributes.System) == FileSymbolAttributes.System ? WindowsInstallerConstants.MsidbFileAttributesSystem : 0; + attributes |= (symbol.Attributes & FileSymbolAttributes.Vital) == FileSymbolAttributes.Vital ? WindowsInstallerConstants.MsidbFileAttributesVital : 0; row.Attributes = attributes; - if (tuple.FontTitle != null) + if (symbol.FontTitle != null) { - var fontRow = this.CreateRow(tuple, "Font"); - fontRow[0] = tuple.Id.Id; - fontRow[1] = tuple.FontTitle; + var fontRow = this.CreateRow(symbol, "Font"); + fontRow[0] = symbol.Id.Id; + fontRow[1] = symbol.FontTitle; } - if (tuple.SelfRegCost.HasValue) + if (symbol.SelfRegCost.HasValue) { - var selfRegRow = this.CreateRow(tuple, "SelfReg"); - selfRegRow[0] = tuple.Id.Id; - selfRegRow[1] = tuple.SelfRegCost.Value; + var selfRegRow = this.CreateRow(symbol, "SelfReg"); + selfRegRow[0] = symbol.Id.Id; + selfRegRow[1] = symbol.SelfRegCost.Value; } } - private void AddIniFileTuple(IniFileTuple tuple) + private void AddIniFileSymbol(IniFileSymbol symbol) { - var tableName = (InifFileActionType.AddLine == tuple.Action || InifFileActionType.AddTag == tuple.Action || InifFileActionType.CreateLine == tuple.Action) ? "IniFile" : "RemoveIniFile"; - - var row = this.CreateRow(tuple, tableName); - row[0] = tuple.Id.Id; - row[1] = tuple.FileName; - row[2] = tuple.DirProperty; - row[3] = tuple.Section; - row[4] = tuple.Key; - row[5] = tuple.Value; - row[6] = tuple.Action; - row[7] = tuple.ComponentRef; + var tableName = (InifFileActionType.AddLine == symbol.Action || InifFileActionType.AddTag == symbol.Action || InifFileActionType.CreateLine == symbol.Action) ? "IniFile" : "RemoveIniFile"; + + var row = this.CreateRow(symbol, tableName); + row[0] = symbol.Id.Id; + row[1] = symbol.FileName; + row[2] = symbol.DirProperty; + row[3] = symbol.Section; + row[4] = symbol.Key; + row[5] = symbol.Value; + row[6] = symbol.Action; + row[7] = symbol.ComponentRef; } - private void AddMediaTuple(MediaTuple tuple) + private void AddMediaSymbol(MediaSymbol symbol) { if (this.Section.Type != SectionType.Module) { - var row = (MediaRow)this.CreateRow(tuple, "Media"); - row.DiskId = tuple.DiskId; - row.LastSequence = tuple.LastSequence ?? 0; - row.DiskPrompt = tuple.DiskPrompt; - row.Cabinet = tuple.Cabinet; - row.VolumeLabel = tuple.VolumeLabel; - row.Source = tuple.Source; + var row = (MediaRow)this.CreateRow(symbol, "Media"); + row.DiskId = symbol.DiskId; + row.LastSequence = symbol.LastSequence ?? 0; + row.DiskPrompt = symbol.DiskPrompt; + row.Cabinet = symbol.Cabinet; + row.VolumeLabel = symbol.VolumeLabel; + row.Source = symbol.Source; } } - private void AddModuleConfigurationTuple(ModuleConfigurationTuple tuple) + private void AddModuleConfigurationSymbol(ModuleConfigurationSymbol symbol) { - var row = this.CreateRow(tuple, "ModuleConfiguration"); - row[0] = tuple.Id.Id; - row[1] = tuple.Format; - row[2] = tuple.Type; - row[3] = tuple.ContextData; - row[4] = tuple.DefaultValue; - row[5] = (tuple.KeyNoOrphan ? WindowsInstallerConstants.MsidbMsmConfigurableOptionKeyNoOrphan : 0) | - (tuple.NonNullable ? WindowsInstallerConstants.MsidbMsmConfigurableOptionNonNullable : 0); - row[6] = tuple.DisplayName; - row[7] = tuple.Description; - row[8] = tuple.HelpLocation; - row[9] = tuple.HelpKeyword; + var row = this.CreateRow(symbol, "ModuleConfiguration"); + row[0] = symbol.Id.Id; + row[1] = symbol.Format; + row[2] = symbol.Type; + row[3] = symbol.ContextData; + row[4] = symbol.DefaultValue; + row[5] = (symbol.KeyNoOrphan ? WindowsInstallerConstants.MsidbMsmConfigurableOptionKeyNoOrphan : 0) | + (symbol.NonNullable ? WindowsInstallerConstants.MsidbMsmConfigurableOptionNonNullable : 0); + row[6] = symbol.DisplayName; + row[7] = symbol.Description; + row[8] = symbol.HelpLocation; + row[9] = symbol.HelpKeyword; } - private void AddMsiEmbeddedUITuple(MsiEmbeddedUITuple tuple) + private void AddMsiEmbeddedUISymbol(MsiEmbeddedUISymbol symbol) { - var attributes = tuple.EntryPoint ? WindowsInstallerConstants.MsidbEmbeddedUI : 0; - attributes |= tuple.SupportsBasicUI ? WindowsInstallerConstants.MsidbEmbeddedHandlesBasic : 0; + var attributes = symbol.EntryPoint ? WindowsInstallerConstants.MsidbEmbeddedUI : 0; + attributes |= symbol.SupportsBasicUI ? WindowsInstallerConstants.MsidbEmbeddedHandlesBasic : 0; - var row = this.CreateRow(tuple, "MsiEmbeddedUI"); - row[0] = tuple.Id.Id; - row[1] = tuple.FileName; + var row = this.CreateRow(symbol, "MsiEmbeddedUI"); + row[0] = symbol.Id.Id; + row[1] = symbol.FileName; row[2] = attributes; - row[3] = tuple.MessageFilter; - row[4] = tuple.Source; + row[3] = symbol.MessageFilter; + row[4] = symbol.Source; } - private void AddMsiServiceConfigTuple(MsiServiceConfigTuple tuple) + private void AddMsiServiceConfigSymbol(MsiServiceConfigSymbol symbol) { - var events = tuple.OnInstall ? WindowsInstallerConstants.MsidbServiceConfigEventInstall : 0; - events |= tuple.OnReinstall ? WindowsInstallerConstants.MsidbServiceConfigEventReinstall : 0; - events |= tuple.OnUninstall ? WindowsInstallerConstants.MsidbServiceConfigEventUninstall : 0; + var events = symbol.OnInstall ? WindowsInstallerConstants.MsidbServiceConfigEventInstall : 0; + events |= symbol.OnReinstall ? WindowsInstallerConstants.MsidbServiceConfigEventReinstall : 0; + events |= symbol.OnUninstall ? WindowsInstallerConstants.MsidbServiceConfigEventUninstall : 0; - var row = this.CreateRow(tuple, "MsiServiceConfigFailureActions"); - row[0] = tuple.Id.Id; - row[1] = tuple.Name; + var row = this.CreateRow(symbol, "MsiServiceConfigFailureActions"); + row[0] = symbol.Id.Id; + row[1] = symbol.Name; row[2] = events; - row[3] = tuple.ConfigType; - row[4] = tuple.Argument; - row[5] = tuple.ComponentRef; + row[3] = symbol.ConfigType; + row[4] = symbol.Argument; + row[5] = symbol.ComponentRef; } - private void AddMsiServiceConfigFailureActionsTuple(MsiServiceConfigFailureActionsTuple tuple) + private void AddMsiServiceConfigFailureActionsSymbol(MsiServiceConfigFailureActionsSymbol symbol) { - var events = tuple.OnInstall ? WindowsInstallerConstants.MsidbServiceConfigEventInstall : 0; - events |= tuple.OnReinstall ? WindowsInstallerConstants.MsidbServiceConfigEventReinstall : 0; - events |= tuple.OnUninstall ? WindowsInstallerConstants.MsidbServiceConfigEventUninstall : 0; + var events = symbol.OnInstall ? WindowsInstallerConstants.MsidbServiceConfigEventInstall : 0; + events |= symbol.OnReinstall ? WindowsInstallerConstants.MsidbServiceConfigEventReinstall : 0; + events |= symbol.OnUninstall ? WindowsInstallerConstants.MsidbServiceConfigEventUninstall : 0; - var row = this.CreateRow(tuple, "MsiServiceConfig"); - row[0] = tuple.Id.Id; - row[1] = tuple.Name; + var row = this.CreateRow(symbol, "MsiServiceConfig"); + row[0] = symbol.Id.Id; + row[1] = symbol.Name; row[2] = events; - row[3] = tuple.ResetPeriod.HasValue ? tuple.ResetPeriod : null; - row[4] = tuple.RebootMessage ?? "[~]"; - row[5] = tuple.Command ?? "[~]"; - row[6] = tuple.Actions; - row[7] = tuple.DelayActions; - row[8] = tuple.ComponentRef; + row[3] = symbol.ResetPeriod.HasValue ? symbol.ResetPeriod : null; + row[4] = symbol.RebootMessage ?? "[~]"; + row[5] = symbol.Command ?? "[~]"; + row[6] = symbol.Actions; + row[7] = symbol.DelayActions; + row[8] = symbol.ComponentRef; } - private void AddMoveFileTuple(MoveFileTuple tuple) + private void AddMoveFileSymbol(MoveFileSymbol symbol) { - var row = this.CreateRow(tuple, "MoveFile"); - row[0] = tuple.Id.Id; - row[1] = tuple.ComponentRef; - row[2] = tuple.SourceName; - row[3] = tuple.DestName; - row[4] = tuple.SourceFolder; - row[5] = tuple.DestFolder; - row[6] = tuple.Delete ? WindowsInstallerConstants.MsidbMoveFileOptionsMove : 0; + var row = this.CreateRow(symbol, "MoveFile"); + row[0] = symbol.Id.Id; + row[1] = symbol.ComponentRef; + row[2] = symbol.SourceName; + row[3] = symbol.DestName; + row[4] = symbol.SourceFolder; + row[5] = symbol.DestFolder; + row[6] = symbol.Delete ? WindowsInstallerConstants.MsidbMoveFileOptionsMove : 0; } - private void AddPropertyTuple(PropertyTuple tuple) + private void AddPropertySymbol(PropertySymbol symbol) { - if (String.IsNullOrEmpty(tuple.Value)) + if (String.IsNullOrEmpty(symbol.Value)) { return; } - var row = (PropertyRow)this.CreateRow(tuple, "Property"); - row.Property = tuple.Id.Id; - row.Value = tuple.Value; + var row = (PropertyRow)this.CreateRow(symbol, "Property"); + row.Property = symbol.Id.Id; + row.Value = symbol.Value; } - private void AddRemoveFileTuple(RemoveFileTuple tuple) + private void AddRemoveFileSymbol(RemoveFileSymbol symbol) { - var installMode = tuple.OnInstall == true ? WindowsInstallerConstants.MsidbRemoveFileInstallModeOnInstall : 0; - installMode |= tuple.OnUninstall == true ? WindowsInstallerConstants.MsidbRemoveFileInstallModeOnRemove : 0; - - var row = this.CreateRow(tuple, "RemoveFile"); - row[0] = tuple.Id.Id; - row[1] = tuple.ComponentRef; - row[2] = tuple.FileName; - row[3] = tuple.DirProperty; + var installMode = symbol.OnInstall == true ? WindowsInstallerConstants.MsidbRemoveFileInstallModeOnInstall : 0; + installMode |= symbol.OnUninstall == true ? WindowsInstallerConstants.MsidbRemoveFileInstallModeOnRemove : 0; + + var row = this.CreateRow(symbol, "RemoveFile"); + row[0] = symbol.Id.Id; + row[1] = symbol.ComponentRef; + row[2] = symbol.FileName; + row[3] = symbol.DirProperty; row[4] = installMode; } - private void AddRegistryTuple(RegistryTuple tuple) + private void AddRegistrySymbol(RegistrySymbol symbol) { - var value = tuple.Value; + var value = symbol.Value; - switch (tuple.ValueType) + switch (symbol.ValueType) { case RegistryValueType.Binary: value = String.Concat("#x", value); @@ -689,7 +689,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind value = String.Concat("#", value); break; case RegistryValueType.MultiString: - switch (tuple.ValueAction) + switch (symbol.ValueAction) { case RegistryValueActionType.Append: value = String.Concat("[~]", value); @@ -715,164 +715,164 @@ namespace WixToolset.Core.WindowsInstaller.Bind break; } - var row = this.CreateRow(tuple, "Registry"); - row[0] = tuple.Id.Id; - row[1] = tuple.Root; - row[2] = tuple.Key; - row[3] = tuple.Name; + var row = this.CreateRow(symbol, "Registry"); + row[0] = symbol.Id.Id; + row[1] = symbol.Root; + row[2] = symbol.Key; + row[3] = symbol.Name; row[4] = value; - row[5] = tuple.ComponentRef; + row[5] = symbol.ComponentRef; } - private void AddRegLocatorTuple(RegLocatorTuple tuple) + private void AddRegLocatorSymbol(RegLocatorSymbol symbol) { - var type = (int)tuple.Type; - type |= tuple.Win64 ? WindowsInstallerConstants.MsidbLocatorType64bit : 0; - - var row = this.CreateRow(tuple, "RegLocator"); - row[0] = tuple.Id.Id; - row[1] = tuple.Root; - row[2] = tuple.Key; - row[3] = tuple.Name; + var type = (int)symbol.Type; + type |= symbol.Win64 ? WindowsInstallerConstants.MsidbLocatorType64bit : 0; + + var row = this.CreateRow(symbol, "RegLocator"); + row[0] = symbol.Id.Id; + row[1] = symbol.Root; + row[2] = symbol.Key; + row[3] = symbol.Name; row[4] = type; } - private void AddRemoveRegistryTuple(RemoveRegistryTuple tuple) + private void AddRemoveRegistrySymbol(RemoveRegistrySymbol symbol) { - if (tuple.Action == RemoveRegistryActionType.RemoveOnInstall) + if (symbol.Action == RemoveRegistryActionType.RemoveOnInstall) { - var row = this.CreateRow(tuple, "RemoveRegistry"); - row[0] = tuple.Id.Id; - row[1] = tuple.Root; - row[2] = tuple.Key; - row[3] = tuple.Name; - row[4] = tuple.ComponentRef; + var row = this.CreateRow(symbol, "RemoveRegistry"); + row[0] = symbol.Id.Id; + row[1] = symbol.Root; + row[2] = symbol.Key; + row[3] = symbol.Name; + row[4] = symbol.ComponentRef; } else // Registry table is used to remove registry keys on uninstall. { - var row = this.CreateRow(tuple, "Registry"); - row[0] = tuple.Id.Id; - row[1] = tuple.Root; - row[2] = tuple.Key; - row[3] = tuple.Name; - row[5] = tuple.ComponentRef; + var row = this.CreateRow(symbol, "Registry"); + row[0] = symbol.Id.Id; + row[1] = symbol.Root; + row[2] = symbol.Key; + row[3] = symbol.Name; + row[5] = symbol.ComponentRef; } } - private void AddServiceControlTuple(ServiceControlTuple tuple) + private void AddServiceControlSymbol(ServiceControlSymbol symbol) { - var events = tuple.InstallRemove ? WindowsInstallerConstants.MsidbServiceControlEventDelete : 0; - events |= tuple.UninstallRemove ? WindowsInstallerConstants.MsidbServiceControlEventUninstallDelete : 0; - events |= tuple.InstallStart ? WindowsInstallerConstants.MsidbServiceControlEventStart : 0; - events |= tuple.UninstallStart ? WindowsInstallerConstants.MsidbServiceControlEventUninstallStart : 0; - events |= tuple.InstallStop ? WindowsInstallerConstants.MsidbServiceControlEventStop : 0; - events |= tuple.UninstallStop ? WindowsInstallerConstants.MsidbServiceControlEventUninstallStop : 0; - - var row = this.CreateRow(tuple, "ServiceControl"); - row[0] = tuple.Id.Id; - row[1] = tuple.Name; + var events = symbol.InstallRemove ? WindowsInstallerConstants.MsidbServiceControlEventDelete : 0; + events |= symbol.UninstallRemove ? WindowsInstallerConstants.MsidbServiceControlEventUninstallDelete : 0; + events |= symbol.InstallStart ? WindowsInstallerConstants.MsidbServiceControlEventStart : 0; + events |= symbol.UninstallStart ? WindowsInstallerConstants.MsidbServiceControlEventUninstallStart : 0; + events |= symbol.InstallStop ? WindowsInstallerConstants.MsidbServiceControlEventStop : 0; + events |= symbol.UninstallStop ? WindowsInstallerConstants.MsidbServiceControlEventUninstallStop : 0; + + var row = this.CreateRow(symbol, "ServiceControl"); + row[0] = symbol.Id.Id; + row[1] = symbol.Name; row[2] = events; - row[3] = tuple.Arguments; - if (tuple.Wait.HasValue) + row[3] = symbol.Arguments; + if (symbol.Wait.HasValue) { - row[4] = tuple.Wait.Value ? 1 : 0; + row[4] = symbol.Wait.Value ? 1 : 0; } - row[5] = tuple.ComponentRef; + row[5] = symbol.ComponentRef; } - private void AddServiceInstallTuple(ServiceInstallTuple tuple) + private void AddServiceInstallSymbol(ServiceInstallSymbol symbol) { - var errorControl = (int)tuple.ErrorControl; - errorControl |= tuple.Vital ? WindowsInstallerConstants.MsidbServiceInstallErrorControlVital : 0; + var errorControl = (int)symbol.ErrorControl; + errorControl |= symbol.Vital ? WindowsInstallerConstants.MsidbServiceInstallErrorControlVital : 0; - var serviceType = (int)tuple.ServiceType; - serviceType |= tuple.Interactive ? WindowsInstallerConstants.MsidbServiceInstallInteractive : 0; + var serviceType = (int)symbol.ServiceType; + serviceType |= symbol.Interactive ? WindowsInstallerConstants.MsidbServiceInstallInteractive : 0; - var row = this.CreateRow(tuple, "ServiceInstall"); - row[0] = tuple.Id.Id; - row[1] = tuple.Name; - row[2] = tuple.DisplayName; + var row = this.CreateRow(symbol, "ServiceInstall"); + row[0] = symbol.Id.Id; + row[1] = symbol.Name; + row[2] = symbol.DisplayName; row[3] = serviceType; - row[4] = (int)tuple.StartType; + row[4] = (int)symbol.StartType; row[5] = errorControl; - row[6] = tuple.LoadOrderGroup; - row[7] = tuple.Dependencies; - row[8] = tuple.StartName; - row[9] = tuple.Password; - row[10] = tuple.Arguments; - row[11] = tuple.ComponentRef; - row[12] = tuple.Description; + row[6] = symbol.LoadOrderGroup; + row[7] = symbol.Dependencies; + row[8] = symbol.StartName; + row[9] = symbol.Password; + row[10] = symbol.Arguments; + row[11] = symbol.ComponentRef; + row[12] = symbol.Description; } - private void AddShortcutTuple(ShortcutTuple tuple) + private void AddShortcutSymbol(ShortcutSymbol symbol) { - var row = this.CreateRow(tuple, "Shortcut"); - row[0] = tuple.Id.Id; - row[1] = tuple.DirectoryRef; - row[2] = GetMsiFilenameValue(tuple.ShortName, tuple.Name); - row[3] = tuple.ComponentRef; - row[4] = tuple.Target; - row[5] = tuple.Arguments; - row[6] = tuple.Description; - row[7] = tuple.Hotkey; - row[8] = tuple.IconRef; - row[9] = tuple.IconIndex; - row[10] = (int?)tuple.Show; - row[11] = tuple.WorkingDirectory; - row[12] = tuple.DisplayResourceDll; - row[13] = tuple.DisplayResourceId; - row[14] = tuple.DescriptionResourceDll; - row[15] = tuple.DescriptionResourceId; + var row = this.CreateRow(symbol, "Shortcut"); + row[0] = symbol.Id.Id; + row[1] = symbol.DirectoryRef; + row[2] = GetMsiFilenameValue(symbol.ShortName, symbol.Name); + row[3] = symbol.ComponentRef; + row[4] = symbol.Target; + row[5] = symbol.Arguments; + row[6] = symbol.Description; + row[7] = symbol.Hotkey; + row[8] = symbol.IconRef; + row[9] = symbol.IconIndex; + row[10] = (int?)symbol.Show; + row[11] = symbol.WorkingDirectory; + row[12] = symbol.DisplayResourceDll; + row[13] = symbol.DisplayResourceId; + row[14] = symbol.DescriptionResourceDll; + row[15] = symbol.DescriptionResourceId; } - private void AddTextStyleTuple(TextStyleTuple tuple) + private void AddTextStyleSymbol(TextStyleSymbol symbol) { - var styleBits = tuple.Bold ? WindowsInstallerConstants.MsidbTextStyleStyleBitsBold : 0; - styleBits |= tuple.Italic ? WindowsInstallerConstants.MsidbTextStyleStyleBitsItalic : 0; - styleBits |= tuple.Strike ? WindowsInstallerConstants.MsidbTextStyleStyleBitsStrike : 0; - styleBits |= tuple.Underline ? WindowsInstallerConstants.MsidbTextStyleStyleBitsUnderline : 0; + var styleBits = symbol.Bold ? WindowsInstallerConstants.MsidbTextStyleStyleBitsBold : 0; + styleBits |= symbol.Italic ? WindowsInstallerConstants.MsidbTextStyleStyleBitsItalic : 0; + styleBits |= symbol.Strike ? WindowsInstallerConstants.MsidbTextStyleStyleBitsStrike : 0; + styleBits |= symbol.Underline ? WindowsInstallerConstants.MsidbTextStyleStyleBitsUnderline : 0; long? color = null; - if (tuple.Red.HasValue || tuple.Green.HasValue || tuple.Blue.HasValue) + if (symbol.Red.HasValue || symbol.Green.HasValue || symbol.Blue.HasValue) { - color = tuple.Red ?? 0; - color += (long)(tuple.Green ?? 0) * 256; - color += (long)(tuple.Blue ?? 0) * 65536; + color = symbol.Red ?? 0; + color += (long)(symbol.Green ?? 0) * 256; + color += (long)(symbol.Blue ?? 0) * 65536; } - var row = this.CreateRow(tuple, "TextStyle"); - row[0] = tuple.Id.Id; - row[1] = tuple.FaceName; - row[2] = tuple.Size; + var row = this.CreateRow(symbol, "TextStyle"); + row[0] = symbol.Id.Id; + row[1] = symbol.FaceName; + row[2] = symbol.Size; row[3] = color; row[4] = styleBits == 0 ? null : (int?)styleBits; } - private void AddUpgradeTuple(UpgradeTuple tuple) + private void AddUpgradeSymbol(UpgradeSymbol symbol) { - var row = (UpgradeRow)this.CreateRow(tuple, "Upgrade"); - row.UpgradeCode = tuple.UpgradeCode; - row.VersionMin = tuple.VersionMin; - row.VersionMax = tuple.VersionMax; - row.Language = tuple.Language; - row.Remove = tuple.Remove; - row.ActionProperty = tuple.ActionProperty; - - var attributes = tuple.MigrateFeatures ? WindowsInstallerConstants.MsidbUpgradeAttributesMigrateFeatures : 0; - attributes |= tuple.OnlyDetect ? WindowsInstallerConstants.MsidbUpgradeAttributesOnlyDetect : 0; - attributes |= tuple.IgnoreRemoveFailures ? WindowsInstallerConstants.MsidbUpgradeAttributesIgnoreRemoveFailure : 0; - attributes |= tuple.VersionMinInclusive ? WindowsInstallerConstants.MsidbUpgradeAttributesVersionMinInclusive : 0; - attributes |= tuple.VersionMaxInclusive ? WindowsInstallerConstants.MsidbUpgradeAttributesVersionMaxInclusive : 0; - attributes |= tuple.ExcludeLanguages ? WindowsInstallerConstants.MsidbUpgradeAttributesLanguagesExclusive : 0; + var row = (UpgradeRow)this.CreateRow(symbol, "Upgrade"); + row.UpgradeCode = symbol.UpgradeCode; + row.VersionMin = symbol.VersionMin; + row.VersionMax = symbol.VersionMax; + row.Language = symbol.Language; + row.Remove = symbol.Remove; + row.ActionProperty = symbol.ActionProperty; + + var attributes = symbol.MigrateFeatures ? WindowsInstallerConstants.MsidbUpgradeAttributesMigrateFeatures : 0; + attributes |= symbol.OnlyDetect ? WindowsInstallerConstants.MsidbUpgradeAttributesOnlyDetect : 0; + attributes |= symbol.IgnoreRemoveFailures ? WindowsInstallerConstants.MsidbUpgradeAttributesIgnoreRemoveFailure : 0; + attributes |= symbol.VersionMinInclusive ? WindowsInstallerConstants.MsidbUpgradeAttributesVersionMinInclusive : 0; + attributes |= symbol.VersionMaxInclusive ? WindowsInstallerConstants.MsidbUpgradeAttributesVersionMaxInclusive : 0; + attributes |= symbol.ExcludeLanguages ? WindowsInstallerConstants.MsidbUpgradeAttributesLanguagesExclusive : 0; row.Attributes = attributes; } - private void AddWixActionTuple(WixActionTuple tuple) + private void AddWixActionSymbol(WixActionSymbol symbol) { // Get the table definition for the action (and ensure the proper table exists for a module). string sequenceTableName = null; - switch (tuple.SequenceTable) + switch (symbol.SequenceTable) { case SequenceTable.AdminExecuteSequence: if (OutputType.Module == this.Output.Type) @@ -932,60 +932,60 @@ namespace WixToolset.Core.WindowsInstaller.Bind } // create the action sequence row in the output - var row = this.CreateRow(tuple, sequenceTableName); + var row = this.CreateRow(symbol, sequenceTableName); if (SectionType.Module == this.Section.Type) { - row[0] = tuple.Action; - if (0 != tuple.Sequence) + row[0] = symbol.Action; + if (0 != symbol.Sequence) { - row[1] = tuple.Sequence; + row[1] = symbol.Sequence; } else { - var after = (null == tuple.Before); - row[2] = after ? tuple.After : tuple.Before; + var after = (null == symbol.Before); + row[2] = after ? symbol.After : symbol.Before; row[3] = after ? 1 : 0; } - row[4] = tuple.Condition; + row[4] = symbol.Condition; } else { - row[0] = tuple.Action; - row[1] = tuple.Condition; - row[2] = tuple.Sequence; + row[0] = symbol.Action; + row[1] = symbol.Condition; + row[2] = symbol.Sequence; } } - private void IndexCustomTableCellTuple(WixCustomTableCellTuple wixCustomTableCellTuple, Dictionary> cellsByTableAndRowId) + private void IndexCustomTableCellSymbol(WixCustomTableCellSymbol wixCustomTableCellSymbol, Dictionary> cellsByTableAndRowId) { - var tableAndRowId = wixCustomTableCellTuple.TableRef + "/" + wixCustomTableCellTuple.RowId; + var tableAndRowId = wixCustomTableCellSymbol.TableRef + "/" + wixCustomTableCellSymbol.RowId; if (!cellsByTableAndRowId.TryGetValue(tableAndRowId, out var cells)) { - cells = new List(); + cells = new List(); cellsByTableAndRowId.Add(tableAndRowId, cells); } - cells.Add(wixCustomTableCellTuple); + cells.Add(wixCustomTableCellSymbol); } - private void AddIndexedCellTuples(Dictionary> cellsByTableAndRowId) + private void AddIndexedCellSymbols(Dictionary> cellsByTableAndRowId) { foreach (var rowOfCells in cellsByTableAndRowId.Values) { - var firstCellTuple = rowOfCells[0]; - var customTableDefinition = this.TableDefinitions[firstCellTuple.TableRef]; + var firstCellSymbol = rowOfCells[0]; + var customTableDefinition = this.TableDefinitions[firstCellSymbol.TableRef]; if (customTableDefinition.Unreal) { continue; } - var customRow = this.CreateRow(firstCellTuple, customTableDefinition); + var customRow = this.CreateRow(firstCellSymbol, customTableDefinition); var customRowFieldsByColumnName = customRow.Fields.ToDictionary(f => f.Column.Name); #if TODO // SectionId seems like a good thing to preserve. - customRow.SectionId = tuple.SectionId; + customRow.SectionId = symbol.SectionId; #endif foreach (var cell in rowOfCells) { @@ -1037,23 +1037,23 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (!customTableDefinition.Columns[i].Nullable && (null == customRow.Fields[i].Data || 0 == customRow.Fields[i].Data.ToString().Length)) { - this.Messaging.Write(ErrorMessages.NoDataForColumn(firstCellTuple.SourceLineNumbers, customTableDefinition.Columns[i].Name, customTableDefinition.Name)); + this.Messaging.Write(ErrorMessages.NoDataForColumn(firstCellSymbol.SourceLineNumbers, customTableDefinition.Columns[i].Name, customTableDefinition.Name)); } } } } - private void AddWixEnsureTableTuple(WixEnsureTableTuple tuple) + private void AddWixEnsureTableSymbol(WixEnsureTableSymbol symbol) { - var tableDefinition = this.TableDefinitions[tuple.Table]; + var tableDefinition = this.TableDefinitions[symbol.Table]; this.Output.EnsureTable(tableDefinition); } - private bool AddTupleFromExtension(IntermediateTuple tuple) + private bool AddSymbolFromExtension(IntermediateSymbol symbol) { foreach (var extension in this.BackendExtensions) { - if (extension.TryAddTupleToOutput(this.Section, tuple, this.Output, this.TableDefinitions)) + if (extension.TryAddSymbolToOutput(this.Section, symbol, this.Output, this.TableDefinitions)) { return true; } @@ -1062,8 +1062,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind return false; } - private bool AddTupleDefaultly(IntermediateTuple tuple) => - this.BackendHelper.TryAddTupleToOutputMatchingTableDefinitions(this.Section, tuple, this.Output, this.TableDefinitions); + private bool AddSymbolDefaultly(IntermediateSymbol symbol) => + this.BackendHelper.TryAddSymbolToOutputMatchingTableDefinitions(this.Section, symbol, this.Output, this.TableDefinitions); private static OutputType SectionTypeToOutputType(SectionType type) { @@ -1085,11 +1085,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind } } - private Row CreateRow(IntermediateTuple tuple, string tableDefinitionName) => - this.CreateRow(tuple, this.TableDefinitions[tableDefinitionName]); + private Row CreateRow(IntermediateSymbol symbol, string tableDefinitionName) => + this.CreateRow(symbol, this.TableDefinitions[tableDefinitionName]); - private Row CreateRow(IntermediateTuple tuple, TableDefinition tableDefinition) => - this.BackendHelper.CreateRow(this.Section, tuple, this.Output, tableDefinition); + private Row CreateRow(IntermediateSymbol symbol, TableDefinition tableDefinition) => + this.BackendHelper.CreateRow(this.Section, symbol, this.Output, tableDefinition); private static string GetMsiFilenameValue(string shortName, string longName) { diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreatePatchTransformsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreatePatchTransformsCommand.cs index f65f885b..76e6dd56 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreatePatchTransformsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreatePatchTransformsCommand.cs @@ -9,7 +9,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using WixToolset.Core.WindowsInstaller.Msi; using WixToolset.Core.WindowsInstaller.Unbind; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; using WixToolset.Extensibility.Services; @@ -34,16 +34,16 @@ namespace WixToolset.Core.WindowsInstaller.Bind { var patchTransforms = new List(); - var tuples = this.Intermediate.Sections.SelectMany(s => s.Tuples).OfType(); + var symbols = this.Intermediate.Sections.SelectMany(s => s.Symbols).OfType(); - foreach (var tuple in tuples) + foreach (var symbol in symbols) { WindowsInstallerData transform; - if (tuple.TransformFile is null) + if (symbol.TransformFile is null) { - var baselineData = this.GetData(tuple.BaselineFile.Path); - var updateData = this.GetData(tuple.UpdateFile.Path); + var baselineData = this.GetData(symbol.BaselineFile.Path); + var updateData = this.GetData(symbol.UpdateFile.Path); var command = new GenerateTransformCommand(this.Messaging, baselineData, updateData, preserveUnchangedRows: true, showPedanticMessages: false); transform = command.Execute(); @@ -52,11 +52,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind { var exportBasePath = Path.Combine(this.IntermediateFolder, "_trans"); // TODO: come up with a better path. - var command = new UnbindTransformCommand(this.Messaging, tuple.TransformFile.Path, exportBasePath, this.IntermediateFolder); + var command = new UnbindTransformCommand(this.Messaging, symbol.TransformFile.Path, exportBasePath, this.IntermediateFolder); transform = command.Execute(); } - patchTransforms.Add(new PatchTransform(tuple.Id.Id, transform)); + patchTransforms.Add(new PatchTransform(symbol.Id.Id, transform)); } this.PatchTransforms = patchTransforms; diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateSpecialPropertiesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateSpecialPropertiesCommand.cs index 5b4fe9e5..0a042f48 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateSpecialPropertiesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateSpecialPropertiesCommand.cs @@ -6,7 +6,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Collections.Generic; using System.Linq; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; internal class CreateSpecialPropertiesCommand { @@ -24,7 +24,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind var secureProperties = new SortedSet(); var hiddenProperties = new SortedSet(); - foreach (var wixPropertyRow in this.Section.Tuples.OfType()) + foreach (var wixPropertyRow in this.Section.Symbols.OfType()) { if (wixPropertyRow.Admin) { @@ -43,7 +43,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } // Hide properties for in-script custom actions that have HideTarget set. - var hideTargetCustomActions = this.Section.Tuples.OfType().Where( + var hideTargetCustomActions = this.Section.Symbols.OfType().Where( ca => ca.Hidden && (ca.ExecutionType == CustomActionExecutionType.Deferred || ca.ExecutionType == CustomActionExecutionType.Commit @@ -52,12 +52,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind hiddenProperties.UnionWith(hideTargetCustomActions); // Ensure upgrade action properties are secure. - var actionProperties = this.Section.Tuples.OfType().Select(u => u.ActionProperty); + var actionProperties = this.Section.Symbols.OfType().Select(u => u.ActionProperty); secureProperties.UnionWith(actionProperties); if (0 < adminProperties.Count) { - this.Section.AddTuple(new PropertyTuple(null, new Identifier(AccessModifier.Private, "AdminProperties")) + this.Section.AddSymbol(new PropertySymbol(null, new Identifier(AccessModifier.Private, "AdminProperties")) { Value = String.Join(";", adminProperties), }); @@ -65,7 +65,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (0 < secureProperties.Count) { - this.Section.AddTuple(new PropertyTuple(null, new Identifier(AccessModifier.Private, "SecureCustomProperties")) + this.Section.AddSymbol(new PropertySymbol(null, new Identifier(AccessModifier.Private, "SecureCustomProperties")) { Value = String.Join(";", secureProperties), }); @@ -73,7 +73,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (0 < hiddenProperties.Count) { - this.Section.AddTuple(new PropertyTuple(null, new Identifier(AccessModifier.Private, "MsiHiddenProperties")) + this.Section.AddSymbol(new PropertySymbol(null, new Identifier(AccessModifier.Private, "MsiHiddenProperties")) { Value = String.Join(";", hiddenProperties) }); diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs index 792a13a9..37bda235 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs @@ -12,7 +12,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using WixToolset.Data; using WixToolset.Core.Native; using WixToolset.Core.Bind; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Extensibility.Services; using WixToolset.Core.WindowsInstaller.Msi; @@ -21,10 +21,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind /// internal class ExtractMergeModuleFilesCommand { - public ExtractMergeModuleFilesCommand(IMessaging messaging, IEnumerable wixMergeTuples, IEnumerable fileFacades, int installerVersion, string intermediateFolder, bool suppressLayout) + public ExtractMergeModuleFilesCommand(IMessaging messaging, IEnumerable wixMergeSymbols, IEnumerable fileFacades, int installerVersion, string intermediateFolder, bool suppressLayout) { this.Messaging = messaging; - this.WixMergeTuples = wixMergeTuples; + this.WixMergeSymbols = wixMergeSymbols; this.FileFacades = fileFacades; this.OutputInstallerVersion = installerVersion; this.IntermediateFolder = intermediateFolder; @@ -33,7 +33,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind private IMessaging Messaging { get; } - private IEnumerable WixMergeTuples { get; } + private IEnumerable WixMergeSymbols { get; } private IEnumerable FileFacades { get; } @@ -61,7 +61,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // is a lot more costly for the common cases. var indexedFileFacades = this.FileFacades.ToDictionary(f => f.Id, StringComparer.Ordinal); - foreach (var wixMergeRow in this.WixMergeTuples) + foreach (var wixMergeRow in this.WixMergeSymbols) { var containsFiles = this.CreateFacadesForMergeModuleFiles(wixMergeRow, mergeModulesFileFacades, indexedFileFacades); @@ -75,7 +75,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind this.MergeModulesFileFacades = mergeModulesFileFacades; } - private bool CreateFacadesForMergeModuleFiles(WixMergeTuple wixMergeRow, List mergeModulesFileFacades, Dictionary indexedFileFacades) + private bool CreateFacadesForMergeModuleFiles(WixMergeSymbol wixMergeRow, List mergeModulesFileFacades, Dictionary indexedFileFacades) { var containsFiles = false; @@ -96,13 +96,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind // NOTE: this is very tricky - the merge module file rows are not added to the // file table because they should not be created via idt import. Instead, these // rows are created by merging in the actual modules. - var fileTuple = new FileTuple(wixMergeRow.SourceLineNumbers, new Identifier(AccessModifier.Private, record[1])); - fileTuple.Attributes = wixMergeRow.FileAttributes; - fileTuple.DirectoryRef = record[2]; - fileTuple.DiskId = wixMergeRow.DiskId; - fileTuple.Source = new IntermediateFieldPathValue { Path = Path.Combine(this.IntermediateFolder, wixMergeRow.Id.Id, record[1]) }; + var fileSymbol = new FileSymbol(wixMergeRow.SourceLineNumbers, new Identifier(AccessModifier.Private, record[1])); + fileSymbol.Attributes = wixMergeRow.FileAttributes; + fileSymbol.DirectoryRef = record[2]; + fileSymbol.DiskId = wixMergeRow.DiskId; + fileSymbol.Source = new IntermediateFieldPathValue { Path = Path.Combine(this.IntermediateFolder, wixMergeRow.Id.Id, record[1]) }; - var mergeModuleFileFacade = new FileFacade(true, fileTuple); + var mergeModuleFileFacade = new FileFacade(true, fileSymbol); // If case-sensitive collision with another merge module or a user-authored file identifier. if (indexedFileFacades.TryGetValue(mergeModuleFileFacade.Id, out var collidingFacade)) @@ -159,7 +159,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind return containsFiles; } - private void ExtractFilesFromMergeModule(IMsmMerge2 merge, WixMergeTuple wixMergeRow) + private void ExtractFilesFromMergeModule(IMsmMerge2 merge, WixMergeSymbol wixMergeRow) { var moduleOpen = false; short mergeLanguage; diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/GenerateTransformCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/GenerateTransformCommand.cs index fc713954..121ffb1b 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/GenerateTransformCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/GenerateTransformCommand.cs @@ -7,7 +7,7 @@ namespace WixToolset.Core.WindowsInstaller using System.Globalization; using WixToolset.Core.WindowsInstaller.Msi; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; using WixToolset.Data.WindowsInstaller.Rows; using WixToolset.Extensibility.Services; diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/GetFileFacadesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/GetFileFacadesCommand.cs index 55171da4..c918e866 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/GetFileFacadesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/GetFileFacadesCommand.cs @@ -8,7 +8,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Linq; using WixToolset.Core.Bind; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; internal class GetFileFacadesCommand { @@ -25,10 +25,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind { var facades = new List(); - var assemblyFile = this.Section.Tuples.OfType().ToDictionary(t => t.Id.Id); - //var deltaPatchFiles = this.Section.Tuples.OfType().ToDictionary(t => t.Id.Id); + var assemblyFile = this.Section.Symbols.OfType().ToDictionary(t => t.Id.Id); + //var deltaPatchFiles = this.Section.Symbols.OfType().ToDictionary(t => t.Id.Id); - foreach (var file in this.Section.Tuples.OfType()) + foreach (var file in this.Section.Symbols.OfType()) { assemblyFile.TryGetValue(file.Id.Id, out var assembly); @@ -49,13 +49,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind /// /// Merge data from the WixPatchSymbolPaths rows into the WixDeltaPatchFile rows. /// - public void ResolveDeltaPatchSymbolPaths(Dictionary deltaPatchFiles, IEnumerable facades) + public void ResolveDeltaPatchSymbolPaths(Dictionary deltaPatchFiles, IEnumerable facades) { ILookup filesByComponent = null; ILookup filesByDirectory = null; ILookup filesByDiskId = null; - foreach (var row in this.Section.Tuples.OfType().OrderBy(r => r.SymbolType)) + foreach (var row in this.Section.Symbols.OfType().OrderBy(r => r.SymbolType)) { switch (row.SymbolType) { @@ -119,7 +119,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind /// Row from the WixPatchSymbolsPaths table. /// FileRow into which to set symbol information. /// This includes PreviousData as well. - private void MergeSymbolPaths(WixDeltaPatchSymbolPathsTuple row, WixDeltaPatchFileTuple file) + private void MergeSymbolPaths(WixDeltaPatchSymbolPathsSymbol row, WixDeltaPatchFileSymbol file) { if (file.SymbolPaths is null) { diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/LoadTableDefinitionsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/LoadTableDefinitionsCommand.cs index 0312ab44..2eb95bc5 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/LoadTableDefinitionsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/LoadTableDefinitionsCommand.cs @@ -7,7 +7,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Globalization; using System.Linq; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; using WixToolset.Extensibility; using WixToolset.Extensibility.Services; @@ -32,13 +32,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind public TableDefinitionCollection Execute() { var tableDefinitions = new TableDefinitionCollection(WindowsInstallerTableDefinitions.All); - var customColumnsById = this.Section.Tuples.OfType().ToDictionary(t => t.Id.Id); + var customColumnsById = this.Section.Symbols.OfType().ToDictionary(t => t.Id.Id); if (customColumnsById.Any()) { - foreach (var tuple in this.Section.Tuples.OfType()) + foreach (var symbol in this.Section.Symbols.OfType()) { - var customTableDefinition = this.CreateCustomTable(tuple, customColumnsById); + var customTableDefinition = this.CreateCustomTable(symbol, customColumnsById); tableDefinitions.Add(customTableDefinition); } } @@ -60,14 +60,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind return this.TableDefinitions; } - private TableDefinition CreateCustomTable(WixCustomTableTuple tuple, Dictionary customColumnsById) + private TableDefinition CreateCustomTable(WixCustomTableSymbol symbol, Dictionary customColumnsById) { - var columnNames = tuple.ColumnNamesSeparated; + var columnNames = symbol.ColumnNamesSeparated; var columns = new List(columnNames.Length); foreach (var name in columnNames) { - var column = customColumnsById[tuple.Id.Id + "/" + name]; + var column = customColumnsById[symbol.Id.Id + "/" + name]; var type = ColumnType.Unknown; @@ -208,7 +208,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind columns.Add(columnDefinition); } - var customTable = new TableDefinition(tuple.Id.Id, null, columns, tuple.Unreal); + var customTable = new TableDefinition(symbol.Id.Id, null, columns, symbol.Unreal); return customTable; } } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/MergeModulesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/MergeModulesCommand.cs index 1f85a33f..80684e7c 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/MergeModulesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/MergeModulesCommand.cs @@ -13,7 +13,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using WixToolset.Core.Native; using WixToolset.Core.WindowsInstaller.Msi; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; using WixToolset.Extensibility.Services; @@ -46,8 +46,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind public void Execute() { - var wixMergeTuples = this.Section.Tuples.OfType().ToList(); - if (!wixMergeTuples.Any()) + var wixMergeSymbols = this.Section.Symbols.OfType().ToList(); + if (!wixMergeSymbols.Any()) { return; } @@ -69,10 +69,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind merge.OpenDatabase(this.OutputPath); databaseOpen = true; - var featureModulesByMergeId = this.Section.Tuples.OfType().GroupBy(t => t.WixMergeRef).ToDictionary(g => g.Key); + var featureModulesByMergeId = this.Section.Symbols.OfType().GroupBy(t => t.WixMergeRef).ToDictionary(g => g.Key); // process all the merge rows - foreach (var wixMergeRow in wixMergeTuples) + foreach (var wixMergeRow in wixMergeSymbols) { var moduleOpen = false; @@ -217,7 +217,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using (var db = new Database(this.OutputPath, OpenDatabase.Direct)) { // Suppress individual actions. - foreach (var suppressAction in this.Section.Tuples.OfType()) + foreach (var suppressAction in this.Section.Symbols.OfType()) { var tableName = suppressAction.SequenceTable.WindowsInstallerTableName(); if (db.TableExists(tableName)) diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/ModularizeCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/ModularizeCommand.cs index 8b459d69..66ca502d 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/ModularizeCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/ModularizeCommand.cs @@ -10,18 +10,18 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Text; using System.Text.RegularExpressions; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; internal class ModularizeCommand { - public ModularizeCommand(WindowsInstallerData output, string modularizationSuffix, IEnumerable suppressTuples) + public ModularizeCommand(WindowsInstallerData output, string modularizationSuffix, IEnumerable suppressSymbols) { this.Output = output; this.ModularizationSuffix = modularizationSuffix; // Gather all the unique suppress modularization identifiers. - this.SuppressModularizationIdentifiers = new HashSet(suppressTuples.Select(s => s.Id.Id)); + this.SuppressModularizationIdentifiers = new HashSet(suppressSymbols.Select(s => s.Id.Id)); } private WindowsInstallerData Output { get; } @@ -144,17 +144,17 @@ namespace WixToolset.Core.WindowsInstaller.Bind { Debug.Assert(ColumnModularizeType.Condition == modularizeType); - // This heinous looking regular expression is actually quite an elegant way - // to shred the entire condition into the identifiers that need to be + // This heinous looking regular expression is actually quite an elegant way + // to shred the entire condition into the identifiers that need to be // modularized. Let's break it down piece by piece: // // 1. Look for the operators: NOT, EQV, XOR, OR, AND, IMP (plus a space). Note that the // regular expression is case insensitive so we don't have to worry about // all the permutations of these strings. - // 2. Look for quoted strings. Quoted strings are just text and are ignored + // 2. Look for quoted strings. Quoted strings are just text and are ignored // outright. - // 3. Look for environment variables. These look like identifiers we might - // otherwise be interested in but start with a percent sign. Like quoted + // 3. Look for environment variables. These look like identifiers we might + // otherwise be interested in but start with a percent sign. Like quoted // strings these enviroment variable references are ignored outright. // 4. Match all identifiers that are things that need to be modularized. Note // the special characters (!, $, ?, &) that denote Component and Feature states. diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs index 13d47215..ab5ebd4b 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs @@ -9,7 +9,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using WixToolset.Core.Bind; using WixToolset.Core.WindowsInstaller.Msi; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; @@ -41,7 +41,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind public bool LongNamesInImage { private get; set; } - public Func ResolveMedia { private get; set; } + public Func ResolveMedia { private get; set; } public IEnumerable FileTransfers { get; private set; } @@ -55,7 +55,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind var directories = new Dictionary(); - var mediaRows = this.Section.Tuples.OfType().ToDictionary(t => t.DiskId); + var mediaRows = this.Section.Symbols.OfType().ToDictionary(t => t.DiskId); using (var db = new Database(this.DatabasePath, OpenDatabase.ReadOnly)) { @@ -78,11 +78,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind // for each file in the array of uncompressed files foreach (FileFacade facade in this.FileFacades) { - var mediaTuple = mediaRows[facade.DiskId]; + var mediaSymbol = mediaRows[facade.DiskId]; string relativeFileLayoutPath = null; - string mediaLayoutFolder = mediaTuple.Layout; + string mediaLayoutFolder = mediaSymbol.Layout; - var mediaLayoutDirectory = this.ResolveMedia(mediaTuple, mediaLayoutFolder, this.LayoutDirectory); + var mediaLayoutDirectory = this.ResolveMedia(mediaSymbol, mediaLayoutFolder, this.LayoutDirectory); // setup up the query record and find the appropriate file in the // previously executed file view diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs index a5055209..7f43da9a 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs @@ -7,12 +7,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Globalization; using System.Linq; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; using WixToolset.Extensibility.Services; /// - /// Set sequence numbers for all the actions and create tuples in the output object. + /// Set sequence numbers for all the actions and create symbols in the output object. /// internal class SequenceActionsCommand { @@ -32,38 +32,38 @@ namespace WixToolset.Core.WindowsInstaller.Bind public void Execute() { - var requiredActionTuples = new Dictionary(); + var requiredActionSymbols = new Dictionary(); - // Get the standard actions required based on tuples in the section. - var overridableActionTuples = this.GetRequiredStandardActions(); + // Get the standard actions required based on symbols in the section. + var overridableActionSymbols = this.GetRequiredStandardActions(); - // Index all the action tuples and look for collisions. - foreach (var actionTuple in this.Section.Tuples.OfType()) + // Index all the action symbols and look for collisions. + foreach (var actionSymbol in this.Section.Symbols.OfType()) { - if (actionTuple.Overridable) // overridable action + if (actionSymbol.Overridable) // overridable action { - if (overridableActionTuples.TryGetValue(actionTuple.Id.Id, out var collidingActionTuple)) + if (overridableActionSymbols.TryGetValue(actionSymbol.Id.Id, out var collidingActionSymbol)) { - this.Messaging.Write(ErrorMessages.OverridableActionCollision(actionTuple.SourceLineNumbers, actionTuple.SequenceTable.ToString(), actionTuple.Action)); - if (null != collidingActionTuple.SourceLineNumbers) + this.Messaging.Write(ErrorMessages.OverridableActionCollision(actionSymbol.SourceLineNumbers, actionSymbol.SequenceTable.ToString(), actionSymbol.Action)); + if (null != collidingActionSymbol.SourceLineNumbers) { - this.Messaging.Write(ErrorMessages.OverridableActionCollision2(collidingActionTuple.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.OverridableActionCollision2(collidingActionSymbol.SourceLineNumbers)); } } else { - overridableActionTuples.Add(actionTuple.Id.Id, actionTuple); + overridableActionSymbols.Add(actionSymbol.Id.Id, actionSymbol); } } else // unsequenced or sequenced action. { // Unsequenced action (allowed for certain standard actions). - if (null == actionTuple.Before && null == actionTuple.After && !actionTuple.Sequence.HasValue) + if (null == actionSymbol.Before && null == actionSymbol.After && !actionSymbol.Sequence.HasValue) { - if (WindowsInstallerStandard.TryGetStandardAction(actionTuple.Id.Id, out var standardAction)) + if (WindowsInstallerStandard.TryGetStandardAction(actionSymbol.Id.Id, out var standardAction)) { // Populate the sequence from the standard action - actionTuple.Sequence = standardAction.Sequence; + actionSymbol.Sequence = standardAction.Sequence; } else // not a supported unscheduled action. { @@ -71,109 +71,109 @@ namespace WixToolset.Core.WindowsInstaller.Bind } } - if (requiredActionTuples.TryGetValue(actionTuple.Id.Id, out var collidingActionTuple)) + if (requiredActionSymbols.TryGetValue(actionSymbol.Id.Id, out var collidingActionSymbol)) { - this.Messaging.Write(ErrorMessages.ActionCollision(actionTuple.SourceLineNumbers, actionTuple.SequenceTable.ToString(), actionTuple.Action)); - if (null != collidingActionTuple.SourceLineNumbers) + this.Messaging.Write(ErrorMessages.ActionCollision(actionSymbol.SourceLineNumbers, actionSymbol.SequenceTable.ToString(), actionSymbol.Action)); + if (null != collidingActionSymbol.SourceLineNumbers) { - this.Messaging.Write(ErrorMessages.ActionCollision2(collidingActionTuple.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.ActionCollision2(collidingActionSymbol.SourceLineNumbers)); } } else { - requiredActionTuples.Add(actionTuple.Id.Id, actionTuple); + requiredActionSymbols.Add(actionSymbol.Id.Id, actionSymbol); } } } - // Add the overridable action tuples that are not overridden to the required action tuples. - foreach (var actionTuple in overridableActionTuples.Values) + // Add the overridable action symbols that are not overridden to the required action symbols. + foreach (var actionSymbol in overridableActionSymbols.Values) { - if (!requiredActionTuples.ContainsKey(actionTuple.Id.Id)) + if (!requiredActionSymbols.ContainsKey(actionSymbol.Id.Id)) { - requiredActionTuples.Add(actionTuple.Id.Id, actionTuple); + requiredActionSymbols.Add(actionSymbol.Id.Id, actionSymbol); } } // Suppress the required actions that are overridable. - foreach (var suppressActionTuple in this.Section.Tuples.OfType()) + foreach (var suppressActionSymbol in this.Section.Symbols.OfType()) { - var key = suppressActionTuple.Id.Id; + var key = suppressActionSymbol.Id.Id; - // If there is an overridable tuple to suppress; suppress it. There is no warning if there + // If there is an overridable symbol to suppress; suppress it. There is no warning if there // is no action to suppress because the action may be suppressed from a merge module in // the binder. - if (requiredActionTuples.TryGetValue(key, out var requiredActionTuple)) + if (requiredActionSymbols.TryGetValue(key, out var requiredActionSymbol)) { - if (requiredActionTuple.Overridable) + if (requiredActionSymbol.Overridable) { - this.Messaging.Write(WarningMessages.SuppressAction(suppressActionTuple.SourceLineNumbers, suppressActionTuple.Action, suppressActionTuple.SequenceTable.ToString())); - if (null != requiredActionTuple.SourceLineNumbers) + this.Messaging.Write(WarningMessages.SuppressAction(suppressActionSymbol.SourceLineNumbers, suppressActionSymbol.Action, suppressActionSymbol.SequenceTable.ToString())); + if (null != requiredActionSymbol.SourceLineNumbers) { - this.Messaging.Write(WarningMessages.SuppressAction2(requiredActionTuple.SourceLineNumbers)); + this.Messaging.Write(WarningMessages.SuppressAction2(requiredActionSymbol.SourceLineNumbers)); } - requiredActionTuples.Remove(key); + requiredActionSymbols.Remove(key); } - else // suppressing a non-overridable action tuple + else // suppressing a non-overridable action symbol { - this.Messaging.Write(ErrorMessages.SuppressNonoverridableAction(suppressActionTuple.SourceLineNumbers, suppressActionTuple.SequenceTable.ToString(), suppressActionTuple.Action)); - if (null != requiredActionTuple.SourceLineNumbers) + this.Messaging.Write(ErrorMessages.SuppressNonoverridableAction(suppressActionSymbol.SourceLineNumbers, suppressActionSymbol.SequenceTable.ToString(), suppressActionSymbol.Action)); + if (null != requiredActionSymbol.SourceLineNumbers) { - this.Messaging.Write(ErrorMessages.SuppressNonoverridableAction2(requiredActionTuple.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.SuppressNonoverridableAction2(requiredActionSymbol.SourceLineNumbers)); } } } } // Build up dependency trees of the relatively scheduled actions. - // Use ToList() to create a copy of the required action tuples so that new tuples can + // Use ToList() to create a copy of the required action symbols so that new symbols can // be added while enumerating. - foreach (var actionTuple in requiredActionTuples.Values.ToList()) + foreach (var actionSymbol in requiredActionSymbols.Values.ToList()) { - if (!actionTuple.Sequence.HasValue) + if (!actionSymbol.Sequence.HasValue) { // check for standard actions that don't have a sequence number in a merge module - if (SectionType.Module == this.Section.Type && WindowsInstallerStandard.IsStandardAction(actionTuple.Action)) + if (SectionType.Module == this.Section.Type && WindowsInstallerStandard.IsStandardAction(actionSymbol.Action)) { - this.Messaging.Write(ErrorMessages.StandardActionRelativelyScheduledInModule(actionTuple.SourceLineNumbers, actionTuple.SequenceTable.ToString(), actionTuple.Action)); + this.Messaging.Write(ErrorMessages.StandardActionRelativelyScheduledInModule(actionSymbol.SourceLineNumbers, actionSymbol.SequenceTable.ToString(), actionSymbol.Action)); } - this.SequenceActionTuple(actionTuple, requiredActionTuples); + this.SequenceActionSymbol(actionSymbol, requiredActionSymbols); } - else if (SectionType.Module == this.Section.Type && 0 < actionTuple.Sequence && !WindowsInstallerStandard.IsStandardAction(actionTuple.Action)) // check for custom actions and dialogs that have a sequence number + else if (SectionType.Module == this.Section.Type && 0 < actionSymbol.Sequence && !WindowsInstallerStandard.IsStandardAction(actionSymbol.Action)) // check for custom actions and dialogs that have a sequence number { - this.Messaging.Write(ErrorMessages.CustomActionSequencedInModule(actionTuple.SourceLineNumbers, actionTuple.SequenceTable.ToString(), actionTuple.Action)); + this.Messaging.Write(ErrorMessages.CustomActionSequencedInModule(actionSymbol.SourceLineNumbers, actionSymbol.SequenceTable.ToString(), actionSymbol.Action)); } } // Look for standard actions with sequence restrictions that aren't necessarily scheduled based // on the presence of a particular table. - if (requiredActionTuples.ContainsKey("InstallExecuteSequence/DuplicateFiles") && !requiredActionTuples.ContainsKey("InstallExecuteSequence/InstallFiles")) + if (requiredActionSymbols.ContainsKey("InstallExecuteSequence/DuplicateFiles") && !requiredActionSymbols.ContainsKey("InstallExecuteSequence/InstallFiles")) { WindowsInstallerStandard.TryGetStandardAction("InstallExecuteSequence/InstallFiles", out var standardAction); - requiredActionTuples.Add(standardAction.Id.Id, standardAction); + requiredActionSymbols.Add(standardAction.Id.Id, standardAction); } // Schedule actions. - List scheduledActionTuples; + List scheduledActionSymbols; if (SectionType.Module == this.Section.Type) { - scheduledActionTuples = requiredActionTuples.Values.ToList(); + scheduledActionSymbols = requiredActionSymbols.Values.ToList(); } else { - scheduledActionTuples = this.ScheduleActions(requiredActionTuples); + scheduledActionSymbols = this.ScheduleActions(requiredActionSymbols); } - // Remove all existing WixActionTuples from the section then add the + // Remove all existing WixActionSymbols from the section then add the // scheduled actions back to the section. Note: we add the indices in // reverse order to make it easy to remove them from the list later. var removeIndices = new List(); - for (var i = this.Section.Tuples.Count - 1; i >= 0; --i) + for (var i = this.Section.Symbols.Count - 1; i >= 0; --i) { - var tuple = this.Section.Tuples[i]; - if (tuple.Definition.Type == TupleDefinitionType.WixAction) + var symbol = this.Section.Symbols[i]; + if (symbol.Definition.Type == SymbolDefinitionType.WixAction) { removeIndices.Add(i); } @@ -181,164 +181,164 @@ namespace WixToolset.Core.WindowsInstaller.Bind foreach (var removeIndex in removeIndices) { - this.Section.Tuples.RemoveAt(removeIndex); + this.Section.Symbols.RemoveAt(removeIndex); } - foreach (var action in scheduledActionTuples) + foreach (var action in scheduledActionSymbols) { - this.Section.AddTuple(action); + this.Section.AddSymbol(action); } } - private Dictionary GetRequiredStandardActions() + private Dictionary GetRequiredStandardActions() { - var overridableActionTuples = new Dictionary(); + var overridableActionSymbols = new Dictionary(); var requiredActionIds = this.GetRequiredActionIds(); foreach (var actionId in requiredActionIds) { WindowsInstallerStandard.TryGetStandardAction(actionId, out var standardAction); - overridableActionTuples.Add(standardAction.Id.Id, standardAction); + overridableActionSymbols.Add(standardAction.Id.Id, standardAction); } - return overridableActionTuples; + return overridableActionSymbols; } - private List ScheduleActions(Dictionary requiredActionTuples) + private List ScheduleActions(Dictionary requiredActionSymbols) { - var scheduledActionTuples = new List(); + var scheduledActionSymbols = new List(); // Process each sequence table individually. foreach (SequenceTable sequenceTable in Enum.GetValues(typeof(SequenceTable))) { - // Create a collection of just the action tuples in this sequence - var sequenceActionTuples = requiredActionTuples.Values.Where(a => a.SequenceTable == sequenceTable).ToList(); + // Create a collection of just the action symbols in this sequence + var sequenceActionSymbols = requiredActionSymbols.Values.Where(a => a.SequenceTable == sequenceTable).ToList(); // Schedule the absolutely scheduled actions (by sorting them by their sequence numbers). - var absoluteActionTuples = new List(); - foreach (var actionTuple in sequenceActionTuples) + var absoluteActionSymbols = new List(); + foreach (var actionSymbol in sequenceActionSymbols) { - if (actionTuple.Sequence.HasValue) + if (actionSymbol.Sequence.HasValue) { // Look for sequence number collisions - foreach (var sequenceScheduledActionTuple in absoluteActionTuples) + foreach (var sequenceScheduledActionSymbol in absoluteActionSymbols) { - if (sequenceScheduledActionTuple.Sequence == actionTuple.Sequence) + if (sequenceScheduledActionSymbol.Sequence == actionSymbol.Sequence) { - this.Messaging.Write(WarningMessages.ActionSequenceCollision(actionTuple.SourceLineNumbers, actionTuple.SequenceTable.ToString(), actionTuple.Action, sequenceScheduledActionTuple.Action, actionTuple.Sequence ?? 0)); - if (null != sequenceScheduledActionTuple.SourceLineNumbers) + this.Messaging.Write(WarningMessages.ActionSequenceCollision(actionSymbol.SourceLineNumbers, actionSymbol.SequenceTable.ToString(), actionSymbol.Action, sequenceScheduledActionSymbol.Action, actionSymbol.Sequence ?? 0)); + if (null != sequenceScheduledActionSymbol.SourceLineNumbers) { - this.Messaging.Write(WarningMessages.ActionSequenceCollision2(sequenceScheduledActionTuple.SourceLineNumbers)); + this.Messaging.Write(WarningMessages.ActionSequenceCollision2(sequenceScheduledActionSymbol.SourceLineNumbers)); } } } - absoluteActionTuples.Add(actionTuple); + absoluteActionSymbols.Add(actionSymbol); } } - absoluteActionTuples.Sort((x, y) => (x.Sequence ?? 0).CompareTo(y.Sequence ?? 0)); + absoluteActionSymbols.Sort((x, y) => (x.Sequence ?? 0).CompareTo(y.Sequence ?? 0)); // Schedule the relatively scheduled actions (by resolving the dependency trees). var previousUsedSequence = 0; - var relativeActionTuples = new List(); - for (int j = 0; j < absoluteActionTuples.Count; j++) + var relativeActionSymbols = new List(); + for (int j = 0; j < absoluteActionSymbols.Count; j++) { - var absoluteActionTuple = absoluteActionTuples[j]; + var absoluteActionSymbol = absoluteActionSymbols[j]; - // Get all the relatively scheduled action tuples occuring before and after this absolutely scheduled action tuple. - var relativeActions = this.GetAllRelativeActionsForSequenceType(sequenceTable, absoluteActionTuple); + // Get all the relatively scheduled action symbols occuring before and after this absolutely scheduled action symbol. + var relativeActions = this.GetAllRelativeActionsForSequenceType(sequenceTable, absoluteActionSymbol); // Check for relatively scheduled actions occuring before/after a special action // (those actions with a negative sequence number). - if (absoluteActionTuple.Sequence < 0 && (relativeActions.PreviousActions.Any() || relativeActions.NextActions.Any())) + if (absoluteActionSymbol.Sequence < 0 && (relativeActions.PreviousActions.Any() || relativeActions.NextActions.Any())) { // Create errors for all the before actions. - foreach (var actionTuple in relativeActions.PreviousActions) + foreach (var actionSymbol in relativeActions.PreviousActions) { - this.Messaging.Write(ErrorMessages.ActionScheduledRelativeToTerminationAction(actionTuple.SourceLineNumbers, actionTuple.SequenceTable.ToString(), actionTuple.Action, absoluteActionTuple.Action)); + this.Messaging.Write(ErrorMessages.ActionScheduledRelativeToTerminationAction(actionSymbol.SourceLineNumbers, actionSymbol.SequenceTable.ToString(), actionSymbol.Action, absoluteActionSymbol.Action)); } // Create errors for all the after actions. - foreach (var actionTuple in relativeActions.NextActions) + foreach (var actionSymbol in relativeActions.NextActions) { - this.Messaging.Write(ErrorMessages.ActionScheduledRelativeToTerminationAction(actionTuple.SourceLineNumbers, actionTuple.SequenceTable.ToString(), actionTuple.Action, absoluteActionTuple.Action)); + this.Messaging.Write(ErrorMessages.ActionScheduledRelativeToTerminationAction(actionSymbol.SourceLineNumbers, actionSymbol.SequenceTable.ToString(), actionSymbol.Action, absoluteActionSymbol.Action)); } // If there is source line information for the absolutely scheduled action display it - if (absoluteActionTuple.SourceLineNumbers != null) + if (absoluteActionSymbol.SourceLineNumbers != null) { - this.Messaging.Write(ErrorMessages.ActionScheduledRelativeToTerminationAction2(absoluteActionTuple.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.ActionScheduledRelativeToTerminationAction2(absoluteActionSymbol.SourceLineNumbers)); } continue; } - // Schedule the action tuples before this one. - var unusedSequence = absoluteActionTuple.Sequence - 1; + // Schedule the action symbols before this one. + var unusedSequence = absoluteActionSymbol.Sequence - 1; for (var i = relativeActions.PreviousActions.Count - 1; i >= 0; i--) { - var relativeActionTuple = relativeActions.PreviousActions[i]; + var relativeActionSymbol = relativeActions.PreviousActions[i]; // look for collisions if (unusedSequence == previousUsedSequence) { - this.Messaging.Write(ErrorMessages.NoUniqueActionSequenceNumber(relativeActionTuple.SourceLineNumbers, relativeActionTuple.SequenceTable.ToString(), relativeActionTuple.Action, absoluteActionTuple.Action)); - if (absoluteActionTuple.SourceLineNumbers != null) + this.Messaging.Write(ErrorMessages.NoUniqueActionSequenceNumber(relativeActionSymbol.SourceLineNumbers, relativeActionSymbol.SequenceTable.ToString(), relativeActionSymbol.Action, absoluteActionSymbol.Action)); + if (absoluteActionSymbol.SourceLineNumbers != null) { - this.Messaging.Write(ErrorMessages.NoUniqueActionSequenceNumber2(absoluteActionTuple.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.NoUniqueActionSequenceNumber2(absoluteActionSymbol.SourceLineNumbers)); } unusedSequence++; } - relativeActionTuple.Sequence = unusedSequence; - relativeActionTuples.Add(relativeActionTuple); + relativeActionSymbol.Sequence = unusedSequence; + relativeActionSymbols.Add(relativeActionSymbol); unusedSequence--; } // Determine the next used action sequence number. var nextUsedSequence = Int16.MaxValue + 1; - if (absoluteActionTuples.Count > j + 1) + if (absoluteActionSymbols.Count > j + 1) { - nextUsedSequence = absoluteActionTuples[j + 1].Sequence ?? 0; + nextUsedSequence = absoluteActionSymbols[j + 1].Sequence ?? 0; } - // Schedule the action tuples after this one. - unusedSequence = absoluteActionTuple.Sequence + 1; + // Schedule the action symbols after this one. + unusedSequence = absoluteActionSymbol.Sequence + 1; for (var i = 0; i < relativeActions.NextActions.Count; i++) { - var relativeActionTuple = relativeActions.NextActions[i]; + var relativeActionSymbol = relativeActions.NextActions[i]; if (unusedSequence == nextUsedSequence) { - this.Messaging.Write(ErrorMessages.NoUniqueActionSequenceNumber(relativeActionTuple.SourceLineNumbers, relativeActionTuple.SequenceTable.ToString(), relativeActionTuple.Action, absoluteActionTuple.Action)); - if (absoluteActionTuple.SourceLineNumbers != null) + this.Messaging.Write(ErrorMessages.NoUniqueActionSequenceNumber(relativeActionSymbol.SourceLineNumbers, relativeActionSymbol.SequenceTable.ToString(), relativeActionSymbol.Action, absoluteActionSymbol.Action)); + if (absoluteActionSymbol.SourceLineNumbers != null) { - this.Messaging.Write(ErrorMessages.NoUniqueActionSequenceNumber2(absoluteActionTuple.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.NoUniqueActionSequenceNumber2(absoluteActionSymbol.SourceLineNumbers)); } unusedSequence--; } - relativeActionTuple.Sequence = unusedSequence; - relativeActionTuples.Add(relativeActionTuple); + relativeActionSymbol.Sequence = unusedSequence; + relativeActionSymbols.Add(relativeActionSymbol); unusedSequence++; } // keep track of this sequence number as the previous used sequence number for the next iteration - previousUsedSequence = absoluteActionTuple.Sequence ?? 0; + previousUsedSequence = absoluteActionSymbol.Sequence ?? 0; } // add the absolutely and relatively scheduled actions to the list of scheduled actions - scheduledActionTuples.AddRange(absoluteActionTuples); - scheduledActionTuples.AddRange(relativeActionTuples); + scheduledActionSymbols.AddRange(absoluteActionSymbols); + scheduledActionSymbols.AddRange(relativeActionSymbols); } - return scheduledActionTuples; + return scheduledActionSymbols; } private IEnumerable GetRequiredActionIds() @@ -396,16 +396,16 @@ namespace WixToolset.Core.WindowsInstaller.Bind set.Add("InstallUISequence/ValidateProductID"); } - // Gather the required actions for each tuple type. - foreach (var tupleType in this.Section.Tuples.Select(t => t.Definition.Type).Distinct()) + // Gather the required actions for each symbol type. + foreach (var symbolType in this.Section.Symbols.Select(t => t.Definition.Type).Distinct()) { - switch (tupleType) + switch (symbolType) { - case TupleDefinitionType.AppSearch: + case SymbolDefinitionType.AppSearch: set.Add("InstallExecuteSequence/AppSearch"); set.Add("InstallUISequence/AppSearch"); break; - case TupleDefinitionType.CCPSearch: + case SymbolDefinitionType.CCPSearch: set.Add("InstallExecuteSequence/AppSearch"); set.Add("InstallExecuteSequence/CCPSearch"); set.Add("InstallExecuteSequence/RMCCPSearch"); @@ -413,40 +413,40 @@ namespace WixToolset.Core.WindowsInstaller.Bind set.Add("InstallUISequence/CCPSearch"); set.Add("InstallUISequence/RMCCPSearch"); break; - case TupleDefinitionType.Class: + case SymbolDefinitionType.Class: set.Add("AdvertiseExecuteSequence/RegisterClassInfo"); set.Add("InstallExecuteSequence/RegisterClassInfo"); set.Add("InstallExecuteSequence/UnregisterClassInfo"); break; - case TupleDefinitionType.Complus: + case SymbolDefinitionType.Complus: set.Add("InstallExecuteSequence/RegisterComPlus"); set.Add("InstallExecuteSequence/UnregisterComPlus"); break; - case TupleDefinitionType.CreateFolder: + case SymbolDefinitionType.CreateFolder: set.Add("InstallExecuteSequence/CreateFolders"); set.Add("InstallExecuteSequence/RemoveFolders"); break; - case TupleDefinitionType.DuplicateFile: + case SymbolDefinitionType.DuplicateFile: set.Add("InstallExecuteSequence/DuplicateFiles"); set.Add("InstallExecuteSequence/RemoveDuplicateFiles"); break; - case TupleDefinitionType.Environment: + case SymbolDefinitionType.Environment: set.Add("InstallExecuteSequence/WriteEnvironmentStrings"); set.Add("InstallExecuteSequence/RemoveEnvironmentStrings"); break; - case TupleDefinitionType.Extension: + case SymbolDefinitionType.Extension: set.Add("AdvertiseExecuteSequence/RegisterExtensionInfo"); set.Add("InstallExecuteSequence/RegisterExtensionInfo"); set.Add("InstallExecuteSequence/UnregisterExtensionInfo"); break; - case TupleDefinitionType.File: + case SymbolDefinitionType.File: set.Add("InstallExecuteSequence/InstallFiles"); set.Add("InstallExecuteSequence/RemoveFiles"); var foundFont = false; var foundSelfReg = false; var foundBindPath = false; - foreach (var file in this.Section.Tuples.OfType()) + foreach (var file in this.Section.Symbols.OfType()) { if (!foundFont && !String.IsNullOrEmpty(file.FontTitle)) { @@ -469,83 +469,83 @@ namespace WixToolset.Core.WindowsInstaller.Bind } } break; - case TupleDefinitionType.IniFile: + case SymbolDefinitionType.IniFile: set.Add("InstallExecuteSequence/WriteIniValues"); set.Add("InstallExecuteSequence/RemoveIniValues"); break; - case TupleDefinitionType.IsolatedComponent: + case SymbolDefinitionType.IsolatedComponent: set.Add("InstallExecuteSequence/IsolateComponents"); break; - case TupleDefinitionType.LaunchCondition: + case SymbolDefinitionType.LaunchCondition: set.Add("InstallExecuteSequence/LaunchConditions"); set.Add("InstallUISequence/LaunchConditions"); break; - case TupleDefinitionType.MIME: + case SymbolDefinitionType.MIME: set.Add("AdvertiseExecuteSequence/RegisterMIMEInfo"); set.Add("InstallExecuteSequence/RegisterMIMEInfo"); set.Add("InstallExecuteSequence/UnregisterMIMEInfo"); break; - case TupleDefinitionType.MoveFile: + case SymbolDefinitionType.MoveFile: set.Add("InstallExecuteSequence/MoveFiles"); break; - case TupleDefinitionType.Assembly: + case SymbolDefinitionType.Assembly: set.Add("AdvertiseExecuteSequence/MsiPublishAssemblies"); set.Add("InstallExecuteSequence/MsiPublishAssemblies"); set.Add("InstallExecuteSequence/MsiUnpublishAssemblies"); break; - case TupleDefinitionType.MsiServiceConfig: - case TupleDefinitionType.MsiServiceConfigFailureActions: + case SymbolDefinitionType.MsiServiceConfig: + case SymbolDefinitionType.MsiServiceConfigFailureActions: set.Add("InstallExecuteSequence/MsiConfigureServices"); break; - case TupleDefinitionType.ODBCDataSource: - case TupleDefinitionType.ODBCTranslator: - case TupleDefinitionType.ODBCDriver: + case SymbolDefinitionType.ODBCDataSource: + case SymbolDefinitionType.ODBCTranslator: + case SymbolDefinitionType.ODBCDriver: set.Add("InstallExecuteSequence/SetODBCFolders"); set.Add("InstallExecuteSequence/InstallODBC"); set.Add("InstallExecuteSequence/RemoveODBC"); break; - case TupleDefinitionType.ProgId: + case SymbolDefinitionType.ProgId: set.Add("AdvertiseExecuteSequence/RegisterProgIdInfo"); set.Add("InstallExecuteSequence/RegisterProgIdInfo"); set.Add("InstallExecuteSequence/UnregisterProgIdInfo"); break; - case TupleDefinitionType.PublishComponent: + case SymbolDefinitionType.PublishComponent: set.Add("AdvertiseExecuteSequence/PublishComponents"); set.Add("InstallExecuteSequence/PublishComponents"); set.Add("InstallExecuteSequence/UnpublishComponents"); break; - case TupleDefinitionType.Registry: - case TupleDefinitionType.RemoveRegistry: + case SymbolDefinitionType.Registry: + case SymbolDefinitionType.RemoveRegistry: set.Add("InstallExecuteSequence/WriteRegistryValues"); set.Add("InstallExecuteSequence/RemoveRegistryValues"); break; - case TupleDefinitionType.RemoveFile: + case SymbolDefinitionType.RemoveFile: set.Add("InstallExecuteSequence/RemoveFiles"); break; - case TupleDefinitionType.ServiceControl: + case SymbolDefinitionType.ServiceControl: set.Add("InstallExecuteSequence/StartServices"); set.Add("InstallExecuteSequence/StopServices"); set.Add("InstallExecuteSequence/DeleteServices"); break; - case TupleDefinitionType.ServiceInstall: + case SymbolDefinitionType.ServiceInstall: set.Add("InstallExecuteSequence/InstallServices"); break; - case TupleDefinitionType.Shortcut: + case SymbolDefinitionType.Shortcut: set.Add("AdvertiseExecuteSequence/CreateShortcuts"); set.Add("InstallExecuteSequence/CreateShortcuts"); set.Add("InstallExecuteSequence/RemoveShortcuts"); break; - case TupleDefinitionType.TypeLib: + case SymbolDefinitionType.TypeLib: set.Add("InstallExecuteSequence/RegisterTypeLibraries"); set.Add("InstallExecuteSequence/UnregisterTypeLibraries"); break; - case TupleDefinitionType.Upgrade: + case SymbolDefinitionType.Upgrade: set.Add("InstallExecuteSequence/FindRelatedProducts"); set.Add("InstallUISequence/FindRelatedProducts"); // Only add the MigrateFeatureStates action if MigrateFeature attribute is set on // at least one UpgradeVersion element. - if (this.Section.Tuples.OfType().Any(t => t.MigrateFeatures)) + if (this.Section.Symbols.OfType().Any(t => t.MigrateFeatures)) { set.Add("InstallExecuteSequence/MigrateFeatureStates"); set.Add("InstallUISequence/MigrateFeatureStates"); @@ -557,7 +557,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind return set; } - private IEnumerable GetActions(SequenceTable sequence, string[] actionNames) + private IEnumerable GetActions(SequenceTable sequence, string[] actionNames) { foreach (var action in WindowsInstallerStandard.StandardActions()) { @@ -571,64 +571,64 @@ namespace WixToolset.Core.WindowsInstaller.Bind /// /// Sequence an action before or after a standard action. /// - /// The action tuple to be sequenced. - /// Collection of actions which must be included. - private void SequenceActionTuple(WixActionTuple actionTuple, Dictionary requiredActionTuples) + /// The action symbol to be sequenced. + /// Collection of actions which must be included. + private void SequenceActionSymbol(WixActionSymbol actionSymbol, Dictionary requiredActionSymbols) { var after = false; - if (actionTuple.After != null) + if (actionSymbol.After != null) { after = true; } - else if (actionTuple.Before == null) + else if (actionSymbol.Before == null) { throw new InvalidOperationException("Found an action with no Sequence, Before, or After column set."); } - var parentActionName = (after ? actionTuple.After : actionTuple.Before); - var parentActionKey = actionTuple.SequenceTable.ToString() + "/" + parentActionName; + var parentActionName = (after ? actionSymbol.After : actionSymbol.Before); + var parentActionKey = actionSymbol.SequenceTable.ToString() + "/" + parentActionName; - if (!requiredActionTuples.TryGetValue(parentActionKey, out var parentActionTuple)) + if (!requiredActionSymbols.TryGetValue(parentActionKey, out var parentActionSymbol)) { // If the missing parent action is a standard action (with a suggested sequence number), add it. - if (WindowsInstallerStandard.TryGetStandardAction(parentActionKey, out parentActionTuple)) + if (WindowsInstallerStandard.TryGetStandardAction(parentActionKey, out parentActionSymbol)) { // Create a clone to avoid modifying the static copy of the object. - // TODO: consider this: parentActionTuple = parentActionTuple.Clone(); + // TODO: consider this: parentActionSymbol = parentActionSymbol.Clone(); - requiredActionTuples.Add(parentActionTuple.Id.Id, parentActionTuple); + requiredActionSymbols.Add(parentActionSymbol.Id.Id, parentActionSymbol); } else { throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, "Found an action with a non-existent {0} action: {1}.", (after ? "After" : "Before"), parentActionName)); } } - else if (actionTuple == parentActionTuple || this.ContainsChildActionTuple(actionTuple, parentActionTuple)) // cycle detected + else if (actionSymbol == parentActionSymbol || this.ContainsChildActionSymbol(actionSymbol, parentActionSymbol)) // cycle detected { - throw new WixException(ErrorMessages.ActionCircularDependency(actionTuple.SourceLineNumbers, actionTuple.SequenceTable.ToString(), actionTuple.Action, parentActionTuple.Action)); + throw new WixException(ErrorMessages.ActionCircularDependency(actionSymbol.SourceLineNumbers, actionSymbol.SequenceTable.ToString(), actionSymbol.Action, parentActionSymbol.Action)); } - // Add this action to the appropriate list of dependent action tuples. - var relativeActions = this.GetRelativeActions(parentActionTuple); - var relatedTuples = (after ? relativeActions.NextActions : relativeActions.PreviousActions); - relatedTuples.Add(actionTuple); + // Add this action to the appropriate list of dependent action symbols. + var relativeActions = this.GetRelativeActions(parentActionSymbol); + var relatedSymbols = (after ? relativeActions.NextActions : relativeActions.PreviousActions); + relatedSymbols.Add(actionSymbol); } - private bool ContainsChildActionTuple(WixActionTuple childTuple, WixActionTuple parentTuple) + private bool ContainsChildActionSymbol(WixActionSymbol childSymbol, WixActionSymbol parentSymbol) { var result = false; - if (this.RelativeActionsForActions.TryGetValue(childTuple.Id.Id, out var relativeActions)) + if (this.RelativeActionsForActions.TryGetValue(childSymbol.Id.Id, out var relativeActions)) { - result = relativeActions.NextActions.Any(a => a.SequenceTable == parentTuple.SequenceTable && a.Id.Id == parentTuple.Id.Id) || - relativeActions.PreviousActions.Any(a => a.SequenceTable == parentTuple.SequenceTable && a.Id.Id == parentTuple.Id.Id); + result = relativeActions.NextActions.Any(a => a.SequenceTable == parentSymbol.SequenceTable && a.Id.Id == parentSymbol.Id.Id) || + relativeActions.PreviousActions.Any(a => a.SequenceTable == parentSymbol.SequenceTable && a.Id.Id == parentSymbol.Id.Id); } return result; } - private RelativeActions GetRelativeActions(WixActionTuple action) + private RelativeActions GetRelativeActions(WixActionSymbol action) { if (!this.RelativeActionsForActions.TryGetValue(action.Id.Id, out var relativeActions)) { @@ -639,7 +639,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind return relativeActions; } - private RelativeActions GetAllRelativeActionsForSequenceType(SequenceTable sequenceType, WixActionTuple action) + private RelativeActions GetAllRelativeActionsForSequenceType(SequenceTable sequenceType, WixActionSymbol action) { var relativeActions = new RelativeActions(); @@ -653,7 +653,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind return relativeActions; } - private void RecurseRelativeActionsForSequenceType(SequenceTable sequenceType, List actions, List visitedActions) + private void RecurseRelativeActionsForSequenceType(SequenceTable sequenceType, List actions, List visitedActions) { foreach (var action in actions.Where(a => a.SequenceTable == sequenceType)) { @@ -673,9 +673,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind private class RelativeActions { - public List PreviousActions { get; } = new List(); + public List PreviousActions { get; } = new List(); - public List NextActions { get; } = new List(); + public List NextActions { get; } = new List(); } } } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs index 75bcfe17..938627ed 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs @@ -11,7 +11,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using WixToolset.Core.Bind; using WixToolset.Core.WindowsInstaller.Msi; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Extensibility.Services; /// @@ -43,15 +43,15 @@ namespace WixToolset.Core.WindowsInstaller.Bind public void Execute() { - var assemblyNameTuples = this.Section.Tuples.OfType().ToDictionary(t => t.Id.Id); + var assemblyNameSymbols = this.Section.Symbols.OfType().ToDictionary(t => t.Id.Id); foreach (var file in this.UpdateFileFacades) { - this.UpdateFileFacade(file, assemblyNameTuples); + this.UpdateFileFacade(file, assemblyNameSymbols); } } - private void UpdateFileFacade(FileFacade facade, Dictionary assemblyNameTuples) + private void UpdateFileFacade(FileFacade facade, Dictionary assemblyNameSymbols) { FileInfo fileInfo = null; try @@ -155,7 +155,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (null == facade.Hash) { - facade.Hash = this.Section.AddTuple(new MsiFileHashTuple(facade.SourceLineNumber, facade.Identifier)); + facade.Hash = this.Section.AddSymbol(new MsiFileHashSymbol(facade.SourceLineNumber, facade.Identifier)); } facade.Hash.Options = 0; @@ -220,23 +220,23 @@ namespace WixToolset.Core.WindowsInstaller.Bind { var assemblyName = AssemblyNameReader.ReadAssembly(facade.SourceLineNumber, fileInfo.FullName, version); - this.SetMsiAssemblyName(assemblyNameTuples, facade, "name", assemblyName.Name); - this.SetMsiAssemblyName(assemblyNameTuples, facade, "culture", assemblyName.Culture); - this.SetMsiAssemblyName(assemblyNameTuples, facade, "version", assemblyName.Version); + this.SetMsiAssemblyName(assemblyNameSymbols, facade, "name", assemblyName.Name); + this.SetMsiAssemblyName(assemblyNameSymbols, facade, "culture", assemblyName.Culture); + this.SetMsiAssemblyName(assemblyNameSymbols, facade, "version", assemblyName.Version); if (!String.IsNullOrEmpty(assemblyName.Architecture)) { - this.SetMsiAssemblyName(assemblyNameTuples, facade, "processorArchitecture", assemblyName.Architecture); + this.SetMsiAssemblyName(assemblyNameSymbols, facade, "processorArchitecture", assemblyName.Architecture); } // TODO: WiX v3 seemed to do this but not clear it should actually be done. //else if (!String.IsNullOrEmpty(file.WixFile.ProcessorArchitecture)) //{ - // this.SetMsiAssemblyName(assemblyNameTuples, file, "processorArchitecture", file.WixFile.ProcessorArchitecture); + // this.SetMsiAssemblyName(assemblyNameSymbols, file, "processorArchitecture", file.WixFile.ProcessorArchitecture); //} if (assemblyName.StrongNamedSigned) { - this.SetMsiAssemblyName(assemblyNameTuples, facade, "publicKeyToken", assemblyName.PublicKeyToken); + this.SetMsiAssemblyName(assemblyNameSymbols, facade, "publicKeyToken", assemblyName.PublicKeyToken); } else if (facade.AssemblyApplicationFileRef == null) { @@ -245,7 +245,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (!String.IsNullOrEmpty(assemblyName.FileVersion)) { - this.SetMsiAssemblyName(assemblyNameTuples, facade, "fileVersion", assemblyName.FileVersion); + this.SetMsiAssemblyName(assemblyNameSymbols, facade, "fileVersion", assemblyName.FileVersion); } // add the assembly name to the information cache @@ -276,27 +276,27 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (!String.IsNullOrEmpty(assemblyName.Name)) { - this.SetMsiAssemblyName(assemblyNameTuples, facade, "name", assemblyName.Name); + this.SetMsiAssemblyName(assemblyNameSymbols, facade, "name", assemblyName.Name); } if (!String.IsNullOrEmpty(assemblyName.Version)) { - this.SetMsiAssemblyName(assemblyNameTuples, facade, "version", assemblyName.Version); + this.SetMsiAssemblyName(assemblyNameSymbols, facade, "version", assemblyName.Version); } if (!String.IsNullOrEmpty(assemblyName.Type)) { - this.SetMsiAssemblyName(assemblyNameTuples, facade, "type", assemblyName.Type); + this.SetMsiAssemblyName(assemblyNameSymbols, facade, "type", assemblyName.Type); } if (!String.IsNullOrEmpty(assemblyName.Architecture)) { - this.SetMsiAssemblyName(assemblyNameTuples, facade, "processorArchitecture", assemblyName.Architecture); + this.SetMsiAssemblyName(assemblyNameSymbols, facade, "processorArchitecture", assemblyName.Architecture); } if (!String.IsNullOrEmpty(assemblyName.PublicKeyToken)) { - this.SetMsiAssemblyName(assemblyNameTuples, facade, "publicKeyToken", assemblyName.PublicKeyToken); + this.SetMsiAssemblyName(assemblyNameSymbols, facade, "publicKeyToken", assemblyName.PublicKeyToken); } } catch (WixException e) @@ -310,11 +310,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind /// Set an MsiAssemblyName row. If it was directly authored, override the value, otherwise /// create a new row. /// - /// MsiAssemblyName table. + /// MsiAssemblyName table. /// FileFacade containing the assembly read for the MsiAssemblyName row. /// MsiAssemblyName name. /// MsiAssemblyName value. - private void SetMsiAssemblyName(Dictionary assemblyNameTuples, FileFacade facade, string name, string value) + private void SetMsiAssemblyName(Dictionary assemblyNameSymbols, FileFacade facade, string name, string value) { // check for null value (this can occur when grabbing the file version from an assembly without one) if (String.IsNullOrEmpty(value)) @@ -333,9 +333,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind // override directly authored value var lookup = String.Concat(facade.ComponentRef, "/", name); - if (!assemblyNameTuples.TryGetValue(lookup, out var assemblyNameTuple)) + if (!assemblyNameSymbols.TryGetValue(lookup, out var assemblyNameSymbol)) { - assemblyNameTuple = this.Section.AddTuple(new MsiAssemblyNameTuple(facade.SourceLineNumber, new Identifier(AccessModifier.Private, facade.ComponentRef, name)) + assemblyNameSymbol = this.Section.AddSymbol(new MsiAssemblyNameSymbol(facade.SourceLineNumber, new Identifier(AccessModifier.Private, facade.ComponentRef, name)) { ComponentRef = facade.ComponentRef, Name = name, @@ -344,15 +344,15 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (null == facade.AssemblyNames) { - facade.AssemblyNames = new List(); + facade.AssemblyNames = new List(); } - facade.AssemblyNames.Add(assemblyNameTuple); + facade.AssemblyNames.Add(assemblyNameSymbol); - assemblyNameTuples.Add(assemblyNameTuple.Id.Id, assemblyNameTuple); + assemblyNameSymbols.Add(assemblyNameSymbol.Id.Id, assemblyNameSymbol); } - assemblyNameTuple.Value = value; + assemblyNameSymbol.Value = value; if (this.VariableCache != null) { diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFromTextFilesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFromTextFilesCommand.cs index 4d09ff6b..66a648cc 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFromTextFilesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFromTextFilesCommand.cs @@ -6,7 +6,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.IO; using System.Linq; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Extensibility.Services; internal class UpdateFromTextFilesCommand @@ -23,17 +23,17 @@ namespace WixToolset.Core.WindowsInstaller.Bind public void Execute() { - foreach (var bbControl in this.Section.Tuples.OfType().Where(t => t.SourceFile != null)) + foreach (var bbControl in this.Section.Symbols.OfType().Where(t => t.SourceFile != null)) { bbControl.Text = this.ReadTextFile(bbControl.SourceLineNumbers, bbControl.SourceFile.Path); } - foreach (var control in this.Section.Tuples.OfType().Where(t => t.SourceFile != null)) + foreach (var control in this.Section.Symbols.OfType().Where(t => t.SourceFile != null)) { control.Text = this.ReadTextFile(control.SourceLineNumbers, control.SourceFile.Path); } - foreach (var customAction in this.Section.Tuples.OfType().Where(c => c.ScriptFile != null)) + foreach (var customAction in this.Section.Symbols.OfType().Where(c => c.ScriptFile != null)) { customAction.Target = this.ReadTextFile(customAction.SourceLineNumbers, customAction.ScriptFile.Path); } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateMediaSequencesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateMediaSequencesCommand.cs index bf28b279..d3f2b9ea 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateMediaSequencesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateMediaSequencesCommand.cs @@ -6,7 +6,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Linq; using WixToolset.Core.Bind; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; internal class UpdateMediaSequencesCommand { @@ -22,7 +22,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind public void Execute() { - var mediaRows = this.Section.Tuples.OfType().ToDictionary(t => t.DiskId); + var mediaRows = this.Section.Symbols.OfType().ToDictionary(t => t.DiskId); // Calculate sequence numbers and media disk id layout for all file media information objects. if (SectionType.Module == this.Section.Type) @@ -37,25 +37,25 @@ namespace WixToolset.Core.WindowsInstaller.Bind else { var lastSequence = 0; - MediaTuple mediaTuple = null; + MediaSymbol mediaSymbol = null; var patchGroups = new Dictionary>(); // sequence the non-patch-added files foreach (var facade in this.FileFacades) { - if (null == mediaTuple) + if (null == mediaSymbol) { - mediaTuple = mediaRows[facade.DiskId]; + mediaSymbol = mediaRows[facade.DiskId]; if (SectionType.Patch == this.Section.Type) { // patch Media cannot start at zero - lastSequence = mediaTuple.LastSequence ?? 1; + lastSequence = mediaSymbol.LastSequence ?? 1; } } - else if (mediaTuple.DiskId != facade.DiskId) + else if (mediaSymbol.DiskId != facade.DiskId) { - mediaTuple.LastSequence = lastSequence; - mediaTuple = mediaRows[facade.DiskId]; + mediaSymbol.LastSequence = lastSequence; + mediaSymbol = mediaRows[facade.DiskId]; } if (facade.PatchGroup.HasValue) @@ -74,10 +74,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind } } - if (null != mediaTuple) + if (null != mediaSymbol) { - mediaTuple.LastSequence = lastSequence; - mediaTuple = null; + mediaSymbol.LastSequence = lastSequence; + mediaSymbol = null; } // sequence the patch-added files @@ -85,23 +85,23 @@ namespace WixToolset.Core.WindowsInstaller.Bind { foreach (var facade in patchGroup) { - if (null == mediaTuple) + if (null == mediaSymbol) { - mediaTuple = mediaRows[facade.DiskId]; + mediaSymbol = mediaRows[facade.DiskId]; } - else if (mediaTuple.DiskId != facade.DiskId) + else if (mediaSymbol.DiskId != facade.DiskId) { - mediaTuple.LastSequence = lastSequence; - mediaTuple = mediaRows[facade.DiskId]; + mediaSymbol.LastSequence = lastSequence; + mediaSymbol = mediaRows[facade.DiskId]; } facade.Sequence = ++lastSequence; } } - if (null != mediaTuple) + if (null != mediaSymbol) { - mediaTuple.LastSequence = lastSequence; + mediaSymbol.LastSequence = lastSequence; } } } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateTransformsWithFileFacades.cs b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateTransformsWithFileFacades.cs index 2af45e77..944fb224 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateTransformsWithFileFacades.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateTransformsWithFileFacades.cs @@ -7,7 +7,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Linq; using WixToolset.Core.Bind; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; using WixToolset.Data.WindowsInstaller.Rows; using WixToolset.Extensibility.Services; @@ -307,9 +307,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind ref duplicateFilesSequence); if (!hasPatchFilesAction) { - WindowsInstallerStandard.TryGetStandardAction(tableName, "PatchFiles", out var patchFilesActionTuple); + WindowsInstallerStandard.TryGetStandardAction(tableName, "PatchFiles", out var patchFilesActionSymbol); - var sequence = patchFilesActionTuple.Sequence; + var sequence = patchFilesActionSymbol.Sequence; // Test for default sequence value's appropriateness if (installFilesSequence >= sequence || (0 != duplicateFilesSequence && duplicateFilesSequence <= sequence)) @@ -318,14 +318,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (duplicateFilesSequence < installFilesSequence) { - throw new WixException(ErrorMessages.InsertInvalidSequenceActionOrder(mainFileRow.SourceLineNumbers, tableName, "InstallFiles", "DuplicateFiles", patchFilesActionTuple.Action)); + throw new WixException(ErrorMessages.InsertInvalidSequenceActionOrder(mainFileRow.SourceLineNumbers, tableName, "InstallFiles", "DuplicateFiles", patchFilesActionSymbol.Action)); } else { sequence = (duplicateFilesSequence + installFilesSequence) / 2; if (installFilesSequence == sequence || duplicateFilesSequence == sequence) { - throw new WixException(ErrorMessages.InsertSequenceNoSpace(mainFileRow.SourceLineNumbers, tableName, "InstallFiles", "DuplicateFiles", patchFilesActionTuple.Action)); + throw new WixException(ErrorMessages.InsertSequenceNoSpace(mainFileRow.SourceLineNumbers, tableName, "InstallFiles", "DuplicateFiles", patchFilesActionSymbol.Action)); } } } @@ -342,8 +342,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind } var patchAction = sequenceTable.CreateRow(null); - patchAction[0] = patchFilesActionTuple.Action; - patchAction[1] = patchFilesActionTuple.Condition; + patchAction[0] = patchFilesActionSymbol.Action; + patchAction[1] = patchFilesActionSymbol.Condition; patchAction[2] = sequence; patchAction.Operation = RowOperation.Add; } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/ValidateComponentGuidsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/ValidateComponentGuidsCommand.cs index 020a83fc..5cad9247 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/ValidateComponentGuidsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/ValidateComponentGuidsCommand.cs @@ -6,7 +6,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Collections.Generic; using System.Linq; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using WixToolset.Extensibility.Services; /// @@ -32,30 +32,30 @@ namespace WixToolset.Core.WindowsInstaller.Bind { var componentGuidConditions = new Dictionary(); - foreach (var componentTuple in this.Section.Tuples.OfType()) + foreach (var componentSymbol in this.Section.Symbols.OfType()) { // We don't care about unmanaged components and if there's a * GUID remaining, // there's already an error that prevented it from being replaced with a real GUID. - if (!String.IsNullOrEmpty(componentTuple.ComponentId) && "*" != componentTuple.ComponentId) + if (!String.IsNullOrEmpty(componentSymbol.ComponentId) && "*" != componentSymbol.ComponentId) { - var thisComponentHasCondition = !String.IsNullOrEmpty(componentTuple.Condition); + var thisComponentHasCondition = !String.IsNullOrEmpty(componentSymbol.Condition); var allComponentsHaveConditions = thisComponentHasCondition; - if (componentGuidConditions.TryGetValue(componentTuple.ComponentId, out var alreadyCheckedCondition)) + if (componentGuidConditions.TryGetValue(componentSymbol.ComponentId, out var alreadyCheckedCondition)) { allComponentsHaveConditions = thisComponentHasCondition && alreadyCheckedCondition; if (allComponentsHaveConditions) { - this.Messaging.Write(WarningMessages.DuplicateComponentGuidsMustHaveMutuallyExclusiveConditions(componentTuple.SourceLineNumbers, componentTuple.Id.Id, componentTuple.ComponentId)); + this.Messaging.Write(WarningMessages.DuplicateComponentGuidsMustHaveMutuallyExclusiveConditions(componentSymbol.SourceLineNumbers, componentSymbol.Id.Id, componentSymbol.ComponentId)); } else { - this.Messaging.Write(ErrorMessages.DuplicateComponentGuids(componentTuple.SourceLineNumbers, componentTuple.Id.Id, componentTuple.ComponentId)); + this.Messaging.Write(ErrorMessages.DuplicateComponentGuids(componentSymbol.SourceLineNumbers, componentSymbol.Id.Id, componentSymbol.ComponentId)); } } - componentGuidConditions[componentTuple.ComponentId] = allComponentsHaveConditions; + componentGuidConditions[componentSymbol.ComponentId] = allComponentsHaveConditions; } } } -- cgit v1.2.3-55-g6feb