aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2019-05-22 16:28:02 -0700
committerRob Mensching <rob@firegiant.com>2019-05-23 16:02:37 -0700
commit3051bf2fc300df125115c9538a0bfc8256bfde6a (patch)
tree65aa2e091a6a5fa983314ab9cb55a72ba16faf02 /src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs
parent3859a8cd7d6001f7b49c22065e33242ddb486fbb (diff)
downloadwix-3051bf2fc300df125115c9538a0bfc8256bfde6a.tar.gz
wix-3051bf2fc300df125115c9538a0bfc8256bfde6a.tar.bz2
wix-3051bf2fc300df125115c9538a0bfc8256bfde6a.zip
Integrate short and source name changes to Directory and Shortcut tuples
Diffstat (limited to 'src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs')
-rw-r--r--src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs36
1 files changed, 8 insertions, 28 deletions
diff --git a/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs b/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs
index 0e80100b..3318b914 100644
--- a/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs
+++ b/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs
@@ -77,37 +77,14 @@ namespace WixToolset.Core.ExtensibilityServices
77 77
78 public Identifier CreateDirectoryTuple(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string parentId, string name, ISet<string> sectionInlinedDirectoryIds, string shortName = null, string sourceName = null, string shortSourceName = null) 78 public Identifier CreateDirectoryTuple(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string parentId, string name, ISet<string> sectionInlinedDirectoryIds, string shortName = null, string sourceName = null, string shortSourceName = null)
79 { 79 {
80 string defaultDir; 80 if (String.IsNullOrEmpty(shortName) && !name.Equals("SourceDir") && !this.IsValidShortFilename(name))
81
82 if (name.Equals("SourceDir") || this.IsValidShortFilename(name, false))
83 {
84 defaultDir = name;
85 }
86 else
87 { 81 {
88 if (String.IsNullOrEmpty(shortName)) 82 shortName = this.CreateShortName(name, false, false, "Directory", parentId);
89 {
90 shortName = this.CreateShortName(name, false, false, "Directory", parentId);
91 }
92
93 defaultDir = String.Concat(shortName, "|", name);
94 } 83 }
95 84
96 if (!String.IsNullOrEmpty(sourceName)) 85 if (String.IsNullOrEmpty(shortSourceName) && !String.IsNullOrEmpty(sourceName) && !this.IsValidShortFilename(sourceName))
97 { 86 {
98 if (this.IsValidShortFilename(sourceName, false)) 87 shortSourceName = this.CreateShortName(sourceName, false, false, "Directory", parentId);
99 {
100 defaultDir = String.Concat(defaultDir, ":", sourceName);
101 }
102 else
103 {
104 if (String.IsNullOrEmpty(shortSourceName))
105 {
106 shortSourceName = this.CreateShortName(sourceName, false, false, "Directory", parentId);
107 }
108
109 defaultDir = String.Concat(defaultDir, ":", shortSourceName, "|", sourceName);
110 }
111 } 88 }
112 89
113 // For anonymous directories, create the identifier. If this identifier already exists in the 90 // For anonymous directories, create the identifier. If this identifier already exists in the
@@ -126,7 +103,10 @@ namespace WixToolset.Core.ExtensibilityServices
126 var tuple = new DirectoryTuple(sourceLineNumbers, id) 103 var tuple = new DirectoryTuple(sourceLineNumbers, id)
127 { 104 {
128 ParentDirectoryRef = parentId, 105 ParentDirectoryRef = parentId,
129 DefaultDir = defaultDir, 106 Name = name,
107 ShortName = shortName,
108 SourceName = sourceName,
109 SourceShortName = shortSourceName
130 }; 110 };
131 111
132 section.Tuples.Add(tuple); 112 section.Tuples.Add(tuple);