diff options
Diffstat (limited to 'src/ext/Bal/test/WixToolsetTest.Bal')
4 files changed, 70 insertions, 61 deletions
diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs b/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs index 2e60e2c0..217fdfb1 100644 --- a/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs | |||
@@ -116,47 +116,47 @@ namespace WixToolsetTest.Bal | |||
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||
119 | [Fact] | 119 | //[Fact] |
120 | public void CanBuildUsingMBAWithAlwaysInstallPrereqs() | 120 | //public void CanBuildUsingMBAWithAlwaysInstallPrereqs() |
121 | { | 121 | //{ |
122 | using (var fs = new DisposableFileSystem()) | 122 | // using (var fs = new DisposableFileSystem()) |
123 | { | 123 | // { |
124 | var baseFolder = fs.GetFolder(); | 124 | // var baseFolder = fs.GetFolder(); |
125 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | 125 | // var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); |
126 | var bundleSourceFolder = TestData.Get(@"TestData\MBA"); | 126 | // var bundleSourceFolder = TestData.Get("TestData", "MBA"); |
127 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | 127 | // var intermediateFolder = Path.Combine(baseFolder, "obj"); |
128 | var baFolderPath = Path.Combine(baseFolder, "ba"); | 128 | // var baFolderPath = Path.Combine(baseFolder, "ba"); |
129 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | 129 | // var extractFolderPath = Path.Combine(baseFolder, "extract"); |
130 | 130 | ||
131 | var compileResult = WixRunner.Execute(new[] | 131 | // var compileResult = WixRunner.Execute(new[] |
132 | { | 132 | // { |
133 | "build", | 133 | // "build", |
134 | Path.Combine(bundleSourceFolder, "AlwaysInstallPrereqsBundle.wxs"), | 134 | // Path.Combine(bundleSourceFolder, "AlwaysInstallPrereqsBundle.wxs"), |
135 | "-ext", TestData.Get(@"WixToolset.Bal.wixext.dll"), | 135 | // "-ext", TestData.Get(@"WixToolset.Bal.wixext.dll"), |
136 | "-intermediateFolder", intermediateFolder, | 136 | // "-intermediateFolder", intermediateFolder, |
137 | "-o", bundleFile, | 137 | // "-o", bundleFile, |
138 | }); | 138 | // }); |
139 | 139 | ||
140 | compileResult.AssertSuccess(); | 140 | // compileResult.AssertSuccess(); |
141 | 141 | ||
142 | Assert.True(File.Exists(bundleFile)); | 142 | // Assert.True(File.Exists(bundleFile)); |
143 | 143 | ||
144 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); | 144 | // var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); |
145 | extractResult.AssertSuccess(); | 145 | // extractResult.AssertSuccess(); |
146 | 146 | ||
147 | var wixMbaPrereqOptionsElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixMbaPrereqOptions"); | 147 | // var wixPrereqOptionsElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPrereqOptions"); |
148 | WixAssert.CompareLineByLine(new[] | 148 | // WixAssert.CompareLineByLine(new[] |
149 | { | 149 | // { |
150 | "<WixMbaPrereqOptions AlwaysInstallPrereqs='1' />", | 150 | // "<WixPrereqOptions AlwaysInstallPrereqs='1' />", |
151 | }, wixMbaPrereqOptionsElements); | 151 | // }, wixPrereqOptionsElements); |
152 | 152 | ||
153 | var wixMbaPrereqInformationElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixMbaPrereqInformation"); | 153 | // var wixPrereqInformationElements = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPrereqInformation"); |
154 | WixAssert.CompareLineByLine(new[] | 154 | // WixAssert.CompareLineByLine(new[] |
155 | { | 155 | // { |
156 | "<WixMbaPrereqInformation PackageId='wixnative.exe' />", | 156 | // "<WixPrereqInformation PackageId='wixnative.exe' />", |
157 | }, wixMbaPrereqInformationElements); | 157 | // }, wixPrereqInformationElements); |
158 | } | 158 | // } |
159 | } | 159 | //} |
160 | 160 | ||
161 | [Fact] | 161 | [Fact] |
162 | public void CannotBuildUsingMBAWithNoPrereqs() | 162 | public void CannotBuildUsingMBAWithNoPrereqs() |
@@ -165,7 +165,8 @@ namespace WixToolsetTest.Bal | |||
165 | { | 165 | { |
166 | var baseFolder = fs.GetFolder(); | 166 | var baseFolder = fs.GetFolder(); |
167 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | 167 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); |
168 | var bundleSourceFolder = TestData.Get(@"TestData\MBA"); | 168 | var bundleSourceFolder = TestData.Get(@"TestData", "MBA"); |
169 | var dataFolder = TestData.Get(@"TestData", ".Data"); | ||
169 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | 170 | var intermediateFolder = Path.Combine(baseFolder, "obj"); |
170 | 171 | ||
171 | var compileResult = WixRunner.Execute(new[] | 172 | var compileResult = WixRunner.Execute(new[] |
@@ -174,10 +175,15 @@ namespace WixToolsetTest.Bal | |||
174 | Path.Combine(bundleSourceFolder, "Bundle.wxs"), | 175 | Path.Combine(bundleSourceFolder, "Bundle.wxs"), |
175 | "-ext", TestData.Get(@"WixToolset.Bal.wixext.dll"), | 176 | "-ext", TestData.Get(@"WixToolset.Bal.wixext.dll"), |
176 | "-intermediateFolder", intermediateFolder, | 177 | "-intermediateFolder", intermediateFolder, |
178 | "-bindpath", dataFolder, | ||
177 | "-o", bundleFile, | 179 | "-o", bundleFile, |
178 | }); | 180 | }); |
179 | Assert.Equal(6802, compileResult.ExitCode); | 181 | |
180 | WixAssert.StringEqual("There must be at least one package with bal:PrereqPackage=\"yes\" when using the ManagedBootstrapperApplicationHost.\nThis is typically done by using the WixNetFxExtension and referencing one of the NetFxAsPrereq package groups.", compileResult.Messages[0].ToString()); | 182 | WixAssert.CompareLineByLine(new[] |
183 | { | ||
184 | "The WixManagedBootstrapperApplicationHost element has been deprecated.", | ||
185 | }, compileResult.Messages.Select(m => m.ToString()).ToArray()); | ||
186 | Assert.Equal(1130, compileResult.ExitCode); | ||
181 | 187 | ||
182 | Assert.False(File.Exists(bundleFile)); | 188 | Assert.False(File.Exists(bundleFile)); |
183 | Assert.False(File.Exists(Path.Combine(intermediateFolder, "test.exe"))); | 189 | Assert.False(File.Exists(Path.Combine(intermediateFolder, "test.exe"))); |
@@ -202,11 +208,13 @@ namespace WixToolsetTest.Bal | |||
202 | "-intermediateFolder", intermediateFolder, | 208 | "-intermediateFolder", intermediateFolder, |
203 | "-o", bundleFile, | 209 | "-o", bundleFile, |
204 | }); | 210 | }); |
211 | |||
205 | WixAssert.CompareLineByLine(new[] | 212 | WixAssert.CompareLineByLine(new[] |
206 | { | 213 | { |
207 | "When using DotNetCoreBootstrapperApplicationHost, the Payload element for the BA's entry point DLL must have bal:BAFactoryAssembly=\"yes\".", | 214 | "The WixDotNetCoreBootstrapperApplicationHost element has been deprecated.", |
215 | "The BootstrapperApplication element's Name or SourceFile attribute was not found; one of these is required." | ||
208 | }, compileResult.Messages.Select(x => x.ToString()).ToArray()); | 216 | }, compileResult.Messages.Select(x => x.ToString()).ToArray()); |
209 | Assert.Equal(6818, compileResult.ExitCode); | 217 | Assert.Equal(44, compileResult.ExitCode); |
210 | 218 | ||
211 | Assert.False(File.Exists(bundleFile)); | 219 | Assert.False(File.Exists(bundleFile)); |
212 | Assert.False(File.Exists(Path.Combine(intermediateFolder, "test.exe"))); | 220 | Assert.False(File.Exists(Path.Combine(intermediateFolder, "test.exe"))); |
diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/InternalUIBAFixture.cs b/src/ext/Bal/test/WixToolsetTest.Bal/InternalUIBAFixture.cs index 314bcd35..22e2fec1 100644 --- a/src/ext/Bal/test/WixToolsetTest.Bal/InternalUIBAFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.Bal/InternalUIBAFixture.cs | |||
@@ -45,8 +45,8 @@ namespace WixToolsetTest.Bal | |||
45 | "<WixBalPackageInfo PackageId='test.msi' PrimaryPackageType='default' />", | 45 | "<WixBalPackageInfo PackageId='test.msi' PrimaryPackageType='default' />", |
46 | }, balPackageInfos); | 46 | }, balPackageInfos); |
47 | 47 | ||
48 | Assert.True(File.Exists(Path.Combine(baFolderPath, "mbapreq.thm"))); | 48 | Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); |
49 | Assert.True(File.Exists(Path.Combine(baFolderPath, "mbapreq.wxl"))); | 49 | Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); |
50 | } | 50 | } |
51 | } | 51 | } |
52 | 52 | ||
@@ -84,14 +84,14 @@ namespace WixToolsetTest.Bal | |||
84 | "<WixBalPackageInfo PackageId='test.msi' PrimaryPackageType='default' />", | 84 | "<WixBalPackageInfo PackageId='test.msi' PrimaryPackageType='default' />", |
85 | }, balPackageInfos); | 85 | }, balPackageInfos); |
86 | 86 | ||
87 | var mbaPrereqInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixMbaPrereqInformation"); | 87 | var mbaPrereqInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPrereqInformation"); |
88 | WixAssert.CompareLineByLine(new[] | 88 | WixAssert.CompareLineByLine(new[] |
89 | { | 89 | { |
90 | "<WixMbaPrereqInformation PackageId='wixnative.exe' LicenseUrl='https://www.mysite.com/prereqterms' />", | 90 | "<WixPrereqInformation PackageId='wixnative.exe' LicenseUrl='https://www.mysite.com/prereqterms' />", |
91 | }, mbaPrereqInfos); | 91 | }, mbaPrereqInfos); |
92 | 92 | ||
93 | Assert.True(File.Exists(Path.Combine(baFolderPath, "mbapreq.thm"))); | 93 | Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); |
94 | Assert.True(File.Exists(Path.Combine(baFolderPath, "mbapreq.wxl"))); | 94 | Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); |
95 | } | 95 | } |
96 | } | 96 | } |
97 | 97 | ||
@@ -129,14 +129,14 @@ namespace WixToolsetTest.Bal | |||
129 | "<WixBalPackageInfo PackageId='test.msi' PrimaryPackageType='default' />", | 129 | "<WixBalPackageInfo PackageId='test.msi' PrimaryPackageType='default' />", |
130 | }, balPackageInfos); | 130 | }, balPackageInfos); |
131 | 131 | ||
132 | var mbaPrereqInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixMbaPrereqInformation"); | 132 | var mbaPrereqInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPrereqInformation"); |
133 | WixAssert.CompareLineByLine(new[] | 133 | WixAssert.CompareLineByLine(new[] |
134 | { | 134 | { |
135 | "<WixMbaPrereqInformation PackageId='wixnative.exe' />", | 135 | "<WixPrereqInformation PackageId='wixnative.exe' />", |
136 | }, mbaPrereqInfos); | 136 | }, mbaPrereqInfos); |
137 | 137 | ||
138 | Assert.True(File.Exists(Path.Combine(baFolderPath, "mbapreq.thm"))); | 138 | Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); |
139 | Assert.True(File.Exists(Path.Combine(baFolderPath, "mbapreq.wxl"))); | 139 | Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); |
140 | } | 140 | } |
141 | } | 141 | } |
142 | 142 | ||
@@ -183,14 +183,14 @@ namespace WixToolsetTest.Bal | |||
183 | "<WixBalPackageInfo PackageId='test.msi' DisplayInternalUICondition='DISPLAYTEST' PrimaryPackageType='default' />", | 183 | "<WixBalPackageInfo PackageId='test.msi' DisplayInternalUICondition='DISPLAYTEST' PrimaryPackageType='default' />", |
184 | }, balPackageInfos); | 184 | }, balPackageInfos); |
185 | 185 | ||
186 | var mbaPrereqInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixMbaPrereqInformation"); | 186 | var mbaPrereqInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPrereqInformation"); |
187 | WixAssert.CompareLineByLine(new[] | 187 | WixAssert.CompareLineByLine(new[] |
188 | { | 188 | { |
189 | "<WixMbaPrereqInformation PackageId='wixnative.exe' />", | 189 | "<WixPrereqInformation PackageId='wixnative.exe' />", |
190 | }, mbaPrereqInfos); | 190 | }, mbaPrereqInfos); |
191 | 191 | ||
192 | Assert.True(File.Exists(Path.Combine(baFolderPath, "mbapreq.thm"))); | 192 | Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); |
193 | Assert.True(File.Exists(Path.Combine(baFolderPath, "mbapreq.wxl"))); | 193 | Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); |
194 | } | 194 | } |
195 | } | 195 | } |
196 | 196 | ||
diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/TestData/.Data/fake.exe b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/.Data/fake.exe new file mode 100644 index 00000000..f27639e9 --- /dev/null +++ b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/.Data/fake.exe | |||
@@ -0,0 +1 @@ | |||
This is fake.exe \ No newline at end of file | |||
diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/TestData/MBA/Bundle.wxs b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/MBA/Bundle.wxs index ba1aefba..59be4bd4 100644 --- a/src/ext/Bal/test/WixToolsetTest.Bal/TestData/MBA/Bundle.wxs +++ b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/MBA/Bundle.wxs | |||
@@ -2,7 +2,7 @@ | |||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" |
3 | xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 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"> | 4 | <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2"> |
5 | <BootstrapperApplication> | 5 | <BootstrapperApplication SourceFile="fake.exe"> |
6 | <bal:WixManagedBootstrapperApplicationHost /> | 6 | <bal:WixManagedBootstrapperApplicationHost /> |
7 | </BootstrapperApplication> | 7 | </BootstrapperApplication> |
8 | <Chain> | 8 | <Chain> |