diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/WixToolsetTest.Bal/BalExtensionFixture.cs | 35 | ||||
-rw-r--r-- | src/test/WixToolsetTest.Bal/TestData/WixStdBa/Data/test.msi | bin | 0 -> 32768 bytes | |||
-rw-r--r-- | src/test/WixToolsetTest.Bal/TestData/WixStdBa/DisplayInternalUIConditionBundle.wxs | 12 | ||||
-rw-r--r-- | src/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj | 2 |
4 files changed, 49 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.Bal/BalExtensionFixture.cs b/src/test/WixToolsetTest.Bal/BalExtensionFixture.cs index 18b4727f..5780ca08 100644 --- a/src/test/WixToolsetTest.Bal/BalExtensionFixture.cs +++ b/src/test/WixToolsetTest.Bal/BalExtensionFixture.cs | |||
@@ -4,6 +4,7 @@ namespace WixToolsetTest.Bal | |||
4 | { | 4 | { |
5 | using System.IO; | 5 | using System.IO; |
6 | using System.Linq; | 6 | using System.Linq; |
7 | using System.Xml; | ||
7 | using WixBuildTools.TestSupport; | 8 | using WixBuildTools.TestSupport; |
8 | using WixToolset.Core.TestPackage; | 9 | using WixToolset.Core.TestPackage; |
9 | using Xunit; | 10 | using Xunit; |
@@ -11,6 +12,40 @@ namespace WixToolsetTest.Bal | |||
11 | public class BalExtensionFixture | 12 | public class BalExtensionFixture |
12 | { | 13 | { |
13 | [Fact] | 14 | [Fact] |
15 | public void CanBuildUsingDisplayInternalUICondition() | ||
16 | { | ||
17 | using (var fs = new DisposableFileSystem()) | ||
18 | { | ||
19 | var baseFolder = fs.GetFolder(); | ||
20 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
21 | var bundleSourceFolder = TestData.Get(@"TestData\WixStdBa"); | ||
22 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
23 | var baFolderPath = Path.Combine(baseFolder, "ba"); | ||
24 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | ||
25 | |||
26 | var compileResult = WixRunner.Execute(new[] | ||
27 | { | ||
28 | "build", | ||
29 | Path.Combine(bundleSourceFolder, "DisplayInternalUIConditionBundle.wxs"), | ||
30 | "-ext", TestData.Get(@"WixToolset.Bal.wixext.dll"), | ||
31 | "-intermediateFolder", intermediateFolder, | ||
32 | "-bindpath", Path.Combine(bundleSourceFolder, "data"), | ||
33 | "-o", bundleFile, | ||
34 | }); | ||
35 | compileResult.AssertSuccess(); | ||
36 | |||
37 | Assert.True(File.Exists(bundleFile)); | ||
38 | |||
39 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); | ||
40 | extractResult.AssertSuccess(); | ||
41 | |||
42 | var balPackageInfos = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo"); | ||
43 | var balPackageInfo = (XmlNode)Assert.Single(balPackageInfos); | ||
44 | Assert.Equal("<WixBalPackageInfo PackageId='test.msi' DisplayInternalUICondition='1' />", balPackageInfo.GetTestXml()); | ||
45 | } | ||
46 | } | ||
47 | |||
48 | [Fact] | ||
14 | public void CanBuildUsingWixStdBa() | 49 | public void CanBuildUsingWixStdBa() |
15 | { | 50 | { |
16 | using (var fs = new DisposableFileSystem()) | 51 | using (var fs = new DisposableFileSystem()) |
diff --git a/src/test/WixToolsetTest.Bal/TestData/WixStdBa/Data/test.msi b/src/test/WixToolsetTest.Bal/TestData/WixStdBa/Data/test.msi new file mode 100644 index 00000000..94aacd1a --- /dev/null +++ b/src/test/WixToolsetTest.Bal/TestData/WixStdBa/Data/test.msi | |||
Binary files differ | |||
diff --git a/src/test/WixToolsetTest.Bal/TestData/WixStdBa/DisplayInternalUIConditionBundle.wxs b/src/test/WixToolsetTest.Bal/TestData/WixStdBa/DisplayInternalUIConditionBundle.wxs new file mode 100644 index 00000000..438fc23e --- /dev/null +++ b/src/test/WixToolsetTest.Bal/TestData/WixStdBa/DisplayInternalUIConditionBundle.wxs | |||
@@ -0,0 +1,12 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | ||
3 | xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | ||
4 | <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2"> | ||
5 | <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense"> | ||
6 | <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" /> | ||
7 | </BootstrapperApplicationRef> | ||
8 | <Chain> | ||
9 | <MsiPackage SourceFile="test.msi" bal:DisplayInternalUICondition="1" /> | ||
10 | </Chain> | ||
11 | </Bundle> | ||
12 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj b/src/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj index f970c2c8..f09a19a2 100644 --- a/src/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj +++ b/src/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj | |||
@@ -14,6 +14,8 @@ | |||
14 | <ItemGroup> | 14 | <ItemGroup> |
15 | <Content Include="TestData\MBA\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" /> | 15 | <Content Include="TestData\MBA\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" /> |
16 | <Content Include="TestData\WixStdBa\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" /> | 16 | <Content Include="TestData\WixStdBa\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" /> |
17 | <Content Include="TestData\WixStdBa\Data\test.msi" CopyToOutputDirectory="PreserveNewest" /> | ||
18 | <Content Include="TestData\WixStdBa\DisplayInternalUIConditionBundle.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
17 | </ItemGroup> | 19 | </ItemGroup> |
18 | 20 | ||
19 | <Target Name="CopyExtensions" AfterTargets="Build"> | 21 | <Target Name="CopyExtensions" AfterTargets="Build"> |