diff options
| author | Bob Arnson <bob@firegiant.com> | 2021-04-12 15:13:08 -0400 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2021-04-12 15:22:15 -0400 |
| commit | 3f4bd928ab4c048792bf4c5c10004a1f22e8aa19 (patch) | |
| tree | a884ad428b3db891adefb3111dc8819e90c83855 /src/test/WixToolsetTest.CoreIntegration | |
| parent | d77302d94b356a1db2b2b834e45c8962381eae6b (diff) | |
| download | wix-3f4bd928ab4c048792bf4c5c10004a1f22e8aa19.tar.gz wix-3f4bd928ab4c048792bf4c5c10004a1f22e8aa19.tar.bz2 wix-3f4bd928ab4c048792bf4c5c10004a1f22e8aa19.zip | |
Fix decompilation of directories as children TARGETDIR.
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration')
5 files changed, 48 insertions, 17 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs b/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs index b07f5bda..ab04da15 100644 --- a/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs | |||
| @@ -3,10 +3,8 @@ | |||
| 3 | namespace WixToolsetTest.CoreIntegration | 3 | namespace WixToolsetTest.CoreIntegration |
| 4 | { | 4 | { |
| 5 | using System.IO; | 5 | using System.IO; |
| 6 | using System.Xml.Linq; | ||
| 7 | using WixBuildTools.TestSupport; | 6 | using WixBuildTools.TestSupport; |
| 8 | using WixToolset.Core.TestPackage; | 7 | using WixToolset.Core.TestPackage; |
| 9 | using WixToolset.Extensibility.Services; | ||
| 10 | using Xunit; | 8 | using Xunit; |
| 11 | 9 | ||
| 12 | public class DecompileFixture | 10 | public class DecompileFixture |
| @@ -78,5 +76,11 @@ namespace WixToolsetTest.CoreIntegration | |||
| 78 | { | 76 | { |
| 79 | DecompileAndCompare(@"TestData\DecompileNullComponent", "example.msi", "Expected.wxs"); | 77 | DecompileAndCompare(@"TestData\DecompileNullComponent", "example.msi", "Expected.wxs"); |
| 80 | } | 78 | } |
| 79 | |||
| 80 | [Fact] | ||
| 81 | public void CanDecompileMergeModuleWithTargetDirComponent() | ||
| 82 | { | ||
| 83 | DecompileAndCompare(@"TestData\DecompileTargetDirMergeModule", "MergeModule1.msm", "Expected.wxs"); | ||
| 84 | } | ||
| 81 | } | 85 | } |
| 82 | } | 86 | } |
diff --git a/src/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs index 349bad2c..17e91692 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ModuleFixture.cs | |||
| @@ -46,19 +46,23 @@ namespace WixToolsetTest.CoreIntegration | |||
| 46 | WixAssert.CompareLineByLine(new[] | 46 | WixAssert.CompareLineByLine(new[] |
| 47 | { | 47 | { |
| 48 | "MergeRedirectFolder\tTARGETDIR\t.", | 48 | "MergeRedirectFolder\tTARGETDIR\t.", |
| 49 | "NotTheMergeRedirectFolder\tTARGETDIR\t.", | ||
| 49 | "TARGETDIR\t\tSourceDir" | 50 | "TARGETDIR\t\tSourceDir" |
| 50 | }, dirSymbols.Select(d => String.Join("\t", d.Id.Id, d.ParentDirectoryRef, d.Name)).ToArray()); | 51 | }, dirSymbols.Select(d => String.Join("\t", d.Id.Id, d.ParentDirectoryRef, d.Name)).ToArray()); |
| 51 | 52 | ||
| 52 | var fileSymbol = section.Symbols.OfType<FileSymbol>().Single(); | 53 | var fileSymbols = section.Symbols.OfType<FileSymbol>().OrderBy(d => d.Id.Id).ToList(); |
| 53 | Assert.Equal("filyIq8rqcxxf903Hsn5K9L0SWV73g", fileSymbol.Id.Id); | 54 | WixAssert.CompareLineByLine(new[] |
| 54 | Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); | 55 | { |
| 55 | Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); | 56 | $"File1\t{Path.Combine(folder, @"data\test.txt")}\ttest.txt", |
| 57 | $"File2\t{Path.Combine(folder, @"data\test.txt")}\ttest.txt", | ||
| 58 | }, fileSymbols.Select(fileSymbol => String.Join("\t", fileSymbol.Id.Id, fileSymbol[FileSymbolFields.Source].AsPath().Path, fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path)).ToArray()); | ||
| 56 | 59 | ||
| 57 | var data = WindowsInstallerData.Load(Path.Combine(intermediateFolder, @"bin\test.wixpdb")); | 60 | var data = WindowsInstallerData.Load(Path.Combine(intermediateFolder, @"bin\test.wixpdb")); |
| 58 | var fileRows = data.Tables["File"].Rows; | 61 | var fileRows = data.Tables["File"].Rows; |
| 59 | Assert.Equal(new[] | 62 | Assert.Equal(new[] |
| 60 | { | 63 | { |
| 61 | "filyIq8rqcxxf903Hsn5K9L0SWV73g.243FB739_4D05_472F_9CFB_EF6B1017B6DE" | 64 | "File1.243FB739_4D05_472F_9CFB_EF6B1017B6DE", |
| 65 | "File2.243FB739_4D05_472F_9CFB_EF6B1017B6DE", | ||
| 62 | }, fileRows.Select(r => r.FieldAsString(0)).ToArray()); | 66 | }, fileRows.Select(r => r.FieldAsString(0)).ToArray()); |
| 63 | 67 | ||
| 64 | var cabPath = Path.Combine(intermediateFolder, "msm-test.cab"); | 68 | var cabPath = Path.Combine(intermediateFolder, "msm-test.cab"); |
| @@ -66,7 +70,8 @@ namespace WixToolsetTest.CoreIntegration | |||
| 66 | var files = Query.GetCabinetFiles(cabPath); | 70 | var files = Query.GetCabinetFiles(cabPath); |
| 67 | Assert.Equal(new[] | 71 | Assert.Equal(new[] |
| 68 | { | 72 | { |
| 69 | "filyIq8rqcxxf903Hsn5K9L0SWV73g.243FB739_4D05_472F_9CFB_EF6B1017B6DE" | 73 | "File1.243FB739_4D05_472F_9CFB_EF6B1017B6DE", |
| 74 | "File2.243FB739_4D05_472F_9CFB_EF6B1017B6DE", | ||
| 70 | }, files.Select(f => Path.Combine(f.Path, f.Name)).ToArray()); | 75 | }, files.Select(f => Path.Combine(f.Path, f.Name)).ToArray()); |
| 71 | } | 76 | } |
| 72 | } | 77 | } |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileTargetDirMergeModule/Expected.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileTargetDirMergeModule/Expected.wxs new file mode 100644 index 00000000..7c5fe3cf --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileTargetDirMergeModule/Expected.wxs | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Module Id="MergeModule1" Language="1033" Version="1.0.0.0" InstallerVersion="200"> | ||
| 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"> | ||
| 10 | <Directory Id="WixTestDir" ShortName="7bhhvaai" Name="WiX Toolset Test Directory"> | ||
| 11 | <Component Id="ModuleComponent1" Guid="{D86EC5A2-9576-4699-BDC3-00586FF72CBE}" Bitness="always32"> | ||
| 12 | <File Id="File1" ShortName="gahushls.wxs" Name="MergeModule.wxs" KeyPath="yes" Source="SourceDir\File\File1.F844F0E3_8CB4_4A0F_973E_31C4F9338382" /> | ||
| 13 | </Component> | ||
| 14 | </Directory> | ||
| 15 | </StandardDirectory> | ||
| 16 | <SummaryInformation Description="MergeModule1" Manufacturer="WiX Toolset contributors" /> | ||
| 17 | </Module> | ||
| 18 | </Wix> \ No newline at end of file | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileTargetDirMergeModule/MergeModule1.msm b/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileTargetDirMergeModule/MergeModule1.msm new file mode 100644 index 00000000..2a7b5e3a --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/DecompileTargetDirMergeModule/MergeModule1.msm | |||
| Binary files differ | |||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleModule/Module.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleModule/Module.wxs index 9a523162..8317e7af 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleModule/Module.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleModule/Module.wxs | |||
| @@ -1,13 +1,17 @@ | |||
| 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |
| 2 | <Module Id="MergeModule1" Language="1033" Version="1.0.0.0" Guid="243FB739-4D05-472F-9CFB-EF6B1017B6DE" InstallerVersion="200"> | 2 | <Module Id="MergeModule1" Language="1033" Version="1.0.0.0" Guid="243FB739-4D05-472F-9CFB-EF6B1017B6DE" InstallerVersion="200"> |
| 3 | <SummaryInformation Manufacturer="!(loc.Manufacturer)" /> | 3 | <SummaryInformation Manufacturer="!(loc.Manufacturer)" /> |
| 4 | 4 | ||
| 5 | <Directory Id="MergeRedirectFolder"> | 5 | <Directory Id="MergeRedirectFolder"> |
| 6 | <Component Id="ModuleComponent1" Guid="A04E61B2-3ED4-4803-B2EB-4B773576FA45"> | ||
| 7 | <File Id="File1" Source="test.txt" /> | ||
| 8 | </Component> | ||
| 9 | </Directory> | ||
| 6 | 10 | ||
| 7 | <Component Id="ModuleComponent" Guid="A04E61B2-3ED4-4803-B2EB-4B773576FA45"> | 11 | <Directory Id="NotTheMergeRedirectFolder"> |
| 8 | <File Source="test.txt" /> | 12 | <Component Id="ModuleComponent2" Guid="EADB3047-BD32-417B-AABF-B8D9CCDC22DA"> |
| 9 | </Component> | 13 | <File Id="File2" Source="test.txt" /> |
| 10 | 14 | </Component> | |
| 11 | </Directory> | 15 | </Directory> |
| 12 | </Module> | 16 | </Module> |
| 13 | </Wix> | 17 | </Wix> |
