aboutsummaryrefslogtreecommitdiff
path: root/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2020-05-22 14:53:27 -0700
committerRob Mensching <rob@firegiant.com>2020-05-22 15:25:19 -0700
commit6b30680fd7a712b45538c3f0a89d652f0457a893 (patch)
tree46ef7f7d51de4189b7ef1af07dda3add16ad302f /src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
parent236f958468923f65a8f02e406601fb47e71cd58e (diff)
downloadwix-6b30680fd7a712b45538c3f0a89d652f0457a893.tar.gz
wix-6b30680fd7a712b45538c3f0a89d652f0457a893.tar.bz2
wix-6b30680fd7a712b45538c3f0a89d652f0457a893.zip
Support merging merge modules
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs')
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
index bb44395f..aa8a0a0d 100644
--- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
+++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
@@ -8,6 +8,9 @@ namespace WixToolsetTest.CoreIntegration
8 using Example.Extension; 8 using Example.Extension;
9 using WixBuildTools.TestSupport; 9 using WixBuildTools.TestSupport;
10 using WixToolset.Core.TestPackage; 10 using WixToolset.Core.TestPackage;
11 using WixToolset.Data;
12 using WixToolset.Data.Tuples;
13 using WixToolset.Data.WindowsInstaller;
11 using Xunit; 14 using Xunit;
12 15
13 public class MsiQueryFixture 16 public class MsiQueryFixture
@@ -1171,5 +1174,52 @@ namespace WixToolsetTest.CoreIntegration
1171 }, secureProperties.Substring(prefix.Length).Split(';').OrderBy(p => p)); 1174 }, secureProperties.Substring(prefix.Length).Split(';').OrderBy(p => p));
1172 } 1175 }
1173 } 1176 }
1177
1178 [Fact]
1179 public void CanMergeModule()
1180 {
1181 var folder = TestData.Get(@"TestData\SimpleMerge");
1182
1183 using (var fs = new DisposableFileSystem())
1184 {
1185 var intermediateFolder = fs.GetFolder();
1186 var msiPath = Path.Combine(intermediateFolder, @"bin\test.msi");
1187 var cabPath = Path.Combine(intermediateFolder, @"bin\cab1.cab");
1188
1189 var result = WixRunner.Execute(new[]
1190 {
1191 "build",
1192 Path.Combine(folder, "Package.wxs"),
1193 "-loc", Path.Combine(folder, "Package.en-us.wxl"),
1194 "-bindpath", Path.Combine(folder, ".data"),
1195 "-intermediateFolder", intermediateFolder,
1196 "-o", msiPath
1197 });
1198
1199 result.AssertSuccess();
1200
1201 Assert.True(File.Exists(msiPath));
1202 Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\test.wixpdb")));
1203
1204 var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\test.wixpdb"));
1205 var section = intermediate.Sections.Single();
1206 Assert.Empty(section.Tuples.OfType<FileTuple>());
1207
1208 var data = WindowsInstallerData.Load(Path.Combine(intermediateFolder, @"bin\test.wixpdb"));
1209 Assert.Null(data.Tables["File"]);
1210
1211 var results = Query.QueryDatabase(msiPath, new[] { "File" });
1212 Assert.Equal(new[]
1213 {
1214 "File:filyIq8rqcxxf903Hsn5K9L0SWV73g.243FB739_4D05_472F_9CFB_EF6B1017B6DE\tModuleComponent.243FB739_4D05_472F_9CFB_EF6B1017B6DE\ttest.txt\t17\t\t\t512\t0"
1215 }, results);
1216
1217 var files = Query.GetCabinetFiles(cabPath);
1218 Assert.Equal(new[]
1219 {
1220 "filyIq8rqcxxf903Hsn5K9L0SWV73g.243FB739_4D05_472F_9CFB_EF6B1017B6DE"
1221 }, files.Select(f => f.Name).ToArray());
1222 }
1223 }
1174 } 1224 }
1175} 1225}