diff options
Diffstat (limited to 'src/ext/Bal')
2 files changed, 54 insertions, 2 deletions
diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs index a9460008..2e21ef90 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs | |||
@@ -3,10 +3,9 @@ | |||
3 | namespace WixToolsetTest.BootstrapperApplications | 3 | namespace WixToolsetTest.BootstrapperApplications |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using System.Collections.Generic; | ||
6 | using System.IO; | 7 | using System.IO; |
7 | using System.Linq; | 8 | using System.Linq; |
8 | using System.Xml; | ||
9 | using WixToolset.BootstrapperApplications; | ||
10 | using WixInternal.Core.TestPackage; | 9 | using WixInternal.Core.TestPackage; |
11 | using WixInternal.TestSupport; | 10 | using WixInternal.TestSupport; |
12 | using Xunit; | 11 | using Xunit; |
@@ -52,6 +51,47 @@ namespace WixToolsetTest.BootstrapperApplications | |||
52 | } | 51 | } |
53 | 52 | ||
54 | [Fact] | 53 | [Fact] |
54 | public void CanBuildUsingBootstrapperApplicationId() | ||
55 | { | ||
56 | using (var fs = new DisposableFileSystem()) | ||
57 | { | ||
58 | var baseFolder = fs.GetFolder(); | ||
59 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
60 | var bundleSourceFolder = TestData.Get("TestData", "WixStdBa"); | ||
61 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
62 | var baFolderPath = Path.Combine(baseFolder, "ba"); | ||
63 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | ||
64 | |||
65 | var compileResult = WixRunner.Execute(new[] | ||
66 | { | ||
67 | "build", | ||
68 | Path.Combine(bundleSourceFolder, "BootstrapperApplicationId.wxs"), | ||
69 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
70 | "-intermediateFolder", intermediateFolder, | ||
71 | "-bindpath", Path.Combine(bundleSourceFolder, "data"), | ||
72 | "-o", bundleFile, | ||
73 | }); | ||
74 | compileResult.AssertSuccess(); | ||
75 | |||
76 | Assert.True(File.Exists(bundleFile)); | ||
77 | |||
78 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); | ||
79 | extractResult.AssertSuccess(); | ||
80 | |||
81 | var ignoreAttributesByElementName = new Dictionary<string, List<string>> | ||
82 | { | ||
83 | { "Payload", new List<string> { "SourcePath" } }, | ||
84 | }; | ||
85 | |||
86 | var wixStdBaPayloadInfo = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:UX/burn:Payload[@FilePath='wixstdba.exe']", ignoreAttributesByElementName); | ||
87 | WixAssert.CompareLineByLine(new string[] | ||
88 | { | ||
89 | $@"<Payload Id='WixStandardBootstrapperApplication_X86' FilePath='wixstdba.exe' SourcePath='*' />" | ||
90 | }, wixStdBaPayloadInfo); | ||
91 | } | ||
92 | } | ||
93 | |||
94 | [Fact] | ||
55 | public void CanBuildUsingOverridable() | 95 | public void CanBuildUsingOverridable() |
56 | { | 96 | { |
57 | using (var fs = new DisposableFileSystem()) | 97 | using (var fs = new DisposableFileSystem()) |
diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/BootstrapperApplicationId.wxs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/BootstrapperApplicationId.wxs new file mode 100644 index 00000000..e1945f53 --- /dev/null +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/BootstrapperApplicationId.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 | <BootstrapperApplication Id="Custom"> | ||
6 | <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" /> | ||
7 | </BootstrapperApplication> | ||
8 | <Chain> | ||
9 | <MsiPackage SourceFile="test.msi" /> | ||
10 | </Chain> | ||
11 | </Bundle> | ||
12 | </Wix> | ||