diff options
| author | Bob Arnson <bob@firegiant.com> | 2020-05-11 17:09:47 -0400 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2020-05-11 17:17:45 -0400 |
| commit | bac3d761d99fb7ae1012f3591baee2dbec115b28 (patch) | |
| tree | 852f30be8ba4b0bc4a2cbd3dfd703149f4d00d3d /src/WixToolset.Core/Bind/FileResolver.cs | |
| parent | 93d3a9e1f9cdc05456a612e238a83738cfd1750f (diff) | |
| download | wix-bac3d761d99fb7ae1012f3591baee2dbec115b28.tar.gz wix-bac3d761d99fb7ae1012f3591baee2dbec115b28.tar.bz2 wix-bac3d761d99fb7ae1012f3591baee2dbec115b28.zip | |
Fix named bind paths.
Diffstat (limited to 'src/WixToolset.Core/Bind/FileResolver.cs')
| -rw-r--r-- | src/WixToolset.Core/Bind/FileResolver.cs | 42 |
1 files changed, 29 insertions, 13 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 | } |
