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/CalculateComponentGuids.cs | 52 +++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs') 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); } } } -- cgit v1.2.3-55-g6feb