diff options
| author | Bob Arnson <bob@firegiant.com> | 2021-06-29 15:49:49 -0400 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2021-06-29 16:23:24 -0400 |
| commit | e844f12f7d7247a1e9ba4eef2a388e614001bb24 (patch) | |
| tree | 3f6f69368904b4ab2e2f40e7d1d406b415e0bb24 /src | |
| parent | b3c15a3dd5bb2747deb59fe1d6a7cc31d2990f62 (diff) | |
| download | wix-e844f12f7d7247a1e9ba4eef2a388e614001bb24.tar.gz wix-e844f12f7d7247a1e9ba4eef2a388e614001bb24.tar.bz2 wix-e844f12f7d7247a1e9ba4eef2a388e614001bb24.zip | |
Fix decompilation for TARGETDIR-rooted components.
Also ensure modularization Guid is decompiled.
Diffstat (limited to 'src')
4 files changed, 22 insertions, 9 deletions
diff --git a/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs b/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs index 0b45a8b3..9c338293 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs | |||
| @@ -767,6 +767,13 @@ namespace WixToolset.Core.WindowsInstaller.Decompile | |||
| 767 | // set the component keypaths | 767 | // set the component keypaths |
| 768 | if (null != componentTable) | 768 | if (null != componentTable) |
| 769 | { | 769 | { |
| 770 | // Add the TARGETDIR StandardDirectory if a component is directly parented there. | ||
| 771 | if (componentTable.Rows.Any(row => row.FieldAsString(2) == "TARGETDIR") | ||
| 772 | && this.TryGetIndexedElement("Directory", out var xDirectory, "TARGETDIR")) | ||
| 773 | { | ||
| 774 | this.RootElement.Add(xDirectory); | ||
| 775 | } | ||
| 776 | |||
| 770 | foreach (var row in componentTable.Rows) | 777 | foreach (var row in componentTable.Rows) |
| 771 | { | 778 | { |
| 772 | var attributes = row.FieldAsInteger(3); | 779 | var attributes = row.FieldAsInteger(3); |
| @@ -2449,6 +2456,7 @@ namespace WixToolset.Core.WindowsInstaller.Decompile | |||
| 2449 | var table = tables["_SummaryInformation"]; | 2456 | var table = tables["_SummaryInformation"]; |
| 2450 | var row = table.Rows.SingleOrDefault(r => r.FieldAsInteger(0) == 9); | 2457 | var row = table.Rows.SingleOrDefault(r => r.FieldAsInteger(0) == 9); |
| 2451 | this.ModularizationGuid = row?.FieldAsString(1); | 2458 | this.ModularizationGuid = row?.FieldAsString(1); |
| 2459 | this.RootElement.SetAttributeValue("Guid", this.ModularizationGuid); | ||
| 2452 | } | 2460 | } |
| 2453 | 2461 | ||
| 2454 | // index the rows from the extension libraries | 2462 | // index the rows from the extension libraries |
| @@ -4352,7 +4360,7 @@ namespace WixToolset.Core.WindowsInstaller.Decompile | |||
| 4352 | 4360 | ||
| 4353 | if (id == "TARGETDIR") | 4361 | if (id == "TARGETDIR") |
| 4354 | { | 4362 | { |
| 4355 | // Skip TARGETDIR (but see below!). | 4363 | // Skip TARGETDIR -- but it will be added for any components directly targeted. |
| 4356 | } | 4364 | } |
| 4357 | else if (row.IsColumnNull(1) || WindowsInstallerStandard.IsStandardDirectory(id)) | 4365 | else if (row.IsColumnNull(1) || WindowsInstallerStandard.IsStandardDirectory(id)) |
| 4358 | { | 4366 | { |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs index ab04da15..e87bbfee 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs | |||
| @@ -24,9 +24,9 @@ namespace WixToolsetTest.CoreIntegration | |||
| 24 | Path.Combine(folder, msiName), | 24 | Path.Combine(folder, msiName), |
| 25 | "-intermediateFolder", intermediateFolder, | 25 | "-intermediateFolder", intermediateFolder, |
| 26 | "-o", outputPath | 26 | "-o", outputPath |
| 27 | }); | 27 | }, out var messages); |
| 28 | 28 | ||
| 29 | result.AssertSuccess(); | 29 | Assert.Equal(0, result); |
| 30 | 30 | ||
| 31 | WixAssert.CompareXml(Path.Combine(folder, expectedWxsName), outputPath); | 31 | WixAssert.CompareXml(Path.Combine(folder, expectedWxsName), outputPath); |
| 32 | } | 32 | } |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileTargetDirMergeModule/Expected.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileTargetDirMergeModule/Expected.wxs index 7c5fe3cf..4a89f56b 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileTargetDirMergeModule/Expected.wxs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileTargetDirMergeModule/Expected.wxs | |||
| @@ -1,11 +1,6 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |
| 3 | <Module Id="MergeModule1" Language="1033" Version="1.0.0.0" InstallerVersion="200"> | 3 | <Module Codepage="65001" Id="MergeModule1" Language="1033" Version="1.0.0.0" InstallerVersion="200" Guid="{F844F0E3-8CB4-4A0F-973E-31C4F9338382}"> |
| 4 | <Directory Id="MergeRedirectFolder"> | ||
| 5 | <Component Id="ModuleComponent2" Guid="{BB222EE8-229B-4051-9443-49E348F0CC77}" Bitness="always32"> | ||
| 6 | <File Id="File2" ShortName="sfmxqeab.wxs" Name="MergeModule.wxs" KeyPath="yes" Source="SourceDir\File\File2.F844F0E3_8CB4_4A0F_973E_31C4F9338382" /> | ||
| 7 | </Component> | ||
| 8 | </Directory> | ||
| 9 | <StandardDirectory Id="ProgramFilesFolder"> | 4 | <StandardDirectory Id="ProgramFilesFolder"> |
| 10 | <Directory Id="WixTestDir" ShortName="7bhhvaai" Name="WiX Toolset Test Directory"> | 5 | <Directory Id="WixTestDir" ShortName="7bhhvaai" Name="WiX Toolset Test Directory"> |
| 11 | <Component Id="ModuleComponent1" Guid="{D86EC5A2-9576-4699-BDC3-00586FF72CBE}" Bitness="always32"> | 6 | <Component Id="ModuleComponent1" Guid="{D86EC5A2-9576-4699-BDC3-00586FF72CBE}" Bitness="always32"> |
| @@ -13,6 +8,16 @@ | |||
| 13 | </Component> | 8 | </Component> |
| 14 | </Directory> | 9 | </Directory> |
| 15 | </StandardDirectory> | 10 | </StandardDirectory> |
| 11 | <Directory Id="MergeRedirectFolder"> | ||
| 12 | <Component Id="ModuleComponent2" Guid="{BB222EE8-229B-4051-9443-49E348F0CC77}" Bitness="always32"> | ||
| 13 | <File Id="File2" ShortName="sfmxqeab.wxs" Name="MergeModule.wxs" KeyPath="yes" Source="SourceDir\File\File2.F844F0E3_8CB4_4A0F_973E_31C4F9338382" /> | ||
| 14 | </Component> | ||
| 15 | </Directory> | ||
| 16 | <SummaryInformation Description="MergeModule1" Manufacturer="WiX Toolset contributors" /> | 16 | <SummaryInformation Description="MergeModule1" Manufacturer="WiX Toolset contributors" /> |
| 17 | <StandardDirectory Id="TARGETDIR"> | ||
| 18 | <Component Id="ModuleComponent3" Guid="{63A2B2B1-32BE-46FF-8863-4C85A2745F62}" Bitness="always32"> | ||
| 19 | <RegistryValue KeyPath="yes" Id="Reg1" Root="HKLM" Key="SOFTWARE\WiX Toolset\MergeModuleDecompileTest" Name="DoesntReallyMatter" Value="Hello" Type="string" /> | ||
| 20 | </Component> | ||
| 21 | </StandardDirectory> | ||
| 17 | </Module> | 22 | </Module> |
| 18 | </Wix> \ No newline at end of file | 23 | </Wix> \ No newline at end of file |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileTargetDirMergeModule/MergeModule1.msm b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileTargetDirMergeModule/MergeModule1.msm index 2a7b5e3a..a09cab20 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileTargetDirMergeModule/MergeModule1.msm +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/DecompileTargetDirMergeModule/MergeModule1.msm | |||
| Binary files differ | |||
