diff options
author | Rob Mensching <rob@firegiant.com> | 2021-04-08 10:32:40 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-04-08 10:37:00 -0700 |
commit | 999621b156ae6be4c06205e3e992b2a76dce7926 (patch) | |
tree | 80c19b663d0a4c3014d6323498676a5d05c52124 /src/test | |
parent | 399ab500b78b0bbd4735cdce560b0f389f2603a0 (diff) | |
download | wix-999621b156ae6be4c06205e3e992b2a76dce7926.tar.gz wix-999621b156ae6be4c06205e3e992b2a76dce7926.tar.bz2 wix-999621b156ae6be4c06205e3e992b2a76dce7926.zip |
Re-enable MSI usage of only a "." in Directory/@Name
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs | 47 | ||||
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/TestData/Directory/DefaultName.wxs | 13 |
2 files changed, 60 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs index e0b85509..a61bdff3 100644 --- a/src/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/DirectoryFixture.cs | |||
@@ -89,6 +89,53 @@ namespace WixToolsetTest.CoreIntegration | |||
89 | } | 89 | } |
90 | 90 | ||
91 | [Fact] | 91 | [Fact] |
92 | public void CanGetDefaultName() | ||
93 | { | ||
94 | var folder = TestData.Get(@"TestData"); | ||
95 | |||
96 | using (var fs = new DisposableFileSystem()) | ||
97 | { | ||
98 | var baseFolder = fs.GetFolder(); | ||
99 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
100 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
101 | |||
102 | var result = WixRunner.Execute(new[] | ||
103 | { | ||
104 | "build", | ||
105 | Path.Combine(folder, "Directory", "DefaultName.wxs"), | ||
106 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
107 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
108 | "-intermediateFolder", intermediateFolder, | ||
109 | "-o", msiPath | ||
110 | }); | ||
111 | |||
112 | result.AssertSuccess(); | ||
113 | |||
114 | var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); | ||
115 | var section = intermediate.Sections.Single(); | ||
116 | |||
117 | var dirSymbols = section.Symbols.OfType<WixToolset.Data.Symbols.DirectorySymbol>().ToList(); | ||
118 | WixAssert.CompareLineByLine(new[] | ||
119 | { | ||
120 | "BinFolder\tCompanyFolder\t.", | ||
121 | "CompanyFolder\tProgramFilesFolder\tExample Corporation", | ||
122 | "ProgramFilesFolder\tTARGETDIR\tPFiles", | ||
123 | "TARGETDIR\t\tSourceDir" | ||
124 | }, dirSymbols.OrderBy(d => d.Id.Id).Select(d => String.Join('\t', d.Id.Id, d.ParentDirectoryRef, d.Name)).ToArray()); | ||
125 | |||
126 | var data = WindowsInstallerData.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); | ||
127 | var directoryRows = data.Tables["Directory"].Rows; | ||
128 | WixAssert.CompareLineByLine(new[] | ||
129 | { | ||
130 | "BinFolder\tCompanyFolder\t.", | ||
131 | "CompanyFolder\tProgramFilesFolder\tu7-b4gch|Example Corporation", | ||
132 | "ProgramFilesFolder\tTARGETDIR\tPFiles", | ||
133 | "TARGETDIR\t\tSourceDir" | ||
134 | }, directoryRows.Select(r => String.Join('\t', r.FieldAsString(0), r.FieldAsString(1), r.FieldAsString(2))).ToArray()); | ||
135 | } | ||
136 | } | ||
137 | |||
138 | [Fact] | ||
92 | public void CanGetDuplicateDir() | 139 | public void CanGetDuplicateDir() |
93 | { | 140 | { |
94 | var folder = TestData.Get(@"TestData"); | 141 | var folder = TestData.Get(@"TestData"); |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Directory/DefaultName.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Directory/DefaultName.wxs new file mode 100644 index 00000000..3e7887c4 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Directory/DefaultName.wxs | |||
@@ -0,0 +1,13 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
3 | <Fragment> | ||
4 | <ComponentGroup Id="ProductComponents" Directory="BinFolder" /> | ||
5 | </Fragment> | ||
6 | <Fragment> | ||
7 | <StandardDirectory Id="ProgramFilesFolder"> | ||
8 | <Directory Id="CompanyFolder" Name="!(bind.Property.Manufacturer)"> | ||
9 | <Directory Id="BinFolder" Name="." /> | ||
10 | </Directory> | ||
11 | </StandardDirectory> | ||
12 | </Fragment> | ||
13 | </Wix> | ||