diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-05-22 14:53:27 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-05-22 15:25:19 -0700 |
| commit | 6b30680fd7a712b45538c3f0a89d652f0457a893 (patch) | |
| tree | 46ef7f7d51de4189b7ef1af07dda3add16ad302f /src/test/WixToolsetTest.CoreIntegration | |
| parent | 236f958468923f65a8f02e406601fb47e71cd58e (diff) | |
| download | wix-6b30680fd7a712b45538c3f0a89d652f0457a893.tar.gz wix-6b30680fd7a712b45538c3f0a89d652f0457a893.tar.bz2 wix-6b30680fd7a712b45538c3f0a89d652f0457a893.zip | |
Support merging merge modules
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration')
5 files changed, 88 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 | } |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleMerge/.data/test.msm b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleMerge/.data/test.msm new file mode 100644 index 00000000..6f179aba --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleMerge/.data/test.msm | |||
| Binary files differ | |||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleMerge/Package.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleMerge/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleMerge/Package.en-us.wxl | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | |||
| 3 | <!-- | ||
| 4 | This file contains the declaration of all the localizable strings. | ||
| 5 | --> | ||
| 6 | <WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US"> | ||
| 7 | |||
| 8 | <String Id="DowngradeError">A newer version of [ProductName] is already installed.</String> | ||
| 9 | <String Id="FeatureTitle">MsiPackage</String> | ||
| 10 | |||
| 11 | </WixLocalization> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleMerge/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleMerge/Package.wxs new file mode 100644 index 00000000..303e2ba8 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleMerge/Package.wxs | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Product Id="*" Name="MsiPackage" Codepage="1252" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
| 4 | <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> | ||
| 5 | |||
| 6 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> | ||
| 7 | <MediaTemplate /> | ||
| 8 | |||
| 9 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> | ||
| 10 | <MergeRef Id="TestMsm" /> | ||
| 11 | </Feature> | ||
| 12 | </Product> | ||
| 13 | |||
| 14 | <Fragment> | ||
| 15 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
| 16 | <Directory Id="ProgramFilesFolder"> | ||
| 17 | <Directory Id="INSTALLFOLDER" Name="MsiPackage"> | ||
| 18 | <!-- --> | ||
| 19 | <Merge Id="TestMsm" Language="1033" SourceFile="test.msm" DiskId="1" /> | ||
| 20 | </Directory> | ||
| 21 | </Directory> | ||
| 22 | </Directory> | ||
| 23 | </Fragment> | ||
| 24 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index 0651ec7a..9d2cf1d6 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
| @@ -77,6 +77,9 @@ | |||
| 77 | <Content Include="TestData\SimpleBundle\data\fakeba.dll" CopyToOutputDirectory="PreserveNewest" /> | 77 | <Content Include="TestData\SimpleBundle\data\fakeba.dll" CopyToOutputDirectory="PreserveNewest" /> |
| 78 | <Content Include="TestData\SimpleBundle\data\MsiPackage\Shared.dll" CopyToOutputDirectory="PreserveNewest" /> | 78 | <Content Include="TestData\SimpleBundle\data\MsiPackage\Shared.dll" CopyToOutputDirectory="PreserveNewest" /> |
| 79 | <Content Include="TestData\SimpleBundle\data\MsiPackage\test.txt" CopyToOutputDirectory="PreserveNewest" /> | 79 | <Content Include="TestData\SimpleBundle\data\MsiPackage\test.txt" CopyToOutputDirectory="PreserveNewest" /> |
| 80 | <Content Include="TestData\SimpleMerge\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
| 81 | <Content Include="TestData\SimpleMerge\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 82 | <Content Include="TestData\SimpleMerge\.data\test.msm" CopyToOutputDirectory="PreserveNewest" /> | ||
| 80 | <Content Include="TestData\SimpleModule\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | 83 | <Content Include="TestData\SimpleModule\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> |
| 81 | <Content Include="TestData\SimpleModule\Module.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 84 | <Content Include="TestData\SimpleModule\Module.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
| 82 | <Content Include="TestData\SimpleModule\Module.wxs" CopyToOutputDirectory="PreserveNewest" /> | 85 | <Content Include="TestData\SimpleModule\Module.wxs" CopyToOutputDirectory="PreserveNewest" /> |
