From d97ca048b45077484d068580eb9ae0b231d77009 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 14 Feb 2023 16:24:43 -0800 Subject: Display errors for all missing files when building a bound wixlib --- src/wix/WixToolset.Core/Librarian.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/wix/WixToolset.Core/Librarian.cs b/src/wix/WixToolset.Core/Librarian.cs index 1f366d55..f6357c6c 100644 --- a/src/wix/WixToolset.Core/Librarian.cs +++ b/src/wix/WixToolset.Core/Librarian.cs @@ -65,6 +65,11 @@ namespace WixToolset.Core trackedFiles = this.ResolveFilePathsToEmbed(context, sections); + if (this.Messaging.EncounteredError) + { + return null; + } + foreach (var section in sections) { section.AssignToLibrary(context.LibraryId); @@ -116,18 +121,18 @@ namespace WixToolset.Core { var resolution = variableResolver.ResolveVariables(symbol.SourceLineNumbers, pathField.Path); - var file = this.FileResolver.ResolveFile(resolution.Value, context.Extensions, bindPaths, symbol.SourceLineNumbers, symbol.Definition); - - if (!String.IsNullOrEmpty(file)) + try { + var file = this.FileResolver.ResolveFile(resolution.Value, context.Extensions, bindPaths, symbol.SourceLineNumbers, symbol.Definition); + // File was successfully resolved so track the embedded index as the embedded file index. field.Set(new IntermediateFieldPathValue { Embed = true, Path = file }); trackedFiles.Add(this.LayoutServices.TrackFile(file, TrackedFileType.Input, symbol.SourceLineNumbers)); } - else + catch (WixException e) { - this.Messaging.Write(ErrorMessages.FileNotFound(symbol.SourceLineNumbers, pathField.Path, symbol.Definition.Name)); + this.Messaging.Write(e.Error); } } } -- cgit v1.2.3-55-g6feb