@joebigelow / wix-1 / commits / d97ca048

Display errors for all missing files when building a bound wixlib

Rob Mensching committed Feb 14, 2023 at 16:24 UTC d97ca048b45077484d068580eb9ae0b231d77009
1 file changed +10 -5
src/wix/WixToolset.Core/Librarian.cs
+10 -5
@@ -65,6 +65,11 @@ namespace WixToolset.Core
65
66 trackedFiles = this.ResolveFilePathsToEmbed(context, sections);
67
68 + if (this.Messaging.EncounteredError)
69 + {
70 + return null;
71 + }
72 +
73 foreach (var section in sections)
74 {
75 section.AssignToLibrary(context.LibraryId);
@@ -116,18 +121,18 @@ namespace WixToolset.Core
121 {
122 var resolution = variableResolver.ResolveVariables(symbol.SourceLineNumbers, pathField.Path);
123
119 - var file = this.FileResolver.ResolveFile(resolution.Value, context.Extensions, bindPaths, symbol.SourceLineNumbers, symbol.Definition);
120 -
121 - if (!String.IsNullOrEmpty(file))
124 + try
125 {
126 + var file = this.FileResolver.ResolveFile(resolution.Value, context.Extensions, bindPaths, symbol.SourceLineNumbers, symbol.Definition);
127 +
128 // File was successfully resolved so track the embedded index as the embedded file index.
129 field.Set(new IntermediateFieldPathValue { Embed = true, Path = file });
130
131 trackedFiles.Add(this.LayoutServices.TrackFile(file, TrackedFileType.Input, symbol.SourceLineNumbers));
132 }
128 - else
133 + catch (WixException e)
134 {
130 - this.Messaging.Write(ErrorMessages.FileNotFound(symbol.SourceLineNumbers, pathField.Path, symbol.Definition.Name));
135 + this.Messaging.Write(e.Error);
136 }
137 }
138 }