aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core
diff options
context:
space:
mode:
authorBob Arnson <bob@firegiant.com>2020-05-11 17:09:47 -0400
committerBob Arnson <bob@firegiant.com>2020-05-11 17:17:45 -0400
commitbac3d761d99fb7ae1012f3591baee2dbec115b28 (patch)
tree852f30be8ba4b0bc4a2cbd3dfd703149f4d00d3d /src/WixToolset.Core
parent93d3a9e1f9cdc05456a612e238a83738cfd1750f (diff)
downloadwix-bac3d761d99fb7ae1012f3591baee2dbec115b28.tar.gz
wix-bac3d761d99fb7ae1012f3591baee2dbec115b28.tar.bz2
wix-bac3d761d99fb7ae1012f3591baee2dbec115b28.zip
Fix named bind paths.
Diffstat (limited to 'src/WixToolset.Core')
-rw-r--r--src/WixToolset.Core/Bind/FileResolver.cs42
-rw-r--r--src/WixToolset.Core/CommandLine/CommandLine.cs2
2 files changed, 29 insertions, 15 deletions
diff --git a/src/WixToolset.Core/Bind/FileResolver.cs b/src/WixToolset.Core/Bind/FileResolver.cs
index b1676fad..6bc5a676 100644
--- a/src/WixToolset.Core/Bind/FileResolver.cs
+++ b/src/WixToolset.Core/Bind/FileResolver.cs
@@ -115,7 +115,7 @@ namespace WixToolset.Core.Bind
115 } 115 }
116 else // not a rooted path so let's try applying all the different source resolution options. 116 else // not a rooted path so let's try applying all the different source resolution options.
117 { 117 {
118 string bindName = String.Empty; 118 string bindName = null;
119 var path = source; 119 var path = source;
120 string pathWithoutSourceDir = null; 120 string pathWithoutSourceDir = null;
121 121
@@ -138,25 +138,41 @@ namespace WixToolset.Core.Bind
138 138
139 foreach (var bindPath in bindPaths) 139 foreach (var bindPath in bindPaths)
140 { 140 {
141 if (!String.IsNullOrEmpty(pathWithoutSourceDir)) 141 if (!String.IsNullOrEmpty(bindName) && !String.IsNullOrEmpty(bindPath.Name))
142 { 142 {
143 var filePath = Path.Combine(bindPath.Path, pathWithoutSourceDir); 143 if (String.Equals(bindName, bindPath.Name, StringComparison.OrdinalIgnoreCase) && String.IsNullOrEmpty(resolved))
144
145 checkedPaths.Add(filePath);
146 if (CheckFileExists(filePath))
147 { 144 {
148 resolved = filePath; 145 var filePath = Path.Combine(bindPath.Path, path);
146
147 checkedPaths.Add(filePath);
148 if (CheckFileExists(filePath))
149 {
150 resolved = filePath;
151 }
149 } 152 }
150 } 153 }
151 154 else
152 if (String.IsNullOrEmpty(resolved))
153 { 155 {
154 var filePath = Path.Combine(bindPath.Path, path); 156 if (!String.IsNullOrEmpty(pathWithoutSourceDir))
157 {
158 var filePath = Path.Combine(bindPath.Path, pathWithoutSourceDir);
155 159
156 checkedPaths.Add(filePath); 160 checkedPaths.Add(filePath);
157 if (CheckFileExists(filePath)) 161 if (CheckFileExists(filePath))
162 {
163 resolved = filePath;
164 }
165 }
166
167 if (String.IsNullOrEmpty(resolved))
158 { 168 {
159 resolved = filePath; 169 var filePath = Path.Combine(bindPath.Path, path);
170
171 checkedPaths.Add(filePath);
172 if (CheckFileExists(filePath))
173 {
174 resolved = filePath;
175 }
160 } 176 }
161 } 177 }
162 } 178 }
diff --git a/src/WixToolset.Core/CommandLine/CommandLine.cs b/src/WixToolset.Core/CommandLine/CommandLine.cs
index 683d1f5a..79f5d5bc 100644
--- a/src/WixToolset.Core/CommandLine/CommandLine.cs
+++ b/src/WixToolset.Core/CommandLine/CommandLine.cs
@@ -21,8 +21,6 @@ namespace WixToolset.Core.CommandLine
21 21
22 internal class CommandLine : ICommandLine 22 internal class CommandLine : ICommandLine
23 { 23 {
24 private static readonly char[] BindPathSplit = { '=' };
25
26 public CommandLine(IWixToolsetServiceProvider serviceProvider) 24 public CommandLine(IWixToolsetServiceProvider serviceProvider)
27 { 25 {
28 this.ServiceProvider = serviceProvider; 26 this.ServiceProvider = serviceProvider;