@joebigelow / wix-1 / commits / 8510c889

Extract files when using `IDecompileContext.TreatProductAsModule`.

Bob Arnson committed Dec 5, 2018 at 18:30 UTC 8510c8891b2db107b67a94efe1011e1b513d91b4
2 files changed +6 -3
src/WixToolset.Core.WindowsInstaller/Decompile/DecompileMsiOrMsmCommand.cs
+1 -1
@@ -44,7 +44,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind
44 // extract the files from the cabinets
45 if (!String.IsNullOrEmpty(this.Context.ExtractFolder) && !this.Context.SuppressExtractCabinets)
46 {
47 - var extractCommand = new ExtractCabinetsCommand(output, database, this.Context.DecompilePath, this.Context.ExtractFolder, this.Context.IntermediateFolder);
47 + var extractCommand = new ExtractCabinetsCommand(output, database, this.Context.DecompilePath, this.Context.ExtractFolder, this.Context.IntermediateFolder, this.Context.TreatProductAsModule);
48 extractCommand.Execute();
49
50 result.ExtractedFilePaths = extractCommand.ExtractedFiles;
src/WixToolset.Core.WindowsInstaller/Unbind/ExtractCabinetsCommand.cs
+5 -2
@@ -15,13 +15,14 @@ namespace WixToolset.Core.WindowsInstaller.Unbind
15
16 internal class ExtractCabinetsCommand
17 {
18 - public ExtractCabinetsCommand(Output output, Database database, string inputFilePath, string exportBasePath, string intermediateFolder)
18 + public ExtractCabinetsCommand(Output output, Database database, string inputFilePath, string exportBasePath, string intermediateFolder, bool treatOutputAsModule = false)
19 {
20 this.Output = output;
21 this.Database = database;
22 this.InputFilePath = inputFilePath;
23 this.ExportBasePath = exportBasePath;
24 this.IntermediateFolder = intermediateFolder;
25 + this.TreatOutputAsModule = treatOutputAsModule;
26 }
27
28 public string[] ExtractedFiles { get; private set; }
@@ -36,6 +37,8 @@ namespace WixToolset.Core.WindowsInstaller.Unbind
37
38 private string IntermediateFolder { get; }
39
40 + public bool TreatOutputAsModule { get; }
41 +
42 public void Execute()
43 {
44 var databaseBasePath = Path.GetDirectoryName(this.InputFilePath);
@@ -43,7 +46,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind
46 var embeddedCabinets = new SortedList();
47
48 // index all of the cabinet files
46 - if (OutputType.Module == this.Output.Type)
49 + if (OutputType.Module == this.Output.Type || this.TreatOutputAsModule)
50 {
51 embeddedCabinets.Add(0, "MergeModule.CABinet");
52 }