diff options
author | Rob Mensching <rob@firegiant.com> | 2021-01-05 15:13:37 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-01-05 23:18:34 -0800 |
commit | 0d1851c79901ba6ddbba9bb63f758760fe5be994 (patch) | |
tree | 2ccb45459fe4290e9c3fb4ad698c20f9cd55203d /src/test | |
parent | b00c72ed0ef19d2e46f60361fa06821b0bd5ec94 (diff) | |
download | wix-0d1851c79901ba6ddbba9bb63f758760fe5be994.tar.gz wix-0d1851c79901ba6ddbba9bb63f758760fe5be994.tar.bz2 wix-0d1851c79901ba6ddbba9bb63f758760fe5be994.zip |
Fix handling of duplicate directories
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs | 39 | ||||
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/TestData/DuplicateDir/DuplicateDir.wxs | 25 |
2 files changed, 64 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs index 83f2f2bb..2d6e4802 100644 --- a/src/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs | |||
@@ -85,5 +85,44 @@ namespace WixToolsetTest.CoreIntegration | |||
85 | }, dirSymbols.Select(d => d.Id.Id).ToArray()); | 85 | }, dirSymbols.Select(d => d.Id.Id).ToArray()); |
86 | } | 86 | } |
87 | } | 87 | } |
88 | |||
89 | [Fact] | ||
90 | public void CanGetDuplicateDir() | ||
91 | { | ||
92 | var folder = TestData.Get(@"TestData"); | ||
93 | |||
94 | using (var fs = new DisposableFileSystem()) | ||
95 | { | ||
96 | var baseFolder = fs.GetFolder(); | ||
97 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
98 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
99 | |||
100 | var result = WixRunner.Execute(new[] | ||
101 | { | ||
102 | "build", | ||
103 | "-arch", "x64", | ||
104 | Path.Combine(folder, "DuplicateDir", "DuplicateDir.wxs"), | ||
105 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
106 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
107 | "-intermediateFolder", intermediateFolder, | ||
108 | "-o", msiPath | ||
109 | }); | ||
110 | |||
111 | result.AssertSuccess(); | ||
112 | |||
113 | var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); | ||
114 | var section = intermediate.Sections.Single(); | ||
115 | |||
116 | var dirSymbols = section.Symbols.OfType<WixToolset.Data.Symbols.DirectorySymbol>().ToList(); | ||
117 | Assert.Equal(new[] | ||
118 | { | ||
119 | "dirZsSsu81KcG46xXTwc4mTSZO5Zx4", | ||
120 | "INSTALLFOLDER", | ||
121 | "ProgramFiles6432Folder", | ||
122 | "ProgramFiles64Folder", | ||
123 | "TARGETDIR" | ||
124 | }, dirSymbols.Select(d => d.Id.Id).ToArray()); | ||
125 | } | ||
126 | } | ||
88 | } | 127 | } |
89 | } | 128 | } |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/DuplicateDir/DuplicateDir.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/DuplicateDir/DuplicateDir.wxs new file mode 100644 index 00000000..ffee969d --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/DuplicateDir/DuplicateDir.wxs | |||
@@ -0,0 +1,25 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" ?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
3 | <Fragment> | ||
4 | <ComponentGroup Id="ProductComponents"> | ||
5 | <ComponentGroupRef Id="GroupA" /> | ||
6 | <ComponentGroupRef Id="GroupB" /> | ||
7 | </ComponentGroup> | ||
8 | </Fragment> | ||
9 | |||
10 | <Fragment> | ||
11 | <ComponentGroup Id="GroupA" Directory="INSTALLFOLDER:\dupe"> | ||
12 | <Component> | ||
13 | <File Name="a.txt" Source="test.txt" /> | ||
14 | </Component> | ||
15 | </ComponentGroup> | ||
16 | </Fragment> | ||
17 | |||
18 | <Fragment> | ||
19 | <ComponentGroup Id="GroupB" Directory="INSTALLFOLDER:\dupe"> | ||
20 | <Component> | ||
21 | <File Name="b.txt" Source="test.txt" /> | ||
22 | </Component> | ||
23 | </ComponentGroup> | ||
24 | </Fragment> | ||
25 | </Wix> | ||