Return object fields exported from unbinding in the decompile results.
Bob Arnson committed
Dec 5, 2018 at 19:12 UTC
3b3854e3cb7c171cd356497531a040596af5d214
2 files changed
+13
-1
src/WixToolset.Core.WindowsInstaller/Decompile/DecompileMsiOrMsmCommand.cs
+4
-1
@@ -5,6 +5,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind
5
using System;
6
using System.Collections.Generic;
7
using System.ComponentModel;
8
+ using System.Linq;
9
using WixToolset.Core.Native;
10
using WixToolset.Data;
11
using WixToolset.Extensibility;
@@ -37,6 +38,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind
38
{
39
var unbindCommand = new UnbindDatabaseCommand(this.Messaging, database, this.Context.DecompilePath, this.Context.DecompileType, this.Context.ExtractFolder, this.Context.IntermediateFolder, this.Context.IsAdminImage, false, skipSummaryInfo: false);
40
var output = unbindCommand.Execute();
41
+ var extractedFilePaths = new List<string>(unbindCommand.ExportedFiles);
42
43
var decompiler = new Decompiler(this.Messaging, this.Extensions, this.Context.BaseSourcePath, this.Context.SuppressCustomTables, this.Context.SuppressDroppingEmptyTables, this.Context.SuppressUI, this.Context.TreatProductAsModule);
44
result.Document = decompiler.Decompile(output);
@@ -47,7 +49,8 @@ namespace WixToolset.Core.WindowsInstaller.Unbind
49
var extractCommand = new ExtractCabinetsCommand(output, database, this.Context.DecompilePath, this.Context.ExtractFolder, this.Context.IntermediateFolder, this.Context.TreatProductAsModule);
50
extractCommand.Execute();
51
50
- result.ExtractedFilePaths = extractCommand.ExtractedFiles;
52
+ extractedFilePaths.AddRange(extractCommand.ExtractedFiles);
53
+ result.ExtractedFilePaths = extractedFilePaths;
54
}
55
else
56
{
src/WixToolset.Core.WindowsInstaller/Unbind/UnbindDatabaseCommand.cs
+9
@@ -7,6 +7,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind
7
using System.Collections.Generic;
8
using System.Globalization;
9
using System.IO;
10
+ using System.Linq;
11
using System.Text.RegularExpressions;
12
using WixToolset.Core.Native;
13
using WixToolset.Data;
@@ -17,6 +18,8 @@ namespace WixToolset.Core.WindowsInstaller.Unbind
18
19
internal class UnbindDatabaseCommand
20
{
21
+ private List<string> exportedFiles;
22
+
23
public UnbindDatabaseCommand(IMessaging messaging, Database database, string databasePath, OutputType outputType, string exportBasePath, string intermediateFolder, bool isAdminImage, bool suppressDemodularization, bool skipSummaryInfo)
24
{
25
this.Messaging = messaging;
@@ -52,10 +55,14 @@ namespace WixToolset.Core.WindowsInstaller.Unbind
55
56
public TableDefinitionCollection TableDefinitions { get; }
57
58
+ public IEnumerable<string> ExportedFiles => this.exportedFiles;
59
+
60
private int SectionCount { get; set; }
61
62
public Output Execute()
63
{
64
+ this.exportedFiles = new List<string>();
65
+
66
string modularizationGuid = null;
67
var output = new Output(new SourceLineNumber(this.DatabasePath));
68
View validationView = null;
@@ -343,6 +350,8 @@ namespace WixToolset.Core.WindowsInstaller.Unbind
350
fs.Write(buffer, 0, bytesRead);
351
}
352
}
353
+
354
+ this.exportedFiles.Add(sourceFile);
355
}
356
357
row[i] = sourceFile;