private List <string> ResolveFilePathsToEmbed(IEnumerable <IntermediateSection> sections) { var embedFilePaths = new List <string>(); // Resolve paths to files that are to be embedded in the library. if (this.Context.BindFiles) { var variableResolver = new WixVariableResolver(this.Messaging); var fileResolver = new FileResolver(this.Context.BindPaths, this.Context.Extensions); foreach (var tuple in sections.SelectMany(s => s.Tuples)) { foreach (var field in tuple.Fields.Where(f => f?.Type == IntermediateFieldType.Path)) { var pathField = field.AsPath(); if (pathField != null) { var resolution = variableResolver.ResolveVariables(tuple.SourceLineNumbers, pathField.Path, false); var file = fileResolver.Resolve(tuple.SourceLineNumbers, tuple.Definition, resolution.Value); if (!String.IsNullOrEmpty(file)) { // File was successfully resolved so track the embedded index as the embedded file index. field.Set(new IntermediateFieldPathValue { EmbeddedFileIndex = embedFilePaths.Count }); embedFilePaths.Add(file); } else { this.Messaging.Write(ErrorMessages.FileNotFound(tuple.SourceLineNumbers, pathField.Path, tuple.Definition.Name)); } } } } } return(embedFilePaths); }