From 3859a8cd7d6001f7b49c22065e33242ddb486fbb Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 22 May 2019 14:48:20 -0700 Subject: Adopt "Ref" as reference convention over "_" --- .../Bind/CabinetBuilder.cs | 2 - .../Bind/CalculateComponentGuids.cs | 12 +++--- .../Bind/CreateOutputFromIRCommand.cs | 46 +++++++++++----------- .../Bind/CreateSpecialPropertiesCommand.cs | 6 +-- .../Bind/ExtractMergeModuleFilesCommand.cs | 2 +- .../Bind/GetFileFacadesCommand.cs | 4 +- .../Bind/UpdateFileFacadesCommand.cs | 26 ++++++------ .../Bind/UpdateMediaSequencesCommand.cs | 2 +- 8 files changed, 49 insertions(+), 51 deletions(-) (limited to 'src/WixToolset.Core.WindowsInstaller') diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CabinetBuilder.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CabinetBuilder.cs index 3725b480..24011214 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CabinetBuilder.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CabinetBuilder.cs @@ -163,8 +163,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind // create the cabinet file var cabinetPath = Path.GetFullPath(cabinetWorkItem.CabinetFile); - string cabinetFileName = Path.GetFileName(cabinetWorkItem.CabinetFile); - string cabinetDirectory = Path.GetDirectoryName(cabinetWorkItem.CabinetFile); var files = cabinetWorkItem.FileFacades .Select(facade => facade.Hash == null ? diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs index 414984de..f66ff375 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs @@ -87,7 +87,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } var targetName = Common.GetName(row.DefaultDir, false, true); - targetPathsByDirectoryId.Add(row.Id.Id, new ResolvedDirectory(row.Directory_Parent, targetName)); + targetPathsByDirectoryId.Add(row.Id.Id, new ResolvedDirectory(row.ParentDirectoryRef, targetName)); } } @@ -112,10 +112,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind foreach (var file in files) { - if (!filesByComponentId.TryGetValue(file.Component_, out var componentFiles)) + if (!filesByComponentId.TryGetValue(file.ComponentRef, out var componentFiles)) { componentFiles = new List(); - filesByComponentId.Add(file.Component_, componentFiles); + filesByComponentId.Add(file.ComponentRef, componentFiles); } componentFiles.Add(file); @@ -132,8 +132,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (fileRow.Id.Id == componentTuple.KeyPath) { // calculate the key file's canonical target path - string directoryPath = PathResolver.GetDirectoryPath(targetPathsByDirectoryId, componentIdGenSeeds, componentTuple.Directory_, true); - string fileName = Common.GetName(fileRow.LongFileName, false, true).ToLowerInvariant(); + string directoryPath = PathResolver.GetDirectoryPath(targetPathsByDirectoryId, componentIdGenSeeds, componentTuple.DirectoryRef, true); + string fileName = Common.GetName(fileRow.Name, false, true).ToLowerInvariant(); path = Path.Combine(directoryPath, fileName); // find paths that are not canonicalized @@ -144,7 +144,7 @@ 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.Component_, path)); + this.Messaging.Write(ErrorMessages.IllegalPathForGeneratedComponentGuid(componentTuple.SourceLineNumbers, fileRow.ComponentRef, path)); } // if component has more than one file, the key path must be versioned diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs index 3d9fcf48..65958d0a 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs @@ -196,7 +196,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind var table = output.EnsureTable(this.TableDefinitions["BBControl"]); var row = table.CreateRow(tuple.SourceLineNumbers); - row[0] = tuple.Billboard_; + row[0] = tuple.BillboardRef; row[1] = tuple.BBControl; row[2] = tuple.Type; row[3] = tuple.X; @@ -234,7 +234,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind var table = output.EnsureTable(this.TableDefinitions["Control"]); var row = table.CreateRow(tuple.SourceLineNumbers); - row[0] = tuple.Dialog_; + row[0] = tuple.DialogRef; row[1] = tuple.Control; row[2] = tuple.Type; row[3] = tuple.X; @@ -243,7 +243,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind row[6] = tuple.Height; row[7] = attributes; row[8] = text; - row[9] = tuple.Control_Next; + row[9] = tuple.NextControlRef; row[10] = tuple.Help; } @@ -266,7 +266,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind var row = table.CreateRow(tuple.SourceLineNumbers); row[0] = tuple.Id.Id; row[1] = tuple.ComponentId; - row[2] = tuple.Directory_; + row[2] = tuple.DirectoryRef; row[3] = attributes; row[4] = tuple.Condition; row[5] = tuple.KeyPath; @@ -331,9 +331,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind row[4] = tuple.Height; row[5] = attributes; row[6] = tuple.Title; - row[7] = tuple.Control_First; - row[8] = tuple.Control_Default; - row[9] = tuple.Control_Cancel; + row[7] = tuple.FirstControlRef; + row[8] = tuple.DefaultControlRef; + row[9] = tuple.CancelControlRef; } private void AddDirectoryTuple(DirectoryTuple tuple, Output output) @@ -341,7 +341,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind var table = output.EnsureTable(this.TableDefinitions["Directory"]); var row = table.CreateRow(tuple.SourceLineNumbers); row[0] = tuple.Id.Id; - row[1] = tuple.Directory_Parent; + row[1] = tuple.ParentDirectoryRef; row[2] = tuple.DefaultDir; } @@ -380,7 +380,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind row[0] = tuple.Id.Id; row[1] = String.Concat(action, uninstall, system, tuple.Name); row[2] = value; - row[3] = tuple.Component_; + row[3] = tuple.ComponentRef; } private void AddFeatureTuple(FeatureTuple tuple, Output output) @@ -394,12 +394,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind var table = output.EnsureTable(this.TableDefinitions["Feature"]); var row = table.CreateRow(tuple.SourceLineNumbers); row[0] = tuple.Id.Id; - row[1] = tuple.Feature_Parent; + row[1] = tuple.ParentFeatureRef; row[2] = tuple.Title; row[3] = tuple.Description; row[4] = tuple.Display; row[5] = tuple.Level; - row[6] = tuple.Directory_; + row[6] = tuple.DirectoryRef; row[7] = attributes; } @@ -408,8 +408,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind var table = output.EnsureTable(this.TableDefinitions["File"]); var row = (FileRow)table.CreateRow(tuple.SourceLineNumbers); row.File = tuple.Id.Id; - row.Component = tuple.Component_; - row.FileName = GetMsiFilenameValue(tuple.ShortFileName, tuple.LongFileName); + row.Component = tuple.ComponentRef; + row.FileName = GetMsiFilenameValue(tuple.ShortName, tuple.Name); row.FileSize = tuple.FileSize; row.Version = tuple.Version; row.Language = tuple.Language; @@ -437,7 +437,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind row[4] = tuple.Key; row[5] = tuple.Value; row[6] = tuple.Action; - row[7] = tuple.Component_; + row[7] = tuple.ComponentRef; } private void AddMediaTuple(MediaTuple tuple, Output output) @@ -499,7 +499,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind row[2] = events; row[3] = tuple.ConfigType; row[4] = tuple.Argument; - row[5] = tuple.Component_; + row[5] = tuple.ComponentRef; } private void AddMsiServiceConfigFailureActionsTuple(MsiServiceConfigFailureActionsTuple tuple, Output output) @@ -518,7 +518,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind row[5] = tuple.Command ?? "[~]"; row[6] = tuple.Actions; row[7] = tuple.DelayActions; - row[8] = tuple.Component_; + row[8] = tuple.ComponentRef; } private void AddMoveFileTuple(MoveFileTuple tuple, Output output) @@ -526,7 +526,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind var table = output.EnsureTable(this.TableDefinitions["MoveFile"]); var row = table.CreateRow(tuple.SourceLineNumbers); row[0] = tuple.Id.Id; - row[1] = tuple.Component_; + row[1] = tuple.ComponentRef; row[2] = tuple.SourceName; row[3] = tuple.DestName; row[4] = tuple.SourceFolder; @@ -555,7 +555,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind var table = output.EnsureTable(this.TableDefinitions["RemoveFile"]); var row = table.CreateRow(tuple.SourceLineNumbers); row[0] = tuple.Id.Id; - row[1] = tuple.Component_; + row[1] = tuple.ComponentRef; row[2] = tuple.FileName; row[3] = tuple.DirProperty; row[4] = installMode; @@ -610,7 +610,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind row[2] = tuple.Key; row[3] = tuple.Name; row[4] = value; - row[5] = tuple.Component_; + row[5] = tuple.ComponentRef; } private void AddRegLocatorTuple(RegLocatorTuple tuple, Output output) @@ -637,7 +637,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind row[1] = tuple.Root; row[2] = tuple.Key; row[3] = tuple.Name; - row[4] = tuple.Component_; + row[4] = tuple.ComponentRef; } else // Registry table is used to remove registry keys on uninstall. { @@ -647,7 +647,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind row[1] = tuple.Root; row[2] = tuple.Key; row[3] = tuple.Name; - row[5] = tuple.Component_; + row[5] = tuple.ComponentRef; } } @@ -667,7 +667,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind row[2] = events; row[3] = tuple.Arguments; row[4] = tuple.Wait; - row[5] = tuple.Component_; + row[5] = tuple.ComponentRef; } private void AddServiceInstallTuple(ServiceInstallTuple tuple, Output output) @@ -691,7 +691,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind row[8] = tuple.StartName; row[9] = tuple.Password; row[10] = tuple.Arguments; - row[11] = tuple.Component_; + row[11] = tuple.ComponentRef; row[12] = tuple.Description; } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateSpecialPropertiesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateSpecialPropertiesCommand.cs index b5e5069a..e6c089a1 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateSpecialPropertiesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateSpecialPropertiesCommand.cs @@ -28,17 +28,17 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (wixPropertyRow.Admin) { - adminProperties.Add(wixPropertyRow.Property_); + adminProperties.Add(wixPropertyRow.PropertyRef); } if (wixPropertyRow.Hidden) { - hiddenProperties.Add(wixPropertyRow.Property_); + hiddenProperties.Add(wixPropertyRow.PropertyRef); } if (wixPropertyRow.Secure) { - secureProperties.Add(wixPropertyRow.Property_); + secureProperties.Add(wixPropertyRow.PropertyRef); } } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs index 85567471..f1a6653c 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs @@ -105,7 +105,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind fileRow.Compressed = wixMergeRow.FileCompression; var wixFileRow = new WixFileTuple(wixMergeRow.SourceLineNumbers); - wixFileRow.Directory_ = record[2]; + wixFileRow.DirectoryRef = record[2]; wixFileRow.DiskId = wixMergeRow.DiskId; wixFileRow.PatchGroup = -1; wixFileRow.Source = new IntermediateFieldPathValue { Path = Path.Combine(this.IntermediateFolder, wixMergeRow.Id.Id, record[1]) }; diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/GetFileFacadesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/GetFileFacadesCommand.cs index 3b7627c8..db85a6fa 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/GetFileFacadesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/GetFileFacadesCommand.cs @@ -62,7 +62,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind case SymbolPathType.Component: if (null == filesByComponent) { - filesByComponent = facades.ToLookup(f => f.File.Component_); + filesByComponent = facades.ToLookup(f => f.File.ComponentRef); } foreach (var facade in filesByComponent[row.SymbolId]) @@ -74,7 +74,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind case SymbolPathType.Directory: if (null == filesByDirectory) { - filesByDirectory = facades.ToLookup(f => f.WixFile.Directory_); + filesByDirectory = facades.ToLookup(f => f.WixFile.DirectoryRef); } foreach (var facade in filesByDirectory[row.SymbolId]) diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs index c8451a1e..0d15bf2e 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs @@ -53,7 +53,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind var assemblyNameTuples = new Dictionary(); foreach (var assemblyTuple in this.Section.Tuples.OfType()) { - assemblyNameTuples.Add(assemblyTuple.Component_ + "/" + assemblyTuple.Name, assemblyTuple); + assemblyNameTuples.Add(assemblyTuple.ComponentRef + "/" + assemblyTuple.Name, assemblyTuple); } FileInfo fileInfo = null; @@ -79,7 +79,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (!fileInfo.Exists) { - this.Messaging.Write(ErrorMessages.CannotFindFile(file.File.SourceLineNumbers, file.File.Id.Id, file.File.LongFileName, file.WixFile.Source.Path)); + this.Messaging.Write(ErrorMessages.CannotFindFile(file.File.SourceLineNumbers, file.File.Id.Id, file.File.Name, file.WixFile.Source.Path)); return; } @@ -162,7 +162,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind this.Section.Tuples.Add(file.Hash); } - file.Hash.File_ = file.File.Id.Id; + file.Hash.FileRef = file.File.Id.Id; file.Hash.Options = 0; file.Hash.HashPart1 = hash[0]; file.Hash.HashPart2 = hash[1]; @@ -243,9 +243,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind { this.SetMsiAssemblyName(assemblyNameTuples, file, "publicKeyToken", assemblyName.PublicKeyToken); } - else if (file.WixFile.File_AssemblyApplication == null) + else if (file.WixFile.AssemblyApplicationFileRef == null) { - throw new WixException(ErrorMessages.GacAssemblyNoStrongName(file.File.SourceLineNumbers, fileInfo.FullName, file.File.Component_)); + throw new WixException(ErrorMessages.GacAssemblyNoStrongName(file.File.SourceLineNumbers, fileInfo.FullName, file.File.ComponentRef)); } if (!String.IsNullOrEmpty(assemblyName.FileVersion)) @@ -269,10 +269,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind // TODO: Consider passing in the this.FileFacades as an indexed collection instead of searching through // all files like this. Even though this is a rare case it looks like we might be able to index the // file earlier. - var fileManifest = this.FileFacades.FirstOrDefault(r => r.File.Id.Id.Equals(file.WixFile.File_AssemblyManifest, StringComparison.Ordinal)); + var fileManifest = this.FileFacades.FirstOrDefault(r => r.File.Id.Id.Equals(file.WixFile.AssemblyManifestFileRef, StringComparison.Ordinal)); if (null == fileManifest) { - this.Messaging.Write(ErrorMessages.MissingManifestForWin32Assembly(file.File.SourceLineNumbers, file.File.Id.Id, file.WixFile.File_AssemblyManifest)); + this.Messaging.Write(ErrorMessages.MissingManifestForWin32Assembly(file.File.SourceLineNumbers, file.File.Id.Id, file.WixFile.AssemblyManifestFileRef)); } try @@ -324,24 +324,24 @@ namespace WixToolset.Core.WindowsInstaller.Bind // check for null value (this can occur when grabbing the file version from an assembly without one) if (String.IsNullOrEmpty(value)) { - this.Messaging.Write(WarningMessages.NullMsiAssemblyNameValue(file.File.SourceLineNumbers, file.File.Component_, name)); + this.Messaging.Write(WarningMessages.NullMsiAssemblyNameValue(file.File.SourceLineNumbers, file.File.ComponentRef, name)); } else { // if the assembly will be GAC'd and the name in the file table doesn't match the name in the MsiAssemblyName table, error because the install will fail. if ("name" == name && FileAssemblyType.DotNetAssembly == file.WixFile.AssemblyType && - String.IsNullOrEmpty(file.WixFile.File_AssemblyApplication) && - !String.Equals(Path.GetFileNameWithoutExtension(file.File.LongFileName), value, StringComparison.OrdinalIgnoreCase)) + String.IsNullOrEmpty(file.WixFile.AssemblyApplicationFileRef) && + !String.Equals(Path.GetFileNameWithoutExtension(file.File.Name), value, StringComparison.OrdinalIgnoreCase)) { - this.Messaging.Write(ErrorMessages.GACAssemblyIdentityWarning(file.File.SourceLineNumbers, Path.GetFileNameWithoutExtension(file.File.LongFileName), value)); + this.Messaging.Write(ErrorMessages.GACAssemblyIdentityWarning(file.File.SourceLineNumbers, Path.GetFileNameWithoutExtension(file.File.Name), value)); } // override directly authored value - var lookup = String.Concat(file.File.Component_, "/", name); + var lookup = String.Concat(file.File.ComponentRef, "/", name); if (!assemblyNameTuples.TryGetValue(lookup, out var assemblyNameRow)) { assemblyNameRow = new MsiAssemblyNameTuple(file.File.SourceLineNumbers); - assemblyNameRow.Component_ = file.File.Component_; + assemblyNameRow.ComponentRef = file.File.ComponentRef; assemblyNameRow.Name = name; assemblyNameRow.Value = value; diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateMediaSequencesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateMediaSequencesCommand.cs index e6738bb7..f9df9636 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateMediaSequencesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateMediaSequencesCommand.cs @@ -119,7 +119,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // TODO: Sort these facades even smarter by directory path and component id // and maybe file size or file extension and other creative ideas to // get optimal install speed out of MSI. - return this.FileFacades.OrderBy(f => f.File.Component_); + return this.FileFacades.OrderBy(f => f.File.ComponentRef); } } } -- cgit v1.2.3-55-g6feb