From 7b583330fd42356930bdc5a28820e546f6ca45a4 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sun, 5 Jul 2020 23:08:20 -0700 Subject: Move short filename generation to the WindowsInstallerBackend --- .../Bind/CreateOutputFromIRCommand.cs | 143 ++++++++++++++++++++- src/WixToolset.Core/Common.cs | 2 +- src/WixToolset.Core/Compiler.cs | 124 ++++-------------- src/WixToolset.Core/CompilerCore.cs | 1 + src/WixToolset.Core/Compiler_2.cs | 46 +------ .../ExtensibilityServices/ParseHelper.cs | 14 +- 6 files changed, 171 insertions(+), 159 deletions(-) (limited to 'src') diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs index 5b838af8..663931b9 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs @@ -5,7 +5,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System; using System.Collections.Generic; using System.Globalization; + using System.IO; using System.Linq; + using System.Security.Cryptography; + using System.Text; using WixToolset.Data; using WixToolset.Data.Symbols; using WixToolset.Data.WindowsInstaller; @@ -97,6 +100,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind this.AddDirectorySymbol((DirectorySymbol)symbol); break; + case SymbolDefinitionType.DuplicateFile: + this.AddDuplicateFileSymbol((DuplicateFileSymbol)symbol); + break; + case SymbolDefinitionType.Environment: this.AddEnvironmentSymbol((EnvironmentSymbol)symbol); break; @@ -117,6 +124,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind this.AddIniFileSymbol((IniFileSymbol)symbol); break; + case SymbolDefinitionType.IniLocator: + this.AddIniLocatorSymbol((IniLocatorSymbol)symbol); + break; + case SymbolDefinitionType.Media: this.AddMediaSymbol((MediaSymbol)symbol); break; @@ -444,6 +455,16 @@ namespace WixToolset.Core.WindowsInstaller.Bind private void AddDirectorySymbol(DirectorySymbol symbol) { + if (String.IsNullOrEmpty(symbol.ShortName) && !symbol.Name.Equals(".") && !symbol.Name.Equals("SourceDir") && !Common.IsValidShortFilename(symbol.Name, false)) + { + symbol.ShortName = CreateShortName(symbol.Name, false, false, "Directory", symbol.ParentDirectoryRef); + } + + if (String.IsNullOrEmpty(symbol.SourceShortName) && !String.IsNullOrEmpty(symbol.SourceName) && !Common.IsValidShortFilename(symbol.SourceName, false)) + { + symbol.SourceShortName = CreateShortName(symbol.SourceName, false, false, "Directory", symbol.ParentDirectoryRef); + } + var sourceName = GetMsiFilenameValue(symbol.SourceShortName, symbol.SourceName); var targetName = GetMsiFilenameValue(symbol.ShortName, symbol.Name); @@ -460,6 +481,22 @@ namespace WixToolset.Core.WindowsInstaller.Bind row[2] = defaultDir; } + private void AddDuplicateFileSymbol(DuplicateFileSymbol symbol) + { + var name = symbol.DestinationName; + if (null == symbol.DestinationShortName && null != name && !Common.IsValidShortFilename(name, false)) + { + symbol.DestinationShortName = CreateShortName(name, true, false, "CopyFile", symbol.ComponentRef, symbol.FileRef); + } + + var row = this.CreateRow(symbol, "DuplicateFile"); + row[0] = symbol.Id.Id; + row[1] = symbol.ComponentRef; + row[2] = symbol.FileRef; + row[3] = GetMsiFilenameValue(symbol.DestinationShortName, symbol.DestinationName); + row[4] = symbol.DestinationFolder; + } + private void AddEnvironmentSymbol(EnvironmentSymbol symbol) { var action = String.Empty; @@ -525,10 +562,16 @@ namespace WixToolset.Core.WindowsInstaller.Bind private void AddFileSymbol(FileSymbol symbol) { + var name = symbol.Name; + if (null == symbol.ShortName && null != name && !Common.IsValidShortFilename(name, false)) + { + symbol.ShortName = CreateShortName(name, true, false, "File", symbol.DirectoryRef); + } + var row = (FileRow)this.CreateRow(symbol, "File"); row.File = symbol.Id.Id; row.Component = symbol.ComponentRef; - row.FileName = GetMsiFilenameValue(symbol.ShortName, symbol.Name); + row.FileName = GetMsiFilenameValue(symbol.ShortName, name); row.FileSize = symbol.FileSize; row.Version = symbol.Version; row.Language = symbol.Language; @@ -564,9 +607,15 @@ namespace WixToolset.Core.WindowsInstaller.Bind { var tableName = (InifFileActionType.AddLine == symbol.Action || InifFileActionType.AddTag == symbol.Action || InifFileActionType.CreateLine == symbol.Action) ? "IniFile" : "RemoveIniFile"; + var name = symbol.FileName; + if (null == symbol.ShortFileName && null != name && !Common.IsValidShortFilename(name, false)) + { + symbol.ShortFileName = CreateShortName(name, true, false, "IniFile", symbol.ComponentRef); + } + var row = this.CreateRow(symbol, tableName); row[0] = symbol.Id.Id; - row[1] = symbol.FileName; + row[1] = GetMsiFilenameValue(symbol.ShortFileName, name); row[2] = symbol.DirProperty; row[3] = symbol.Section; row[4] = symbol.Key; @@ -575,6 +624,23 @@ namespace WixToolset.Core.WindowsInstaller.Bind row[7] = symbol.ComponentRef; } + private void AddIniLocatorSymbol(IniLocatorSymbol symbol) + { + var name = symbol.FileName; + if (null == symbol.ShortFileName && null != name && !Common.IsValidShortFilename(name, false)) + { + symbol.ShortFileName = CreateShortName(name, true, false, "IniFileSearch"); + } + + var row = this.CreateRow(symbol, "IniLocator"); + row[0] = symbol.Id.Id; + row[1] = GetMsiFilenameValue(symbol.ShortFileName, name); + row[2] = symbol.Section; + row[3] = symbol.Key; + row[4] = symbol.Field; + row[5] = symbol.Type; + } + private void AddMediaSymbol(MediaSymbol symbol) { if (this.Section.Type != SectionType.Module) @@ -653,11 +719,17 @@ namespace WixToolset.Core.WindowsInstaller.Bind private void AddMoveFileSymbol(MoveFileSymbol symbol) { + var name = symbol.DestinationName; + if (null == symbol.DestinationShortName && null != name && !Common.IsValidShortFilename(name, false)) + { + symbol.DestinationShortName = CreateShortName(name, true, false, "MoveFile", symbol.ComponentRef); + } + var row = this.CreateRow(symbol, "MoveFile"); row[0] = symbol.Id.Id; row[1] = symbol.ComponentRef; row[2] = symbol.SourceName; - row[3] = symbol.DestName; + row[3] = GetMsiFilenameValue(symbol.DestinationShortName, symbol.DestinationName); row[4] = symbol.SourceFolder; row[5] = symbol.DestFolder; row[6] = symbol.Delete ? WindowsInstallerConstants.MsidbMoveFileOptionsMove : 0; @@ -677,14 +749,20 @@ namespace WixToolset.Core.WindowsInstaller.Bind private void AddRemoveFileSymbol(RemoveFileSymbol symbol) { + var name = symbol.FileName; + if (null == symbol.ShortFileName && null != name && !Common.IsValidShortFilename(name, false)) + { + symbol.ShortFileName = CreateShortName(name, true, false, "RemoveFile", symbol.ComponentRef); + } + 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[2] = GetMsiFilenameValue(symbol.ShortFileName, symbol.FileName); + row[3] = symbol.DirPropertyRef; row[4] = installMode; } @@ -821,10 +899,16 @@ namespace WixToolset.Core.WindowsInstaller.Bind private void AddShortcutSymbol(ShortcutSymbol symbol) { + var name = symbol.Name; + if (null == symbol.ShortName && null != name && !Common.IsValidShortFilename(name, false)) + { + symbol.ShortName = CreateShortName(name, true, false, "Shortcut", symbol.ComponentRef, symbol.DirectoryRef); + } + var row = this.CreateRow(symbol, "Shortcut"); row[0] = symbol.Id.Id; row[1] = symbol.DirectoryRef; - row[2] = GetMsiFilenameValue(symbol.ShortName, symbol.Name); + row[2] = GetMsiFilenameValue(symbol.ShortName, name); row[3] = symbol.ComponentRef; row[4] = symbol.Target; row[5] = symbol.Arguments; @@ -1117,5 +1201,52 @@ namespace WixToolset.Core.WindowsInstaller.Bind return shortName + "|" + longName; } } + + private static string CreateShortName(string longName, bool keepExtension, bool allowWildcards, params string[] args) + { + longName = longName.ToLowerInvariant(); + + // collect all the data + var strings = new List(1 + args.Length); + strings.Add(longName); + strings.AddRange(args); + + // prepare for hashing + var stringData = String.Join("|", strings); + var data = Encoding.UTF8.GetBytes(stringData); + + // hash the data + byte[] hash; + using (var sha1 = new SHA1CryptoServiceProvider()) + { + hash = sha1.ComputeHash(data); + } + + // generate the short file/directory name without an extension + var shortName = new StringBuilder(Convert.ToBase64String(hash)); + shortName.Length = 8; + shortName.Replace('+', '-').Replace('/', '_'); + + if (keepExtension) + { + var extension = Path.GetExtension(longName); + + if (4 < extension.Length) + { + extension = extension.Substring(0, 4); + } + + shortName.Append(extension); + + // check the generated short name to ensure its still legal (the extension may not be legal) + if (!Common.IsValidShortFilename(shortName.ToString(), allowWildcards)) + { + // remove the extension (by truncating the generated file name back to the generated characters) + shortName.Length -= extension.Length; + } + } + + return shortName.ToString().ToLowerInvariant(); + } } } diff --git a/src/WixToolset.Core/Common.cs b/src/WixToolset.Core/Common.cs index 183d7abd..a9fc9538 100644 --- a/src/WixToolset.Core/Common.cs +++ b/src/WixToolset.Core/Common.cs @@ -188,7 +188,7 @@ namespace WixToolset.Core /// Filename to verify. /// true if wildcards are allowed in the filename. /// True if the filename is a valid short filename - internal static bool IsValidShortFilename(string filename, bool allowWildcards) + public static bool IsValidShortFilename(string filename, bool allowWildcards) { if (String.IsNullOrEmpty(filename)) { diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs index 4d0e608b..b29821b0 100644 --- a/src/WixToolset.Core/Compiler.cs +++ b/src/WixToolset.Core/Compiler.cs @@ -299,24 +299,6 @@ namespace WixToolset.Core return s?.ToLowerInvariant(); } - /// - /// Given a possible short and long file name, create an msi filename value. - /// - /// The short file name. - /// Possibly the long file name. - /// The value in the msi filename data type. - private string GetMsiFilenameValue(string shortName, string longName) - { - if (null != shortName && null != longName && !String.Equals(shortName, longName, StringComparison.OrdinalIgnoreCase)) - { - return String.Concat(shortName, "|", longName); - } - else - { - return this.Core.IsValidShortFilename(longName, false) ? longName : shortName; - } - } - /// /// Adds a search property to the active section. /// @@ -3036,12 +3018,6 @@ namespace WixToolset.Core this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DestinationProperty", "DestinationDirectory")); } - // generate a short file name - if (null == destinationShortName && (null != destinationName && !this.Core.IsValidShortFilename(destinationName, false))) - { - destinationShortName = this.Core.CreateShortName(destinationName, true, false, node.Name.LocalName, componentId); - } - if (null == id) { id = this.Core.CreateIdentifier("cf", sourceFolder, sourceDirectory, sourceProperty, destinationDirectory, destinationProperty, destinationName); @@ -3063,7 +3039,8 @@ namespace WixToolset.Core { ComponentRef = componentId, SourceName = sourceName, - DestName= String.IsNullOrEmpty(destinationShortName) && String.IsNullOrEmpty(destinationName) ? null : this.GetMsiFilenameValue(destinationShortName, destinationName), + DestinationName = destinationName, + DestinationShortName = destinationShortName, SourceFolder = sourceDirectory ?? sourceProperty, DestFolder = destinationDirectory ?? destinationProperty, Delete = delete, @@ -3108,7 +3085,8 @@ namespace WixToolset.Core { ComponentRef = componentId, FileRef = fileId, - DestinationName = String.IsNullOrEmpty(destinationShortName) && String.IsNullOrEmpty(destinationName) ? null : this.GetMsiFilenameValue(destinationShortName, destinationName), + DestinationName = destinationName, + DestinationShortName = destinationShortName, DestinationFolder = destinationDirectory ?? destinationProperty, }); } @@ -4184,16 +4162,12 @@ namespace WixToolset.Core { if (String.IsNullOrEmpty(shortName)) { - if (!name.Equals(".") && !name.Equals("SourceDir") && !this.Core.IsValidShortFilename(name, false)) - { - shortName = this.Core.CreateShortName(name, false, false, "Directory", parentId); - } } - else if (name.Equals(".")) + else if (name == ".") { this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "ShortName", "Name", name)); } - else if (name.Equals(shortName)) + else if (name.Equals(shortName, StringComparison.OrdinalIgnoreCase)) { this.Core.Write(WarningMessages.DirectoryRedundantNames(sourceLineNumbers, node.Name.LocalName, "Name", "ShortName", name)); } @@ -4210,16 +4184,12 @@ namespace WixToolset.Core { if (String.IsNullOrEmpty(shortSourceName)) { - if (!sourceName.Equals(".") && !this.Core.IsValidShortFilename(sourceName, false)) - { - shortSourceName = this.Core.CreateShortName(sourceName, false, false, "Directory", parentId); - } } - else if (sourceName.Equals(".")) + else if (sourceName == ".") { this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "ShortSourceName", "SourceName", sourceName)); } - else if (sourceName.Equals(shortSourceName)) + else if (sourceName.Equals(shortSourceName, StringComparison.OrdinalIgnoreCase)) { this.Core.Write(WarningMessages.DirectoryRedundantNames(sourceLineNumbers, node.Name.LocalName, "SourceName", "ShortSourceName", sourceName)); } @@ -5463,7 +5433,6 @@ namespace WixToolset.Core var defaultSize = 0; string defaultVersion = null; string fontTitle = null; - var generatedShortFileName = false; var keyPath = YesNoType.NotSet; string name = null; var patchGroup = CompilerConstants.IntegerNotSet; @@ -5686,16 +5655,22 @@ namespace WixToolset.Core } } - // generate a short file name - if (null == shortName && (null != name && !this.Core.IsValidShortFilename(name, false))) + if (name == null) { - shortName = this.Core.CreateShortName(name, true, false, node.Name.LocalName, directoryId); - generatedShortFileName = true; + if (shortName == null) + { + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + } + else + { + name = shortName; + shortName = null; + } } if (null == id) { - id = this.Core.CreateIdentifier("fil", directoryId, name ?? shortName); + id = this.Core.CreateIdentifier("fil", directoryId, name); } if (null != defaultVersion && null != companionFile) @@ -5811,11 +5786,11 @@ namespace WixToolset.Core if (String.IsNullOrEmpty(source)) { - source = name ?? shortName; + source = name; } else if (source.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) // if source relies on parent directories, append the file name { - source = null == name ? Path.Combine(source, shortName) : Path.Combine(source, name); + source = Path.Combine(source, name); } var attributes = FileSymbolAttributes.None; @@ -5826,7 +5801,6 @@ namespace WixToolset.Core attributes |= checksum ? FileSymbolAttributes.Checksum : 0; attributes |= compressed.HasValue && compressed == true ? FileSymbolAttributes.Compressed : 0; attributes |= compressed.HasValue && compressed == false ? FileSymbolAttributes.Uncompressed : 0; - attributes |= generatedShortFileName ? FileSymbolAttributes.GeneratedShortFileName : 0; this.Core.AddSymbol(new FileSymbol(sourceLineNumbers, id) { @@ -5838,14 +5812,6 @@ namespace WixToolset.Core Language = defaultLanguage, Attributes = attributes, - //ReadOnly = readOnly, - //Hidden = hidden, - //System = system, - //Vital = vital, - //Checksum = checksum, - //Compressed = compressed, - //GeneratedShortFileName = generatedShortFileName, - DirectoryRef = directoryId, DiskId = (CompilerConstants.IntegerNotSet == diskId) ? null : (int?)diskId, Source = new IntermediateFieldPathValue { Path = source }, @@ -6454,28 +6420,6 @@ namespace WixToolset.Core { this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } - else if (0 < name.Length) - { - if (this.Core.IsValidShortFilename(name, false)) - { - if (null == shortName) - { - shortName = name; - name = null; - } - else - { - this.Core.Write(ErrorMessages.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Name", name, "ShortName")); - } - } - else // generate a short file name. - { - if (null == shortName) - { - shortName = this.Core.CreateShortName(name, true, false, node.Name.LocalName, componentId); - } - } - } if (null == section) { @@ -6493,7 +6437,8 @@ namespace WixToolset.Core { this.Core.AddSymbol(new IniFileSymbol(sourceLineNumbers, id) { - FileName = this.GetMsiFilenameValue(shortName, name), + FileName = name, + ShortFileName = shortName, DirProperty = directory, Section = section, Key = key, @@ -6585,25 +6530,6 @@ namespace WixToolset.Core { this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } - else if (0 < name.Length) - { - if (this.Core.IsValidShortFilename(name, false)) - { - if (null == shortName) - { - shortName = name; - name = null; - } - else - { - this.Core.Write(ErrorMessages.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Name", name, "ShortName")); - } - } - else if (null == shortName) // generate a short file name. - { - shortName = this.Core.CreateShortName(name, true, false, node.Name.LocalName); - } - } if (null == section) { @@ -6677,8 +6603,8 @@ namespace WixToolset.Core { var symbol = this.Core.AddSymbol(new IniLocatorSymbol(sourceLineNumbers, id) { - SignatureRef = id.Id, - FileName = this.GetMsiFilenameValue(shortName, name), + FileName = name, + ShortFileName = shortName, Section = section, Key = key, Type = type diff --git a/src/WixToolset.Core/CompilerCore.cs b/src/WixToolset.Core/CompilerCore.cs index 7ec83a7d..c2724f6b 100644 --- a/src/WixToolset.Core/CompilerCore.cs +++ b/src/WixToolset.Core/CompilerCore.cs @@ -286,6 +286,7 @@ namespace WixToolset.Core /// true if wildcards are allowed in the filename. /// Any additional information to include in the hash for the generated short name. /// The generated 8.3-compliant short file/directory name. + [Obsolete] public string CreateShortName(string longName, bool keepExtension, bool allowWildcards, params string[] args) { return this.parseHelper.CreateShortName(longName, keepExtension, allowWildcards, args); diff --git a/src/WixToolset.Core/Compiler_2.cs b/src/WixToolset.Core/Compiler_2.cs index 72550ed9..7e2485e1 100644 --- a/src/WixToolset.Core/Compiler_2.cs +++ b/src/WixToolset.Core/Compiler_2.cs @@ -2309,25 +2309,6 @@ namespace WixToolset.Core { this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } - else if (0 < name.Length) - { - if (this.Core.IsValidShortFilename(name, true)) - { - if (null == shortName) - { - shortName = name; - name = null; - } - else - { - this.Core.Write(ErrorMessages.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Name", name, "ShortName")); - } - } - else if (null == shortName) // generate a short file name. - { - shortName = this.Core.CreateShortName(name, true, true, node.Name.LocalName, componentId); - } - } if (!onInstall.HasValue && !onUninstall.HasValue) { @@ -2352,8 +2333,9 @@ namespace WixToolset.Core this.Core.AddSymbol(new RemoveFileSymbol(sourceLineNumbers, id) { ComponentRef = componentId, - FileName = this.GetMsiFilenameValue(shortName, name), - DirProperty = directory ?? property ?? parentDirectory, + FileName = name, + ShortFileName = shortName, + DirPropertyRef = directory ?? property ?? parentDirectory, OnInstall = onInstall, OnUninstall = onUninstall, }); @@ -2440,7 +2422,7 @@ namespace WixToolset.Core this.Core.AddSymbol(new RemoveFileSymbol(sourceLineNumbers, id) { ComponentRef = componentId, - DirProperty = directory ?? property ?? parentDirectory, + DirPropertyRef = directory ?? property ?? parentDirectory, OnInstall = onInstall, OnUninstall = onUninstall }); @@ -4293,24 +4275,6 @@ namespace WixToolset.Core { this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } - else if (0 < name.Length) - { - if (this.Core.IsValidShortFilename(name, false)) - { - if (null == shortName) - { - shortName = name; - } - else - { - this.Core.Write(ErrorMessages.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Name", name, "ShortName")); - } - } - else if (null == shortName) // generate a short file name. - { - shortName = this.Core.CreateShortName(name, true, false, node.Name.LocalName, componentId, directory); - } - } if ("Component" != parentElementLocalName && null != target) { @@ -4319,7 +4283,7 @@ namespace WixToolset.Core if (null == id) { - id = this.Core.CreateIdentifier("sct", directory, LowercaseOrNull(name) ?? LowercaseOrNull(shortName)); + id = this.Core.CreateIdentifier("sct", directory, LowercaseOrNull(name)); } foreach (var child in node.Elements()) diff --git a/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs b/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs index 7160c32e..db465354 100644 --- a/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs +++ b/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs @@ -75,16 +75,6 @@ namespace WixToolset.Core.ExtensibilityServices public Identifier CreateDirectorySymbol(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string parentId, string name, ISet sectionInlinedDirectoryIds, string shortName = null, string sourceName = null, string shortSourceName = null) { - if (String.IsNullOrEmpty(shortName) && !name.Equals("SourceDir") && !this.IsValidShortFilename(name)) - { - shortName = this.CreateShortName(name, false, false, "Directory", parentId); - } - - if (String.IsNullOrEmpty(shortSourceName) && !String.IsNullOrEmpty(sourceName) && !this.IsValidShortFilename(sourceName)) - { - shortSourceName = this.CreateShortName(sourceName, false, false, "Directory", parentId); - } - // For anonymous directories, create the identifier. If this identifier already exists in the // active section, bail so we don't add duplicate anonymous directory symbols (which are legal // but bloat the intermediate and ultimately make the linker do "busy work"). @@ -243,7 +233,7 @@ namespace WixToolset.Core.ExtensibilityServices if (null == childId) { - throw new ArgumentNullException("childId"); + throw new ArgumentNullException(nameof(childId)); } section.AddSymbol(new WixGroupSymbol(sourceLineNumbers) @@ -419,7 +409,7 @@ namespace WixToolset.Core.ExtensibilityServices { if (null == attribute) { - throw new ArgumentNullException("attribute"); + throw new ArgumentNullException(nameof(attribute)); } var emptyRule = canBeEmpty ? EmptyRule.CanBeEmpty : EmptyRule.CanBeWhitespaceOnly; -- cgit v1.2.3-55-g6feb