From ea4cb92faf459ea90181f12a27cf6d7b1d7c5dbf Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sat, 12 Dec 2020 15:48:08 -0500 Subject: Fix merge module decompilation timing. --- .../Decompile/Decompiler.cs | 15 ++++++++------- src/WixToolset.Core/CommandLine/DecompileCommand.cs | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs b/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs index d11a890c..2288cedf 100644 --- a/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs +++ b/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs @@ -2440,6 +2440,13 @@ namespace WixToolset.Core.WindowsInstaller this.RootElement.SetAttributeValue("Codepage", codepage); } + if (this.OutputType == OutputType.Module) + { + var table = tables["_SummaryInformation"]; + var row = table.Rows.SingleOrDefault(r => r.FieldAsInteger(0) == 9); + this.ModularizationGuid = row?.FieldAsString(1); + } + // index the rows from the extension libraries var indexedExtensionTables = new Dictionary>(); #if TODO_DECOMPILER_EXTENSIONS @@ -3030,12 +3037,6 @@ namespace WixToolset.Core.WindowsInstaller this.RootElement.SetAttributeValue("Language", template[template.Length - 1]); } break; - case 9: - if (OutputType.Module == this.OutputType) - { - this.ModularizationGuid = value; - } - break; case 14: var installerVersion = row.FieldAsInteger(1); // Default InstallerVersion. @@ -3873,7 +3874,7 @@ namespace WixToolset.Core.WindowsInstaller xColumn.SetAttributeValue("Type", "string"); break; default: - throw new InvalidOperationException($"Unknown custom column type '{columnDefinition.Type.ToString()}'."); + throw new InvalidOperationException($"Unknown custom column type '{columnDefinition.Type}'."); } } diff --git a/src/WixToolset.Core/CommandLine/DecompileCommand.cs b/src/WixToolset.Core/CommandLine/DecompileCommand.cs index bce7a5a4..873c85ee 100644 --- a/src/WixToolset.Core/CommandLine/DecompileCommand.cs +++ b/src/WixToolset.Core/CommandLine/DecompileCommand.cs @@ -53,7 +53,7 @@ namespace WixToolset.Core.CommandLine if (!this.Messaging.EncounteredError) { - Directory.CreateDirectory(Path.GetDirectoryName(context.OutputPath)); + Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(context.OutputPath))); result.Document.Save(context.OutputPath, SaveOptions.OmitDuplicateNamespaces); } } -- cgit v1.2.3-55-g6feb