diff options
Diffstat (limited to 'src/ext/Bal/test')
61 files changed, 256 insertions, 1010 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> |
diff --git a/src/ext/Bal/test/WixToolsetTest.Dnc.HostGenerator/CSharpSourceGeneratorVerifier.cs b/src/ext/Bal/test/WixToolsetTest.Dnc.HostGenerator/CSharpSourceGeneratorVerifier.cs deleted file mode 100644 index 27729ac8..00000000 --- a/src/ext/Bal/test/WixToolsetTest.Dnc.HostGenerator/CSharpSourceGeneratorVerifier.cs +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolsetTest.Dnc.HostGenerator | ||
4 | { | ||
5 | using System; | ||
6 | using System.Collections.Immutable; | ||
7 | using Microsoft.CodeAnalysis; | ||
8 | using Microsoft.CodeAnalysis.CSharp; | ||
9 | using Microsoft.CodeAnalysis.CSharp.Testing; | ||
10 | using Microsoft.CodeAnalysis.Testing.Verifiers; | ||
11 | |||
12 | public static class CSharpSourceGeneratorVerifier<TSourceGenerator> | ||
13 | where TSourceGenerator : ISourceGenerator, new() | ||
14 | { | ||
15 | public class Test : CSharpSourceGeneratorTest<TSourceGenerator, XUnitVerifier> | ||
16 | { | ||
17 | public Test() | ||
18 | { | ||
19 | } | ||
20 | |||
21 | protected override CompilationOptions CreateCompilationOptions() | ||
22 | { | ||
23 | var compilationOptions = base.CreateCompilationOptions(); | ||
24 | return compilationOptions.WithSpecificDiagnosticOptions( | ||
25 | compilationOptions.SpecificDiagnosticOptions.SetItems(GetNullableWarningsFromCompiler())); | ||
26 | } | ||
27 | |||
28 | public LanguageVersion LanguageVersion { get; set; } = LanguageVersion.Default; | ||
29 | |||
30 | private static ImmutableDictionary<string, ReportDiagnostic> GetNullableWarningsFromCompiler() | ||
31 | { | ||
32 | string[] args = { "/warnaserror:nullable" }; | ||
33 | var commandLineArguments = CSharpCommandLineParser.Default.Parse(args, baseDirectory: Environment.CurrentDirectory, sdkDirectory: Environment.CurrentDirectory); | ||
34 | var nullableWarnings = commandLineArguments.CompilationOptions.SpecificDiagnosticOptions; | ||
35 | |||
36 | return nullableWarnings; | ||
37 | } | ||
38 | |||
39 | protected override ParseOptions CreateParseOptions() | ||
40 | { | ||
41 | return ((CSharpParseOptions)base.CreateParseOptions()).WithLanguageVersion(this.LanguageVersion); | ||
42 | } | ||
43 | } | ||
44 | } | ||
45 | } | ||
diff --git a/src/ext/Bal/test/WixToolsetTest.Dnc.HostGenerator/DncHostGeneratorTests.cs b/src/ext/Bal/test/WixToolsetTest.Dnc.HostGenerator/DncHostGeneratorTests.cs deleted file mode 100644 index ae55b2b5..00000000 --- a/src/ext/Bal/test/WixToolsetTest.Dnc.HostGenerator/DncHostGeneratorTests.cs +++ /dev/null | |||
@@ -1,91 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolsetTest.Dnc.HostGenerator | ||
4 | { | ||
5 | using System; | ||
6 | using System.Text; | ||
7 | using System.Threading.Tasks; | ||
8 | using Microsoft.CodeAnalysis; | ||
9 | using Microsoft.CodeAnalysis.Testing; | ||
10 | using Microsoft.CodeAnalysis.Text; | ||
11 | using WixToolset.Dnc.HostGenerator; | ||
12 | using WixToolset.Mba.Core; | ||
13 | using Xunit; | ||
14 | |||
15 | using VerifyCS = CSharpSourceGeneratorVerifier<WixToolset.Dnc.HostGenerator.DncHostGenerator>; | ||
16 | |||
17 | public class DncHostGeneratorTests | ||
18 | { | ||
19 | static readonly MetadataReference MbaCoreAssembly = MetadataReference.CreateFromFile(typeof(BootstrapperApplicationFactoryAttribute).Assembly.Location); | ||
20 | |||
21 | // https://github.com/dotnet/roslyn/blob/main/docs/features/source-generators.cookbook.md#unit-testing-of-generators | ||
22 | [Fact] | ||
23 | public async Task FailsBuildWhenMissingAttribute() | ||
24 | { | ||
25 | var code = @" | ||
26 | //[assembly: WixToolset.Mba.Core.BootstrapperApplicationFactory(typeof(Test.BAFactory))] | ||
27 | namespace Test | ||
28 | { | ||
29 | using WixToolset.Mba.Core; | ||
30 | |||
31 | public class BAFactory : BaseBootstrapperApplicationFactory | ||
32 | { | ||
33 | protected override IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand) | ||
34 | { | ||
35 | return null; | ||
36 | } | ||
37 | } | ||
38 | } | ||
39 | "; | ||
40 | |||
41 | await new VerifyCS.Test | ||
42 | { | ||
43 | TestState = | ||
44 | { | ||
45 | Sources = { code }, | ||
46 | ReferenceAssemblies = ReferenceAssemblies.Net.Net60, | ||
47 | AdditionalReferences = { MbaCoreAssembly }, | ||
48 | ExpectedDiagnostics = | ||
49 | { | ||
50 | new DiagnosticResult(DncHostGenerator.MissingFactoryAttributeDescriptor), | ||
51 | }, | ||
52 | }, | ||
53 | }.RunAsync(); | ||
54 | } | ||
55 | |||
56 | [Fact] | ||
57 | public async Task GeneratesEntryPoint() | ||
58 | { | ||
59 | var code = @" | ||
60 | [assembly: WixToolset.Mba.Core.BootstrapperApplicationFactory(typeof(Test.BAFactory))] | ||
61 | namespace Test | ||
62 | { | ||
63 | using WixToolset.Mba.Core; | ||
64 | |||
65 | public class BAFactory : BaseBootstrapperApplicationFactory | ||
66 | { | ||
67 | protected override IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand) | ||
68 | { | ||
69 | return null; | ||
70 | } | ||
71 | } | ||
72 | } | ||
73 | "; | ||
74 | var generated = String.Format(DncHostGenerator.Template, DncHostGenerator.Version, "Test.BAFactory"); | ||
75 | |||
76 | await new VerifyCS.Test | ||
77 | { | ||
78 | TestState = | ||
79 | { | ||
80 | Sources = { code }, | ||
81 | GeneratedSources = | ||
82 | { | ||
83 | (typeof(DncHostGenerator), "WixToolset.Dnc.Host.g.cs", SourceText.From(generated, Encoding.UTF8, SourceHashAlgorithm.Sha256)), | ||
84 | }, | ||
85 | ReferenceAssemblies = ReferenceAssemblies.Net.Net60, | ||
86 | AdditionalReferences = { MbaCoreAssembly }, | ||
87 | }, | ||
88 | }.RunAsync(); | ||
89 | } | ||
90 | } | ||
91 | } | ||
diff --git a/src/ext/Bal/test/WixToolsetTest.Dnc.HostGenerator/WixToolsetTest.Dnc.HostGenerator.csproj b/src/ext/Bal/test/WixToolsetTest.Dnc.HostGenerator/WixToolsetTest.Dnc.HostGenerator.csproj deleted file mode 100644 index 1cbf702d..00000000 --- a/src/ext/Bal/test/WixToolsetTest.Dnc.HostGenerator/WixToolsetTest.Dnc.HostGenerator.csproj +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
3 | |||
4 | <Project Sdk="Microsoft.NET.Sdk"> | ||
5 | <PropertyGroup> | ||
6 | <TargetFramework>net6.0</TargetFramework> | ||
7 | <IsWixTestProject>true</IsWixTestProject> | ||
8 | </PropertyGroup> | ||
9 | |||
10 | <ItemGroup> | ||
11 | <ProjectReference Include="..\..\WixToolset.Dnc.HostGenerator\WixToolset.Dnc.HostGenerator.csproj" /> | ||
12 | </ItemGroup> | ||
13 | |||
14 | <ItemGroup> | ||
15 | <PackageReference Include="WixInternal.TestSupport" /> | ||
16 | <PackageReference Include="WixToolset.Mba.Core" /> | ||
17 | </ItemGroup> | ||
18 | |||
19 | <ItemGroup> | ||
20 | <PackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.XUnit" /> | ||
21 | <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" /> | ||
22 | </ItemGroup> | ||
23 | </Project> | ||
diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/DncHostFixture.cs b/src/ext/Bal/test/WixToolsetTest.ManagedHost/DncHostFixture.cs deleted file mode 100644 index fe644d2d..00000000 --- a/src/ext/Bal/test/WixToolsetTest.ManagedHost/DncHostFixture.cs +++ /dev/null | |||
@@ -1,285 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolsetTest.ManagedHost | ||
4 | { | ||
5 | using System; | ||
6 | using WixInternal.TestSupport; | ||
7 | using WixInternal.TestSupport.XunitExtensions; | ||
8 | using Xunit; | ||
9 | |||
10 | public class DncHostFixture | ||
11 | { | ||
12 | static readonly string bundleBasePath = TestData.Get("..", "examples"); | ||
13 | |||
14 | [Fact] | ||
15 | public void CanLoadFDDEarliestCoreMBA() | ||
16 | { | ||
17 | using (var fs = new DisposableFileSystem()) | ||
18 | { | ||
19 | var baseFolder = fs.GetFolder(); | ||
20 | var bundleFile = TestData.Get(bundleBasePath, "EarliestCoreBundleFDD.exe"); | ||
21 | var testEngine = new TestEngine(); | ||
22 | |||
23 | var result = testEngine.RunShutdownEngine(bundleFile, baseFolder); | ||
24 | WixAssert.CompareLineByLine(new[] | ||
25 | { | ||
26 | "Loading .NET Core FDD bootstrapper application.", | ||
27 | "Creating BA thread to run asynchronously.", | ||
28 | "EarliestCoreBA", | ||
29 | "Shutdown,ReloadBootstrapper,0", | ||
30 | }, result.Output.ToArray()); | ||
31 | } | ||
32 | } | ||
33 | |||
34 | [SkippableFact] | ||
35 | public void CanLoadFDDx86EarliestCoreMBA() | ||
36 | { | ||
37 | // https://github.com/microsoft/vstest/issues/3586 | ||
38 | Environment.SetEnvironmentVariable("DOTNET_ROOT", null); | ||
39 | |||
40 | using (var fs = new DisposableFileSystem()) | ||
41 | { | ||
42 | var baseFolder = fs.GetFolder(); | ||
43 | var bundleFile = TestData.Get(bundleBasePath, "EarliestCoreBundleFDDx86.exe"); | ||
44 | var testEngine = new TestEngine(); | ||
45 | |||
46 | var result = testEngine.RunShutdownEngine(bundleFile, baseFolder, x86: true); | ||
47 | var resultOutput = result.Output.ToArray(); | ||
48 | |||
49 | if (resultOutput.Length > 0 && (resultOutput[0] == "error from hostfxr: It was not possible to find any compatible framework version" || | ||
50 | resultOutput[0] == "error from hostfxr: You must install or update .NET to run this application.")) | ||
51 | { | ||
52 | WixAssert.Skip(String.Join(Environment.NewLine, resultOutput)); | ||
53 | } | ||
54 | |||
55 | WixAssert.CompareLineByLine(new[] | ||
56 | { | ||
57 | "Loading .NET Core FDD bootstrapper application.", | ||
58 | "Creating BA thread to run asynchronously.", | ||
59 | "EarliestCoreBA", | ||
60 | "Shutdown,ReloadBootstrapper,0", | ||
61 | }, resultOutput); | ||
62 | } | ||
63 | } | ||
64 | |||
65 | [Fact] | ||
66 | public void CanLoadSCDEarliestCoreMBA() | ||
67 | { | ||
68 | using (var fs = new DisposableFileSystem()) | ||
69 | { | ||
70 | var baseFolder = fs.GetFolder(); | ||
71 | var bundleFile = TestData.Get(bundleBasePath, "EarliestCoreBundleSCD.exe"); | ||
72 | var testEngine = new TestEngine(); | ||
73 | |||
74 | var result = testEngine.RunShutdownEngine(bundleFile, baseFolder); | ||
75 | WixAssert.CompareLineByLine(new[] | ||
76 | { | ||
77 | "Loading .NET Core SCD bootstrapper application.", | ||
78 | "Creating BA thread to run asynchronously.", | ||
79 | "EarliestCoreBA", | ||
80 | "Shutdown,ReloadBootstrapper,0", | ||
81 | }, result.Output.ToArray()); | ||
82 | } | ||
83 | } | ||
84 | |||
85 | [Fact] | ||
86 | public void CanLoadTrimmedSCDEarliestCoreMBA() | ||
87 | { | ||
88 | using (var fs = new DisposableFileSystem()) | ||
89 | { | ||
90 | var baseFolder = fs.GetFolder(); | ||
91 | var bundleFile = TestData.Get(bundleBasePath, "EarliestCoreBundleTrimmedSCD.exe"); | ||
92 | var testEngine = new TestEngine(); | ||
93 | |||
94 | var result = testEngine.RunShutdownEngine(bundleFile, baseFolder); | ||
95 | WixAssert.CompareLineByLine(new[] | ||
96 | { | ||
97 | "Loading .NET Core SCD bootstrapper application.", | ||
98 | "Creating BA thread to run asynchronously.", | ||
99 | "EarliestCoreBA", | ||
100 | "Shutdown,ReloadBootstrapper,0", | ||
101 | }, result.Output.ToArray()); | ||
102 | } | ||
103 | } | ||
104 | |||
105 | [Fact] | ||
106 | public void CanReloadSCDEarliestCoreMBA() | ||
107 | { | ||
108 | using (var fs = new DisposableFileSystem()) | ||
109 | { | ||
110 | var baseFolder = fs.GetFolder(); | ||
111 | var bundleFile = TestData.Get(bundleBasePath, "EarliestCoreBundleSCD.exe"); | ||
112 | var testEngine = new TestEngine(); | ||
113 | |||
114 | var result = testEngine.RunReloadEngine(bundleFile, baseFolder); | ||
115 | WixAssert.CompareLineByLine(new[] | ||
116 | { | ||
117 | "Loading .NET Core SCD bootstrapper application.", | ||
118 | "Creating BA thread to run asynchronously.", | ||
119 | "EarliestCoreBA", | ||
120 | "Shutdown,ReloadBootstrapper,0", | ||
121 | "Loading .NET Core SCD bootstrapper application.", | ||
122 | "Reloaded 1 time(s)", // dnchost doesn't currently support unloading | ||
123 | "Creating BA thread to run asynchronously.", | ||
124 | "EarliestCoreBA", | ||
125 | "Shutdown,Restart,0", | ||
126 | |||
127 | }, result.Output.ToArray()); | ||
128 | } | ||
129 | } | ||
130 | |||
131 | [Fact] | ||
132 | public void CanLoadFDDLatestCoreMBA() | ||
133 | { | ||
134 | using (var fs = new DisposableFileSystem()) | ||
135 | { | ||
136 | var baseFolder = fs.GetFolder(); | ||
137 | var bundleFile = TestData.Get(bundleBasePath, "LatestCoreBundleFDD.exe"); | ||
138 | var testEngine = new TestEngine(); | ||
139 | |||
140 | var result = testEngine.RunShutdownEngine(bundleFile, baseFolder); | ||
141 | WixAssert.CompareLineByLine(new[] | ||
142 | { | ||
143 | "Loading .NET Core FDD bootstrapper application.", | ||
144 | "Creating BA thread to run asynchronously.", | ||
145 | "LatestCoreBA", | ||
146 | "Shutdown,ReloadBootstrapper,0", | ||
147 | }, result.Output.ToArray()); | ||
148 | } | ||
149 | } | ||
150 | |||
151 | [Fact] | ||
152 | public void CanLoadFDDx86LatestCoreMBA() | ||
153 | { | ||
154 | // https://github.com/microsoft/vstest/issues/3586 | ||
155 | Environment.SetEnvironmentVariable("DOTNET_ROOT", null); | ||
156 | |||
157 | using (var fs = new DisposableFileSystem()) | ||
158 | { | ||
159 | var baseFolder = fs.GetFolder(); | ||
160 | var bundleFile = TestData.Get(bundleBasePath, "LatestCoreBundleFDDx86.exe"); | ||
161 | var testEngine = new TestEngine(); | ||
162 | |||
163 | var result = testEngine.RunShutdownEngine(bundleFile, baseFolder, x86: true); | ||
164 | WixAssert.CompareLineByLine(new[] | ||
165 | { | ||
166 | "Loading .NET Core FDD bootstrapper application.", | ||
167 | "Creating BA thread to run asynchronously.", | ||
168 | "LatestCoreBA", | ||
169 | "Shutdown,ReloadBootstrapper,0", | ||
170 | }, result.Output.ToArray()); | ||
171 | } | ||
172 | } | ||
173 | |||
174 | [Fact] | ||
175 | public void CanReloadFDDLatestCoreMBA() | ||
176 | { | ||
177 | using (var fs = new DisposableFileSystem()) | ||
178 | { | ||
179 | var baseFolder = fs.GetFolder(); | ||
180 | var bundleFile = TestData.Get(bundleBasePath, "LatestCoreBundleFDD.exe"); | ||
181 | var testEngine = new TestEngine(); | ||
182 | |||
183 | var result = testEngine.RunReloadEngine(bundleFile, baseFolder); | ||
184 | WixAssert.CompareLineByLine(new[] | ||
185 | { | ||
186 | "Loading .NET Core FDD bootstrapper application.", | ||
187 | "Creating BA thread to run asynchronously.", | ||
188 | "LatestCoreBA", | ||
189 | "Shutdown,ReloadBootstrapper,0", | ||
190 | "Loading .NET Core FDD bootstrapper application.", | ||
191 | "Reloaded 1 time(s)", // dnchost doesn't currently support unloading | ||
192 | "Creating BA thread to run asynchronously.", | ||
193 | "LatestCoreBA", | ||
194 | "Shutdown,Restart,0", | ||
195 | }, result.Output.ToArray()); | ||
196 | } | ||
197 | } | ||
198 | |||
199 | [Fact] | ||
200 | public void CanLoadSCDLatestCoreMBA() | ||
201 | { | ||
202 | using (var fs = new DisposableFileSystem()) | ||
203 | { | ||
204 | var baseFolder = fs.GetFolder(); | ||
205 | var bundleFile = TestData.Get(bundleBasePath, "LatestCoreBundleSCD.exe"); | ||
206 | var testEngine = new TestEngine(); | ||
207 | |||
208 | var result = testEngine.RunShutdownEngine(bundleFile, baseFolder); | ||
209 | WixAssert.CompareLineByLine(new[] | ||
210 | { | ||
211 | "Loading .NET Core SCD bootstrapper application.", | ||
212 | "Creating BA thread to run asynchronously.", | ||
213 | "LatestCoreBA", | ||
214 | "Shutdown,ReloadBootstrapper,0", | ||
215 | }, result.Output.ToArray()); | ||
216 | var logMessages = result.Output; | ||
217 | } | ||
218 | } | ||
219 | |||
220 | [Fact] | ||
221 | public void CanLoadTrimmedSCDLatestCoreMBA() | ||
222 | { | ||
223 | using (var fs = new DisposableFileSystem()) | ||
224 | { | ||
225 | var baseFolder = fs.GetFolder(); | ||
226 | var bundleFile = TestData.Get(bundleBasePath, "LatestCoreBundleTrimmedSCD.exe"); | ||
227 | var testEngine = new TestEngine(); | ||
228 | |||
229 | var result = testEngine.RunShutdownEngine(bundleFile, baseFolder); | ||
230 | WixAssert.CompareLineByLine(new[] | ||
231 | { | ||
232 | "Loading .NET Core SCD bootstrapper application.", | ||
233 | "Creating BA thread to run asynchronously.", | ||
234 | "LatestCoreBA", | ||
235 | "Shutdown,ReloadBootstrapper,0", | ||
236 | }, result.Output.ToArray()); | ||
237 | } | ||
238 | } | ||
239 | |||
240 | [Fact] | ||
241 | public void CanReloadSCDLatestCoreMBA() | ||
242 | { | ||
243 | using (var fs = new DisposableFileSystem()) | ||
244 | { | ||
245 | var baseFolder = fs.GetFolder(); | ||
246 | var bundleFile = TestData.Get(bundleBasePath, "LatestCoreBundleSCD.exe"); | ||
247 | var testEngine = new TestEngine(); | ||
248 | |||
249 | var result = testEngine.RunReloadEngine(bundleFile, baseFolder); | ||
250 | WixAssert.CompareLineByLine(new[] | ||
251 | { | ||
252 | "Loading .NET Core SCD bootstrapper application.", | ||
253 | "Creating BA thread to run asynchronously.", | ||
254 | "LatestCoreBA", | ||
255 | "Shutdown,ReloadBootstrapper,0", | ||
256 | "Loading .NET Core SCD bootstrapper application.", | ||
257 | "Reloaded 1 time(s)", // dnchost doesn't currently support unloading | ||
258 | "Creating BA thread to run asynchronously.", | ||
259 | "LatestCoreBA", | ||
260 | "Shutdown,Restart,0", | ||
261 | }, result.Output.ToArray()); | ||
262 | } | ||
263 | } | ||
264 | |||
265 | [Fact] | ||
266 | public void CanLoadFDDWPFCoreMBA() | ||
267 | { | ||
268 | using (var fs = new DisposableFileSystem()) | ||
269 | { | ||
270 | var baseFolder = fs.GetFolder(); | ||
271 | var bundleFile = TestData.Get(bundleBasePath, "WPFCoreBundleFDD.exe"); | ||
272 | var testEngine = new TestEngine(); | ||
273 | |||
274 | var result = testEngine.RunShutdownEngine(bundleFile, baseFolder); | ||
275 | WixAssert.CompareLineByLine(new[] | ||
276 | { | ||
277 | "Loading .NET Core FDD bootstrapper application.", | ||
278 | "Creating BA thread to run asynchronously.", | ||
279 | "WPFCoreBA", | ||
280 | "Shutdown,ReloadBootstrapper,0", | ||
281 | }, result.Output.ToArray()); | ||
282 | } | ||
283 | } | ||
284 | } | ||
285 | } | ||
diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/MbaHostFixture.cs b/src/ext/Bal/test/WixToolsetTest.ManagedHost/MbaHostFixture.cs deleted file mode 100644 index 6f7709b5..00000000 --- a/src/ext/Bal/test/WixToolsetTest.ManagedHost/MbaHostFixture.cs +++ /dev/null | |||
@@ -1,100 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolsetTest.ManagedHost | ||
4 | { | ||
5 | using WixInternal.TestSupport; | ||
6 | using Xunit; | ||
7 | |||
8 | public class MbaHostFixture | ||
9 | { | ||
10 | static readonly string bundleBasePath = TestData.Get("..", "examples"); | ||
11 | |||
12 | [Fact] | ||
13 | public void CanLoadFullFramework2MBA() | ||
14 | { | ||
15 | using (var fs = new DisposableFileSystem()) | ||
16 | { | ||
17 | var baseFolder = fs.GetFolder(); | ||
18 | var bundleFile = TestData.Get(bundleBasePath, "FullFramework2Bundle.exe"); | ||
19 | var testEngine = new TestEngine(); | ||
20 | |||
21 | var result = testEngine.RunShutdownEngine(bundleFile, baseFolder); | ||
22 | WixAssert.CompareLineByLine(new[] | ||
23 | { | ||
24 | "Loading managed bootstrapper application.", | ||
25 | "Creating BA thread to run asynchronously.", | ||
26 | "FullFramework2BA", | ||
27 | "Shutdown,ReloadBootstrapper,0", | ||
28 | }, result.Output.ToArray()); | ||
29 | } | ||
30 | } | ||
31 | |||
32 | [Fact] | ||
33 | public void CanLoadFullFramework4MBA() | ||
34 | { | ||
35 | using (var fs = new DisposableFileSystem()) | ||
36 | { | ||
37 | var baseFolder = fs.GetFolder(); | ||
38 | var bundleFile = TestData.Get(bundleBasePath, "FullFramework4Bundle.exe"); | ||
39 | var testEngine = new TestEngine(); | ||
40 | |||
41 | var result = testEngine.RunShutdownEngine(bundleFile, baseFolder); | ||
42 | WixAssert.CompareLineByLine(new[] | ||
43 | { | ||
44 | "Loading managed bootstrapper application.", | ||
45 | "Creating BA thread to run asynchronously.", | ||
46 | "FullFramework4BA", | ||
47 | "Shutdown,ReloadBootstrapper,0", | ||
48 | }, result.Output.ToArray()); | ||
49 | } | ||
50 | } | ||
51 | |||
52 | [Fact] | ||
53 | public void CanReloadFullFramework2MBA() | ||
54 | { | ||
55 | using (var fs = new DisposableFileSystem()) | ||
56 | { | ||
57 | var baseFolder = fs.GetFolder(); | ||
58 | var bundleFile = TestData.Get(bundleBasePath, "FullFramework2Bundle.exe"); | ||
59 | var testEngine = new TestEngine(); | ||
60 | |||
61 | var result = testEngine.RunReloadEngine(bundleFile, baseFolder); | ||
62 | WixAssert.CompareLineByLine(new[] | ||
63 | { | ||
64 | "Loading managed bootstrapper application.", | ||
65 | "Creating BA thread to run asynchronously.", | ||
66 | "FullFramework2BA", | ||
67 | "Shutdown,ReloadBootstrapper,0", | ||
68 | "Loading managed bootstrapper application.", | ||
69 | "Creating BA thread to run asynchronously.", | ||
70 | "FullFramework2BA", | ||
71 | "Shutdown,Restart,0", | ||
72 | }, result.Output.ToArray()); | ||
73 | } | ||
74 | } | ||
75 | |||
76 | [Fact] | ||
77 | public void CanReloadFullFramework4MBA() | ||
78 | { | ||
79 | using (var fs = new DisposableFileSystem()) | ||
80 | { | ||
81 | var baseFolder = fs.GetFolder(); | ||
82 | var bundleFile = TestData.Get(bundleBasePath, "FullFramework4Bundle.exe"); | ||
83 | var testEngine = new TestEngine(); | ||
84 | |||
85 | var result = testEngine.RunReloadEngine(bundleFile, baseFolder); | ||
86 | WixAssert.CompareLineByLine(new[] | ||
87 | { | ||
88 | "Loading managed bootstrapper application.", | ||
89 | "Creating BA thread to run asynchronously.", | ||
90 | "FullFramework4BA", | ||
91 | "Shutdown,ReloadBootstrapper,0", | ||
92 | "Loading managed bootstrapper application.", | ||
93 | "Creating BA thread to run asynchronously.", | ||
94 | "FullFramework4BA", | ||
95 | "Shutdown,Restart,0", | ||
96 | }, result.Output.ToArray()); | ||
97 | } | ||
98 | } | ||
99 | } | ||
100 | } | ||
diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/README.md b/src/ext/Bal/test/WixToolsetTest.ManagedHost/README.md deleted file mode 100644 index cbec1387..00000000 --- a/src/ext/Bal/test/WixToolsetTest.ManagedHost/README.md +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | In order to properly test dnchost and mbahost, | ||
2 | the managed BAs need to be published and a bundle needs to be built for each scenario. | ||
3 | Making this happen on every build for the solution takes too long, | ||
4 | so this project relies on manually running devbuild.cmd to publish everything before the tests can be run. | ||
5 | devbuild.cmd needs to be ran again every time changes are made in other projects. \ No newline at end of file | ||
diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngine.cs b/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngine.cs deleted file mode 100644 index 8be62e92..00000000 --- a/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngine.cs +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolsetTest.ManagedHost | ||
4 | { | ||
5 | using System; | ||
6 | using System.Collections.Generic; | ||
7 | using System.Diagnostics; | ||
8 | using System.IO; | ||
9 | using WixInternal.TestSupport; | ||
10 | using WixInternal.Core.TestPackage; | ||
11 | |||
12 | public class TestEngine | ||
13 | { | ||
14 | private static readonly string TestEngineFile = TestData.Get(@"..\x64\examples\Example.TestEngine\Example.TestEngine.exe"); | ||
15 | private static readonly string TestEngineFileX86 = TestData.Get(@"..\x86\examples\Example.TestEngine\Example.TestEngine.exe"); | ||
16 | |||
17 | public TestEngineResult RunReloadEngine(string bundleFilePath, string tempFolderPath, bool x86 = false) | ||
18 | { | ||
19 | return this.RunTestEngine("reload", bundleFilePath, tempFolderPath, x86); | ||
20 | } | ||
21 | |||
22 | public TestEngineResult RunShutdownEngine(string bundleFilePath, string tempFolderPath, bool x86 = false) | ||
23 | { | ||
24 | return this.RunTestEngine("shutdown", bundleFilePath, tempFolderPath, x86); | ||
25 | } | ||
26 | |||
27 | private TestEngineResult RunTestEngine(string engineMode, string bundleFilePath, string tempFolderPath, bool x86 = false) | ||
28 | { | ||
29 | var baFolderPath = Path.Combine(tempFolderPath, "ba"); | ||
30 | var extractFolderPath = Path.Combine(tempFolderPath, "extract"); | ||
31 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFilePath, baFolderPath, extractFolderPath); | ||
32 | extractResult.AssertSuccess(); | ||
33 | |||
34 | var args = new string[] { | ||
35 | engineMode, | ||
36 | '"' + bundleFilePath + '"', | ||
37 | '"' + extractResult.GetBAFilePath(baFolderPath) + '"', | ||
38 | }; | ||
39 | return RunProcessCaptureOutput(x86 ? TestEngineFileX86 : TestEngineFile, args); | ||
40 | } | ||
41 | |||
42 | private static TestEngineResult RunProcessCaptureOutput(string executablePath, string[] arguments = null, string workingFolder = null) | ||
43 | { | ||
44 | var startInfo = new ProcessStartInfo(executablePath) | ||
45 | { | ||
46 | Arguments = String.Join(' ', arguments), | ||
47 | CreateNoWindow = true, | ||
48 | RedirectStandardError = true, | ||
49 | RedirectStandardOutput = true, | ||
50 | UseShellExecute = false, | ||
51 | WorkingDirectory = workingFolder, | ||
52 | }; | ||
53 | |||
54 | var exitCode = 0; | ||
55 | var output = new List<string>(); | ||
56 | |||
57 | using (var process = Process.Start(startInfo)) | ||
58 | { | ||
59 | process.OutputDataReceived += (s, e) => { if (e.Data != null) { output.Add(e.Data); } }; | ||
60 | process.ErrorDataReceived += (s, e) => { if (e.Data != null) { output.Add(e.Data); } }; | ||
61 | |||
62 | process.BeginErrorReadLine(); | ||
63 | process.BeginOutputReadLine(); | ||
64 | |||
65 | process.WaitForExit(); | ||
66 | exitCode = process.ExitCode; | ||
67 | } | ||
68 | |||
69 | return new TestEngineResult | ||
70 | { | ||
71 | ExitCode = exitCode, | ||
72 | Output = output, | ||
73 | }; | ||
74 | } | ||
75 | } | ||
76 | } | ||
diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngineResult.cs b/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngineResult.cs deleted file mode 100644 index 63f6f7f5..00000000 --- a/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngineResult.cs +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolsetTest.ManagedHost | ||
4 | { | ||
5 | using System.Collections.Generic; | ||
6 | |||
7 | public class TestEngineResult | ||
8 | { | ||
9 | public int ExitCode { get; set; } | ||
10 | public List<string> Output { get; set; } | ||
11 | } | ||
12 | } | ||
diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj b/src/ext/Bal/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj deleted file mode 100644 index 9caf3aa6..00000000 --- a/src/ext/Bal/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
3 | |||
4 | <Project Sdk="Microsoft.NET.Sdk"> | ||
5 | <PropertyGroup> | ||
6 | <TargetFramework>net6.0</TargetFramework> | ||
7 | <IsWixTestProject>true</IsWixTestProject> | ||
8 | </PropertyGroup> | ||
9 | |||
10 | <ItemGroup> | ||
11 | <ProjectReference Include="..\examples\TestEngine\Example.TestEngine.vcxproj" Properties="Platform=ARM64" ReferenceOutputAssembly="false" /> | ||
12 | <ProjectReference Include="..\examples\TestEngine\Example.TestEngine.vcxproj" Properties="Platform=x86" ReferenceOutputAssembly="false" /> | ||
13 | <ProjectReference Include="..\examples\TestEngine\Example.TestEngine.vcxproj" Properties="Platform=x64" ReferenceOutputAssembly="false" /> | ||
14 | </ItemGroup> | ||
15 | |||
16 | <ItemGroup> | ||
17 | <PackageReference Include="WixInternal.Core.TestPackage" /> | ||
18 | </ItemGroup> | ||
19 | </Project> | ||
diff --git a/src/ext/Bal/test/examples/Directory.Build.props b/src/ext/Bal/test/examples/Directory.Build.props index 7f38564a..e7d65cdd 100644 --- a/src/ext/Bal/test/examples/Directory.Build.props +++ b/src/ext/Bal/test/examples/Directory.Build.props | |||
@@ -2,6 +2,5 @@ | |||
2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | 2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
3 | <Project> | 3 | <Project> |
4 | <Import Project="$(MsbuildThisFileDirectory)..\..\Directory.Build.props" /> | 4 | <Import Project="$(MsbuildThisFileDirectory)..\..\Directory.Build.props" /> |
5 | <Import Project="Directory.csproj.props" Condition=" '$(MSBuildProjectExtension)'=='.csproj' " /> | ||
6 | <Import Project="Directory.wixproj.props" Condition=" '$(MSBuildProjectExtension)'=='.wixproj' " /> | 5 | <Import Project="Directory.wixproj.props" Condition=" '$(MSBuildProjectExtension)'=='.wixproj' " /> |
7 | </Project> | 6 | </Project> |
diff --git a/src/ext/Bal/test/examples/Directory.Build.targets b/src/ext/Bal/test/examples/Directory.Build.targets index b27a1a41..3e9115e0 100644 --- a/src/ext/Bal/test/examples/Directory.Build.targets +++ b/src/ext/Bal/test/examples/Directory.Build.targets | |||
@@ -3,5 +3,4 @@ | |||
3 | <Project> | 3 | <Project> |
4 | <Import Project="$(MsbuildThisFileDirectory)..\..\..\..\Directory.Build.targets" /> | 4 | <Import Project="$(MsbuildThisFileDirectory)..\..\..\..\Directory.Build.targets" /> |
5 | <Import Project="Directory.wixproj.targets" Condition=" '$(MSBuildProjectExtension)'=='.wixproj' " /> | 5 | <Import Project="Directory.wixproj.targets" Condition=" '$(MSBuildProjectExtension)'=='.wixproj' " /> |
6 | <Import Project="DncBA.targets" Condition=" '$(IsDncBA)'=='true' " /> | ||
7 | </Project> | 6 | </Project> |
diff --git a/src/ext/Bal/test/examples/DncBA.targets b/src/ext/Bal/test/examples/DncBA.targets deleted file mode 100644 index 2b8c1428..00000000 --- a/src/ext/Bal/test/examples/DncBA.targets +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
3 | <Project> | ||
4 | <Import Project="$(MsbuildThisFileDirectory)..\..\WixToolset.Dnc.HostGenerator\build\WixToolset.Dnc.HostGenerator.targets" /> | ||
5 | |||
6 | <PropertyGroup> | ||
7 | <ILLinkTreatWarningsAsErrors>false</ILLinkTreatWarningsAsErrors> | ||
8 | </PropertyGroup> | ||
9 | |||
10 | <ItemGroup> | ||
11 | <ProjectReference Include="$(MsbuildThisFileDirectory)..\..\WixToolset.Dnc.HostGenerator\WixToolset.Dnc.HostGenerator.csproj" | ||
12 | OutputItemType="Analyzer" | ||
13 | ReferenceOutputAssembly="false" /> | ||
14 | </ItemGroup> | ||
15 | |||
16 | <ItemGroup> | ||
17 | <PackageReference Include="WixToolset.Mba.Core" /> | ||
18 | </ItemGroup> | ||
19 | </Project> | ||
diff --git a/src/ext/Bal/test/examples/EarliestCoreBundleFDD/FrameworkDependentBundle.wxs b/src/ext/Bal/test/examples/EarliestCoreBundleFDD/FrameworkDependentBundle.wxs index 116d5223..bb83568f 100644 --- a/src/ext/Bal/test/examples/EarliestCoreBundleFDD/FrameworkDependentBundle.wxs +++ b/src/ext/Bal/test/examples/EarliestCoreBundleFDD/FrameworkDependentBundle.wxs | |||
@@ -1,12 +1,12 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> |
2 | <Bundle Name="FDDEarliestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> | 2 | <Bundle Name="FDDEarliestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> |
3 | <BootstrapperApplication> | 3 | <BootstrapperApplication SourceFile="publish\Example.EarliestCoreMBA\fdd\Example.EarliestCoreMBA.exe"> |
4 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd\Example.EarliestCoreMBA.deps.json" Name="Example.EarliestCoreMBA.deps.json" /> | 4 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd\Example.EarliestCoreMBA.deps.json" Name="Example.EarliestCoreMBA.deps.json" /> |
5 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd\Example.EarliestCoreMBA.dll" Name="Example.EarliestCoreMBA.dll" bal:BAFactoryAssembly="yes" /> | 5 | <!-- <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd\Example.EarliestCoreMBA.dll" Name="Example.EarliestCoreMBA.dll" bal:BAFactoryAssembly="yes" /> --> |
6 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd\Example.EarliestCoreMBA.runtimeconfig.json" Name="Example.EarliestCoreMBA.runtimeconfig.json" /> | 6 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd\Example.EarliestCoreMBA.runtimeconfig.json" Name="Example.EarliestCoreMBA.runtimeconfig.json" /> |
7 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd\mbanative.dll" Name="mbanative.dll" /> | 7 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd\mbanative.dll" Name="mbanative.dll" /> |
8 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd\WixToolset.Mba.Core.dll" Name="WixToolset.Mba.Core.dll" /> | 8 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd\WixToolset.Mba.Core.dll" Name="WixToolset.Mba.Core.dll" /> |
9 | <bal:WixDotNetCoreBootstrapperApplicationHost /> | 9 | <!-- <bal:WixDotNetCoreBootstrapperApplicationHost /> --> |
10 | </BootstrapperApplication> | 10 | </BootstrapperApplication> |
11 | <Chain> | 11 | <Chain> |
12 | <ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" bal:PrereqPackage="yes" /> | 12 | <ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" bal:PrereqPackage="yes" /> |
diff --git a/src/ext/Bal/test/examples/EarliestCoreBundleFDDx86/FrameworkDependentBundle.wxs b/src/ext/Bal/test/examples/EarliestCoreBundleFDDx86/FrameworkDependentBundle.wxs index 3672fc1d..ca3d4cf0 100644 --- a/src/ext/Bal/test/examples/EarliestCoreBundleFDDx86/FrameworkDependentBundle.wxs +++ b/src/ext/Bal/test/examples/EarliestCoreBundleFDDx86/FrameworkDependentBundle.wxs | |||
@@ -1,12 +1,12 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> |
2 | <Bundle Name="FDDx86EarliestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="{3D4A29A0-8AAE-4831-A9CF-E34AC298097D}"> | 2 | <Bundle Name="FDDx86EarliestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="{3D4A29A0-8AAE-4831-A9CF-E34AC298097D}"> |
3 | <BootstrapperApplication> | 3 | <BootstrapperApplication SourceFile="publish\Example.EarliestCoreMBA\fdd-x86\Example.EarliestCoreMBA.exe"> |
4 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd-x86\Example.EarliestCoreMBA.deps.json" Name="Example.EarliestCoreMBA.deps.json" /> | 4 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd-x86\Example.EarliestCoreMBA.deps.json" Name="Example.EarliestCoreMBA.deps.json" /> |
5 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd-x86\Example.EarliestCoreMBA.dll" Name="Example.EarliestCoreMBA.dll" bal:BAFactoryAssembly="yes" /> | 5 | <!-- <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd-x86\Example.EarliestCoreMBA.dll" Name="Example.EarliestCoreMBA.dll" bal:BAFactoryAssembly="yes" /> --> |
6 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd-x86\Example.EarliestCoreMBA.runtimeconfig.json" Name="Example.EarliestCoreMBA.runtimeconfig.json" /> | 6 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd-x86\Example.EarliestCoreMBA.runtimeconfig.json" Name="Example.EarliestCoreMBA.runtimeconfig.json" /> |
7 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd-x86\mbanative.dll" Name="mbanative.dll" /> | 7 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd-x86\mbanative.dll" Name="mbanative.dll" /> |
8 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd-x86\WixToolset.Mba.Core.dll" Name="WixToolset.Mba.Core.dll" /> | 8 | <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd-x86\WixToolset.Mba.Core.dll" Name="WixToolset.Mba.Core.dll" /> |
9 | <bal:WixDotNetCoreBootstrapperApplicationHost /> | 9 | <!-- <bal:WixDotNetCoreBootstrapperApplicationHost /> --> |
10 | </BootstrapperApplication> | 10 | </BootstrapperApplication> |
11 | <Chain> | 11 | <Chain> |
12 | <ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" bal:PrereqPackage="yes" /> | 12 | <ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" bal:PrereqPackage="yes" /> |
diff --git a/src/ext/Bal/test/examples/EarliestCoreBundleSCD/SelfContainedBundle.wxs b/src/ext/Bal/test/examples/EarliestCoreBundleSCD/SelfContainedBundle.wxs index d888d3d9..38a167f1 100644 --- a/src/ext/Bal/test/examples/EarliestCoreBundleSCD/SelfContainedBundle.wxs +++ b/src/ext/Bal/test/examples/EarliestCoreBundleSCD/SelfContainedBundle.wxs | |||
@@ -1,7 +1,7 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> |
2 | <Bundle Name="SCDEarliestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> | 2 | <Bundle Name="SCDEarliestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> |
3 | <BootstrapperApplication> | 3 | <BootstrapperApplication SourceFile="Example.EarliestCoreMBA.exe"> |
4 | <bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment="yes" /> | 4 | <!-- <bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment="yes" /> --> |
5 | <PayloadGroupRef Id="publish.Example.EarliestCoreMBA.scd" /> | 5 | <PayloadGroupRef Id="publish.Example.EarliestCoreMBA.scd" /> |
6 | </BootstrapperApplication> | 6 | </BootstrapperApplication> |
7 | <Chain> | 7 | <Chain> |
diff --git a/src/ext/Bal/test/examples/EarliestCoreBundleSCD/ba.xslt b/src/ext/Bal/test/examples/EarliestCoreBundleSCD/ba.xslt index 06b84256..d30b2564 100644 --- a/src/ext/Bal/test/examples/EarliestCoreBundleSCD/ba.xslt +++ b/src/ext/Bal/test/examples/EarliestCoreBundleSCD/ba.xslt | |||
@@ -11,10 +11,5 @@ | |||
11 | </xsl:copy> | 11 | </xsl:copy> |
12 | </xsl:template> | 12 | </xsl:template> |
13 | 13 | ||
14 | <xsl:template match="wix:Payload[@SourceFile='SourceDir\Example.EarliestCoreMBA.dll']" > | 14 | <xsl:template match="wix:Payload[@SourceFile='SourceDir\Example.EarliestCoreMBA.exe']" /> |
15 | <xsl:copy> | ||
16 | <xsl:attribute name="BAFactoryAssembly" namespace="http://wixtoolset.org/schemas/v4/wxs/bal">yes</xsl:attribute> | ||
17 | <xsl:apply-templates select="@* | node()"/> | ||
18 | </xsl:copy> | ||
19 | </xsl:template> | ||
20 | </xsl:stylesheet> | 15 | </xsl:stylesheet> |
diff --git a/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs b/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs index 5f1aa557..bf4ad6e3 100644 --- a/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs +++ b/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs | |||
@@ -1,7 +1,7 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> |
2 | <Bundle Name="TrimmedSCDEarliestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> | 2 | <Bundle Name="TrimmedSCDEarliestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> |
3 | <BootstrapperApplication> | 3 | <BootstrapperApplication SourceFile="SourceDir\Example.EarliestCoreMBA.exe" > |
4 | <bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment="yes" /> | 4 | <!-- <bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment="yes" /> --> |
5 | <PayloadGroupRef Id="publish.Example.EarliestCoreMBA.trimmedscd" /> | 5 | <PayloadGroupRef Id="publish.Example.EarliestCoreMBA.trimmedscd" /> |
6 | </BootstrapperApplication> | 6 | </BootstrapperApplication> |
7 | <Chain> | 7 | <Chain> |
diff --git a/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/ba.xslt b/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/ba.xslt index 06b84256..d30b2564 100644 --- a/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/ba.xslt +++ b/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/ba.xslt | |||
@@ -11,10 +11,5 @@ | |||
11 | </xsl:copy> | 11 | </xsl:copy> |
12 | </xsl:template> | 12 | </xsl:template> |
13 | 13 | ||
14 | <xsl:template match="wix:Payload[@SourceFile='SourceDir\Example.EarliestCoreMBA.dll']" > | 14 | <xsl:template match="wix:Payload[@SourceFile='SourceDir\Example.EarliestCoreMBA.exe']" /> |
15 | <xsl:copy> | ||
16 | <xsl:attribute name="BAFactoryAssembly" namespace="http://wixtoolset.org/schemas/v4/wxs/bal">yes</xsl:attribute> | ||
17 | <xsl:apply-templates select="@* | node()"/> | ||
18 | </xsl:copy> | ||
19 | </xsl:template> | ||
20 | </xsl:stylesheet> | 15 | </xsl:stylesheet> |
diff --git a/src/ext/Bal/test/examples/EarliestCoreMBA/EarliestCoreBA.cs b/src/ext/Bal/test/examples/EarliestCoreMBA/EarliestCoreBA.cs index c9291a7f..490f4051 100644 --- a/src/ext/Bal/test/examples/EarliestCoreMBA/EarliestCoreBA.cs +++ b/src/ext/Bal/test/examples/EarliestCoreMBA/EarliestCoreBA.cs | |||
@@ -6,14 +6,9 @@ namespace Example.EarliestCoreMBA | |||
6 | 6 | ||
7 | public class EarliestCoreBA : BootstrapperApplication | 7 | public class EarliestCoreBA : BootstrapperApplication |
8 | { | 8 | { |
9 | public EarliestCoreBA(IEngine engine) | ||
10 | : base(engine) | ||
11 | { | ||
12 | |||
13 | } | ||
14 | |||
15 | protected override void Run() | 9 | protected override void Run() |
16 | { | 10 | { |
11 | this.engine.Quit(0); | ||
17 | } | 12 | } |
18 | 13 | ||
19 | protected override void OnStartup(StartupEventArgs args) | 14 | protected override void OnStartup(StartupEventArgs args) |
diff --git a/src/ext/Bal/test/examples/EarliestCoreMBA/EarliestCoreBAFactory.cs b/src/ext/Bal/test/examples/EarliestCoreMBA/EarliestCoreBAFactory.cs deleted file mode 100644 index 672e17ee..00000000 --- a/src/ext/Bal/test/examples/EarliestCoreMBA/EarliestCoreBAFactory.cs +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | [assembly: WixToolset.Mba.Core.BootstrapperApplicationFactory(typeof(Example.EarliestCoreMBA.EarliestCoreBAFactory))] | ||
4 | namespace Example.EarliestCoreMBA | ||
5 | { | ||
6 | using WixToolset.Mba.Core; | ||
7 | |||
8 | public class EarliestCoreBAFactory : BaseBootstrapperApplicationFactory | ||
9 | { | ||
10 | private static int loadCount = 0; | ||
11 | |||
12 | protected override IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand) | ||
13 | { | ||
14 | if (loadCount > 0) | ||
15 | { | ||
16 | engine.Log(LogLevel.Standard, $"Reloaded {loadCount} time(s)"); | ||
17 | } | ||
18 | ++loadCount; | ||
19 | return new EarliestCoreBA(engine); | ||
20 | } | ||
21 | } | ||
22 | } | ||
diff --git a/src/ext/Bal/test/examples/EarliestCoreMBA/Example.EarliestCoreMBA.csproj b/src/ext/Bal/test/examples/EarliestCoreMBA/Example.EarliestCoreMBA.csproj index 7b9d1670..958381c3 100644 --- a/src/ext/Bal/test/examples/EarliestCoreMBA/Example.EarliestCoreMBA.csproj +++ b/src/ext/Bal/test/examples/EarliestCoreMBA/Example.EarliestCoreMBA.csproj | |||
@@ -3,7 +3,12 @@ | |||
3 | <PropertyGroup> | 3 | <PropertyGroup> |
4 | <TargetFramework>net6.0</TargetFramework> | 4 | <TargetFramework>net6.0</TargetFramework> |
5 | <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers> | 5 | <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers> |
6 | <IsDncBA>true</IsDncBA> | 6 | <OutputType>WinExe</OutputType> |
7 | <DebugType>embedded</DebugType> | ||
7 | <Description>Earliest .NET Core MBA</Description> | 8 | <Description>Earliest .NET Core MBA</Description> |
8 | </PropertyGroup> | 9 | </PropertyGroup> |
10 | |||
11 | <ItemGroup> | ||
12 | <PackageReference Include="WixToolset.Mba.Core" /> | ||
13 | </ItemGroup> | ||
9 | </Project> | 14 | </Project> |
diff --git a/src/ext/Bal/test/examples/EarliestCoreMBA/Program.cs b/src/ext/Bal/test/examples/EarliestCoreMBA/Program.cs new file mode 100644 index 00000000..11cc46f0 --- /dev/null +++ b/src/ext/Bal/test/examples/EarliestCoreMBA/Program.cs | |||
@@ -0,0 +1,18 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace Example.EarliestCoreMBA | ||
4 | { | ||
5 | using WixToolset.Mba.Core; | ||
6 | |||
7 | internal class Program | ||
8 | { | ||
9 | private static int Main() | ||
10 | { | ||
11 | var application = new EarliestCoreBA(); | ||
12 | |||
13 | ManagedBootstrapperApplication.Run(application); | ||
14 | |||
15 | return 0; | ||
16 | } | ||
17 | } | ||
18 | } | ||
diff --git a/src/ext/Bal/test/examples/FullFramework2Bundle/Bundle.wxs b/src/ext/Bal/test/examples/FullFramework2Bundle/Bundle.wxs index ba4f02b6..9ca93c7f 100644 --- a/src/ext/Bal/test/examples/FullFramework2Bundle/Bundle.wxs +++ b/src/ext/Bal/test/examples/FullFramework2Bundle/Bundle.wxs | |||
@@ -1,11 +1,10 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> |
2 | <Bundle Name="FullFramework2MBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> | 2 | <Bundle Name="FullFramework2MBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> |
3 | <BootstrapperApplication> | 3 | <BootstrapperApplication SourceFile="Example.FullFramework2MBA\net462\win-x64\Example.FullFramework2MBA.exe"> |
4 | <Payload SourceFile="Example.FullFramework2MBA\net462\win-x64\Example.FullFramework2MBA.dll" /> | 4 | <Payload SourceFile="Example.FullFramework2MBA\net462\win-x64\Example.FullFramework2MBA.exe.config" /> |
5 | <Payload SourceFile="Example.FullFramework2MBA\net462\win-x64\mbanative.dll" /> | 5 | <Payload SourceFile="Example.FullFramework2MBA\net462\win-x64\mbanative.dll" /> |
6 | <Payload SourceFile="Example.FullFramework2MBA\net462\win-x64\WixToolset.Mba.Core.dll" /> | 6 | <Payload SourceFile="Example.FullFramework2MBA\net462\win-x64\WixToolset.Mba.Core.dll" /> |
7 | <Payload SourceFile="Example.FullFramework2MBA\net462\win-x64\WixToolset.Mba.Host.config" /> | 7 | <!-- <bal:WixManagedBootstrapperApplicationHost /> --> |
8 | <bal:WixManagedBootstrapperApplicationHost /> | ||
9 | </BootstrapperApplication> | 8 | </BootstrapperApplication> |
10 | <Chain> | 9 | <Chain> |
11 | <ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" bal:PrereqPackage="yes" /> | 10 | <ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" bal:PrereqPackage="yes" /> |
diff --git a/src/ext/Bal/test/examples/FullFramework2Bundle/FullFramework2Bundle.wixproj b/src/ext/Bal/test/examples/FullFramework2Bundle/FullFramework2Bundle.wixproj index ba75a9ff..7f9c222e 100644 --- a/src/ext/Bal/test/examples/FullFramework2Bundle/FullFramework2Bundle.wixproj +++ b/src/ext/Bal/test/examples/FullFramework2Bundle/FullFramework2Bundle.wixproj | |||
@@ -1,2 +1,6 @@ | |||
1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
2 | <Project Sdk="WixToolset.Sdk" /> | 2 | <Project Sdk="WixToolset.Sdk"> |
3 | <ItemGroup> | ||
4 | <ProjectReference Include="..\FullFramework2MBA\Example.FullFramework2MBA.csproj" /> | ||
5 | </ItemGroup> | ||
6 | </Project> | ||
diff --git a/src/ext/Bal/test/examples/Directory.csproj.props b/src/ext/Bal/test/examples/FullFramework2MBA/App.config index e314ca20..cd68f257 100644 --- a/src/ext/Bal/test/examples/Directory.csproj.props +++ b/src/ext/Bal/test/examples/FullFramework2MBA/App.config | |||
@@ -1,5 +1,7 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8" ?> |
2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | 2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
3 | <Project> | 3 | <configuration> |
4 | <Import Project="$(MsbuildThisFileDirectory)..\..\WixToolset.Dnc.HostGenerator\build\WixToolset.Dnc.HostGenerator.props" /> | 4 | <startup> |
5 | </Project> | 5 | <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" /> |
6 | </startup> | ||
7 | </configuration> | ||
diff --git a/src/ext/Bal/test/examples/FullFramework2MBA/Example.FullFramework2MBA.csproj b/src/ext/Bal/test/examples/FullFramework2MBA/Example.FullFramework2MBA.csproj index f6280a9e..7c4db8c1 100644 --- a/src/ext/Bal/test/examples/FullFramework2MBA/Example.FullFramework2MBA.csproj +++ b/src/ext/Bal/test/examples/FullFramework2MBA/Example.FullFramework2MBA.csproj | |||
@@ -4,6 +4,7 @@ | |||
4 | <Project Sdk="Microsoft.NET.Sdk"> | 4 | <Project Sdk="Microsoft.NET.Sdk"> |
5 | <PropertyGroup> | 5 | <PropertyGroup> |
6 | <TargetFramework>net462</TargetFramework> | 6 | <TargetFramework>net462</TargetFramework> |
7 | <OutputType>WinExe</OutputType> | ||
7 | <AssemblyName>Example.FullFramework2MBA</AssemblyName> | 8 | <AssemblyName>Example.FullFramework2MBA</AssemblyName> |
8 | <RootNamespace>Example.FullFramework2MBA</RootNamespace> | 9 | <RootNamespace>Example.FullFramework2MBA</RootNamespace> |
9 | <DebugType>embedded</DebugType> | 10 | <DebugType>embedded</DebugType> |
@@ -11,10 +12,10 @@ | |||
11 | </PropertyGroup> | 12 | </PropertyGroup> |
12 | 13 | ||
13 | <ItemGroup> | 14 | <ItemGroup> |
14 | <Content Include="WixToolset.Mba.Host.config" CopyToOutputDirectory="PreserveNewest" /> | 15 | <PackageReference Include="WixToolset.Mba.Core" /> |
15 | </ItemGroup> | 16 | </ItemGroup> |
16 | 17 | ||
17 | <ItemGroup> | 18 | <ItemGroup> |
18 | <PackageReference Include="WixToolset.Mba.Core" /> | 19 | <ProjectReference Include="..\..\..\..\..\api\burn\WixToolset.Mba.Core\WixToolset.Mba.Core.csproj" /> |
19 | </ItemGroup> | 20 | </ItemGroup> |
20 | </Project> | 21 | </Project> |
diff --git a/src/ext/Bal/test/examples/FullFramework2MBA/FullFramework2BA.cs b/src/ext/Bal/test/examples/FullFramework2MBA/FullFramework2BA.cs index 32cd19c8..c6d478af 100644 --- a/src/ext/Bal/test/examples/FullFramework2MBA/FullFramework2BA.cs +++ b/src/ext/Bal/test/examples/FullFramework2MBA/FullFramework2BA.cs | |||
@@ -6,14 +6,9 @@ namespace Example.FullFramework2MBA | |||
6 | 6 | ||
7 | public class FullFramework2BA : BootstrapperApplication | 7 | public class FullFramework2BA : BootstrapperApplication |
8 | { | 8 | { |
9 | public FullFramework2BA(IEngine engine) | ||
10 | : base(engine) | ||
11 | { | ||
12 | |||
13 | } | ||
14 | |||
15 | protected override void Run() | 9 | protected override void Run() |
16 | { | 10 | { |
11 | this.engine.Quit(42); | ||
17 | } | 12 | } |
18 | 13 | ||
19 | protected override void OnStartup(StartupEventArgs args) | 14 | protected override void OnStartup(StartupEventArgs args) |
diff --git a/src/ext/Bal/test/examples/FullFramework2MBA/FullFramework2BAFactory.cs b/src/ext/Bal/test/examples/FullFramework2MBA/FullFramework2BAFactory.cs deleted file mode 100644 index 647c2040..00000000 --- a/src/ext/Bal/test/examples/FullFramework2MBA/FullFramework2BAFactory.cs +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | [assembly: WixToolset.Mba.Core.BootstrapperApplicationFactory(typeof(Example.FullFramework2MBA.FullFramework2BAFactory))] | ||
4 | namespace Example.FullFramework2MBA | ||
5 | { | ||
6 | using WixToolset.Mba.Core; | ||
7 | |||
8 | public class FullFramework2BAFactory : BaseBootstrapperApplicationFactory | ||
9 | { | ||
10 | private static int loadCount = 0; | ||
11 | |||
12 | protected override IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand) | ||
13 | { | ||
14 | if (loadCount > 0) | ||
15 | { | ||
16 | engine.Log(LogLevel.Standard, $"Reloaded {loadCount} time(s)"); | ||
17 | } | ||
18 | ++loadCount; | ||
19 | return new FullFramework2BA(engine); | ||
20 | } | ||
21 | } | ||
22 | } | ||
diff --git a/src/ext/Bal/test/examples/FullFramework2MBA/Program.cs b/src/ext/Bal/test/examples/FullFramework2MBA/Program.cs new file mode 100644 index 00000000..067fefe8 --- /dev/null +++ b/src/ext/Bal/test/examples/FullFramework2MBA/Program.cs | |||
@@ -0,0 +1,18 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace Example.FullFramework2MBA | ||
4 | { | ||
5 | using WixToolset.Mba.Core; | ||
6 | |||
7 | internal class Program | ||
8 | { | ||
9 | private static int Main() | ||
10 | { | ||
11 | var application = new FullFramework2BA(); | ||
12 | |||
13 | ManagedBootstrapperApplication.Run(application); | ||
14 | |||
15 | return 0; | ||
16 | } | ||
17 | } | ||
18 | } | ||
diff --git a/src/ext/Bal/test/examples/FullFramework2MBA/WixToolset.Mba.Host.config b/src/ext/Bal/test/examples/FullFramework2MBA/WixToolset.Mba.Host.config deleted file mode 100644 index 41cacce5..00000000 --- a/src/ext/Bal/test/examples/FullFramework2MBA/WixToolset.Mba.Host.config +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" ?> | ||
2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
3 | |||
4 | |||
5 | <configuration> | ||
6 | <configSections> | ||
7 | <sectionGroup name="wix.bootstrapper" type="WixToolset.Mba.Host.BootstrapperSectionGroup, WixToolset.Mba.Host"> | ||
8 | <section name="host" type="WixToolset.Mba.Host.HostSection, WixToolset.Mba.Host" /> | ||
9 | </sectionGroup> | ||
10 | </configSections> | ||
11 | <startup> | ||
12 | <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" /> | ||
13 | </startup> | ||
14 | <wix.bootstrapper> | ||
15 | |||
16 | <host assemblyName="Example.FullFramework2MBA"> | ||
17 | <supportedFramework version="v4\Client" /> | ||
18 | </host> | ||
19 | </wix.bootstrapper> | ||
20 | </configuration> | ||
diff --git a/src/ext/Bal/test/examples/FullFramework4Bundle/Bundle.wxs b/src/ext/Bal/test/examples/FullFramework4Bundle/Bundle.wxs index 802b8b1e..7cac54f2 100644 --- a/src/ext/Bal/test/examples/FullFramework4Bundle/Bundle.wxs +++ b/src/ext/Bal/test/examples/FullFramework4Bundle/Bundle.wxs | |||
@@ -1,11 +1,11 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> |
2 | <Bundle Name="FullFramework4MBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="E08068E0-4FBA-439D-A1C8-4CD1FE27093F"> | 2 | <Bundle Name="FullFramework4MBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="E08068E0-4FBA-439D-A1C8-4CD1FE27093F"> |
3 | <BootstrapperApplication> | 3 | <BootstrapperApplication SourceFile="Example.FullFramework4MBA\net472\win-x64\Example.FullFramework4MBA.exe"> |
4 | <Payload SourceFile="Example.FullFramework4MBA\net472\win-x64\Example.FullFramework4MBA.dll" /> | 4 | <!-- <Payload SourceFile="Example.FullFramework4MBA\net472\win-x64\Example.FullFramework4MBA.dll" /> --> |
5 | <Payload SourceFile="Example.FullFramework4MBA\net472\win-x64\Example.FullFramework4MBA.exe.config" /> | ||
5 | <Payload SourceFile="Example.FullFramework4MBA\net472\win-x64\mbanative.dll" /> | 6 | <Payload SourceFile="Example.FullFramework4MBA\net472\win-x64\mbanative.dll" /> |
6 | <Payload SourceFile="Example.FullFramework4MBA\net472\win-x64\WixToolset.Mba.Core.dll" /> | 7 | <Payload SourceFile="Example.FullFramework4MBA\net472\win-x64\WixToolset.Mba.Core.dll" /> |
7 | <Payload SourceFile="Example.FullFramework4MBA\net472\win-x64\WixToolset.Mba.Host.config" /> | 8 | <!-- <bal:WixManagedBootstrapperApplicationHost /> --> |
8 | <bal:WixManagedBootstrapperApplicationHost /> | ||
9 | </BootstrapperApplication> | 9 | </BootstrapperApplication> |
10 | <Chain> | 10 | <Chain> |
11 | <ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" bal:PrereqPackage="yes" /> | 11 | <ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" bal:PrereqPackage="yes" /> |
diff --git a/src/ext/Bal/test/examples/FullFramework4Bundle/FullFramework4Bundle.wixproj b/src/ext/Bal/test/examples/FullFramework4Bundle/FullFramework4Bundle.wixproj index ba75a9ff..f36d1910 100644 --- a/src/ext/Bal/test/examples/FullFramework4Bundle/FullFramework4Bundle.wixproj +++ b/src/ext/Bal/test/examples/FullFramework4Bundle/FullFramework4Bundle.wixproj | |||
@@ -1,2 +1,7 @@ | |||
1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
2 | <Project Sdk="WixToolset.Sdk" /> | 2 | <Project Sdk="WixToolset.Sdk"> |
3 | <ItemGroup> | ||
4 | <ProjectReference Include="..\FullFramework4MBA\Example.FullFramework4MBA.csproj" /> | ||
5 | </ItemGroup> | ||
6 | </Project> | ||
7 | |||
diff --git a/src/ext/Bal/test/examples/FullFramework4MBA/App.config b/src/ext/Bal/test/examples/FullFramework4MBA/App.config new file mode 100644 index 00000000..dfb3084c --- /dev/null +++ b/src/ext/Bal/test/examples/FullFramework4MBA/App.config | |||
@@ -0,0 +1,7 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" ?> | ||
2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
3 | <configuration> | ||
4 | <startup> | ||
5 | <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> | ||
6 | </startup> | ||
7 | </configuration> | ||
diff --git a/src/ext/Bal/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj b/src/ext/Bal/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj index 247c8173..09665180 100644 --- a/src/ext/Bal/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj +++ b/src/ext/Bal/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj | |||
@@ -4,15 +4,13 @@ | |||
4 | <Project Sdk="Microsoft.NET.Sdk"> | 4 | <Project Sdk="Microsoft.NET.Sdk"> |
5 | <PropertyGroup> | 5 | <PropertyGroup> |
6 | <TargetFramework>net472</TargetFramework> | 6 | <TargetFramework>net472</TargetFramework> |
7 | <OutputType>WinExe</OutputType> | ||
7 | <Description>Full Framework v4 MBA</Description> | 8 | <Description>Full Framework v4 MBA</Description> |
9 | <DebugType>embedded</DebugType> | ||
8 | <RuntimeIdentifier>win-x64</RuntimeIdentifier> | 10 | <RuntimeIdentifier>win-x64</RuntimeIdentifier> |
9 | </PropertyGroup> | 11 | </PropertyGroup> |
10 | 12 | ||
11 | <ItemGroup> | 13 | <ItemGroup> |
12 | <Content Include="WixToolset.Mba.Host.config" CopyToOutputDirectory="PreserveNewest" /> | ||
13 | </ItemGroup> | ||
14 | |||
15 | <ItemGroup> | ||
16 | <PackageReference Include="WixToolset.Mba.Core" /> | 14 | <PackageReference Include="WixToolset.Mba.Core" /> |
17 | </ItemGroup> | 15 | </ItemGroup> |
18 | </Project> | 16 | </Project> |
diff --git a/src/ext/Bal/test/examples/FullFramework4MBA/FullFramework4BA.cs b/src/ext/Bal/test/examples/FullFramework4MBA/FullFramework4BA.cs index 8ee3bd19..8a91195a 100644 --- a/src/ext/Bal/test/examples/FullFramework4MBA/FullFramework4BA.cs +++ b/src/ext/Bal/test/examples/FullFramework4MBA/FullFramework4BA.cs | |||
@@ -6,14 +6,9 @@ namespace Example.FullFramework4MBA | |||
6 | 6 | ||
7 | public class FullFramework4BA : BootstrapperApplication | 7 | public class FullFramework4BA : BootstrapperApplication |
8 | { | 8 | { |
9 | public FullFramework4BA(IEngine engine) | ||
10 | : base(engine) | ||
11 | { | ||
12 | |||
13 | } | ||
14 | |||
15 | protected override void Run() | 9 | protected override void Run() |
16 | { | 10 | { |
11 | this.engine.Quit(0); | ||
17 | } | 12 | } |
18 | 13 | ||
19 | protected override void OnStartup(StartupEventArgs args) | 14 | protected override void OnStartup(StartupEventArgs args) |
diff --git a/src/ext/Bal/test/examples/FullFramework4MBA/FullFramework4BAFactory.cs b/src/ext/Bal/test/examples/FullFramework4MBA/FullFramework4BAFactory.cs deleted file mode 100644 index 6a571a54..00000000 --- a/src/ext/Bal/test/examples/FullFramework4MBA/FullFramework4BAFactory.cs +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | [assembly: WixToolset.Mba.Core.BootstrapperApplicationFactory(typeof(Example.FullFramework4MBA.FullFramework4BAFactory))] | ||
4 | namespace Example.FullFramework4MBA | ||
5 | { | ||
6 | using WixToolset.Mba.Core; | ||
7 | |||
8 | public class FullFramework4BAFactory : BaseBootstrapperApplicationFactory | ||
9 | { | ||
10 | private static int loadCount = 0; | ||
11 | |||
12 | protected override IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand) | ||
13 | { | ||
14 | if (loadCount > 0) | ||
15 | { | ||
16 | engine.Log(LogLevel.Standard, $"Reloaded {loadCount} time(s)"); | ||
17 | } | ||
18 | ++loadCount; | ||
19 | return new FullFramework4BA(engine); | ||
20 | } | ||
21 | } | ||
22 | } | ||
diff --git a/src/ext/Bal/test/examples/FullFramework4MBA/Program.cs b/src/ext/Bal/test/examples/FullFramework4MBA/Program.cs new file mode 100644 index 00000000..23fb6851 --- /dev/null +++ b/src/ext/Bal/test/examples/FullFramework4MBA/Program.cs | |||
@@ -0,0 +1,18 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace Example.FullFramework4MBA | ||
4 | { | ||
5 | using WixToolset.Mba.Core; | ||
6 | |||
7 | internal class Program | ||
8 | { | ||
9 | private static int Main() | ||
10 | { | ||
11 | var application = new FullFramework4BA(); | ||
12 | |||
13 | ManagedBootstrapperApplication.Run(application); | ||
14 | |||
15 | return 0; | ||
16 | } | ||
17 | } | ||
18 | } | ||
diff --git a/src/ext/Bal/test/examples/FullFramework4MBA/WixToolset.Mba.Host.config b/src/ext/Bal/test/examples/FullFramework4MBA/WixToolset.Mba.Host.config deleted file mode 100644 index ac4770df..00000000 --- a/src/ext/Bal/test/examples/FullFramework4MBA/WixToolset.Mba.Host.config +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" ?> | ||
2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
3 | |||
4 | |||
5 | <configuration> | ||
6 | <configSections> | ||
7 | <sectionGroup name="wix.bootstrapper" type="WixToolset.Mba.Host.BootstrapperSectionGroup, WixToolset.Mba.Host"> | ||
8 | <section name="host" type="WixToolset.Mba.Host.HostSection, WixToolset.Mba.Host" /> | ||
9 | </sectionGroup> | ||
10 | </configSections> | ||
11 | <startup> | ||
12 | <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" /> | ||
13 | </startup> | ||
14 | <wix.bootstrapper> | ||
15 | <host assemblyName="Example.FullFramework4MBA" /> | ||
16 | </wix.bootstrapper> | ||
17 | </configuration> | ||
diff --git a/src/ext/Bal/test/examples/LatestCoreBundleFDD/FrameworkDependentBundle.wxs b/src/ext/Bal/test/examples/LatestCoreBundleFDD/FrameworkDependentBundle.wxs index b29363dd..74f82d99 100644 --- a/src/ext/Bal/test/examples/LatestCoreBundleFDD/FrameworkDependentBundle.wxs +++ b/src/ext/Bal/test/examples/LatestCoreBundleFDD/FrameworkDependentBundle.wxs | |||
@@ -1,12 +1,12 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> |
2 | <Bundle Name="FDDLatestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> | 2 | <Bundle Name="FDDLatestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> |
3 | <BootstrapperApplication> | 3 | <BootstrapperApplication SourceFile="publish\Example.LatestCoreMBA\fdd\Example.LatestCoreMBA.exe"> |
4 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd\Example.LatestCoreMBA.deps.json" Name="Example.LatestCoreMBA.deps.json" /> | 4 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd\Example.LatestCoreMBA.deps.json" Name="Example.LatestCoreMBA.deps.json" /> |
5 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd\Example.LatestCoreMBA.dll" Name="Example.LatestCoreMBA.dll" bal:BAFactoryAssembly="yes" /> | 5 | <!-- <Payload SourceFile="publish\Example.LatestCoreMBA\fdd\Example.LatestCoreMBA.dll" Name="Example.LatestCoreMBA.dll" bal:BAFactoryAssembly="yes" /> --> |
6 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd\Example.LatestCoreMBA.runtimeconfig.json" Name="Example.LatestCoreMBA.runtimeconfig.json" /> | 6 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd\Example.LatestCoreMBA.runtimeconfig.json" Name="Example.LatestCoreMBA.runtimeconfig.json" /> |
7 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd\mbanative.dll" Name="mbanative.dll" /> | 7 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd\mbanative.dll" Name="mbanative.dll" /> |
8 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd\WixToolset.Mba.Core.dll" Name="WixToolset.Mba.Core.dll" /> | 8 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd\WixToolset.Mba.Core.dll" Name="WixToolset.Mba.Core.dll" /> |
9 | <bal:WixDotNetCoreBootstrapperApplicationHost /> | 9 | <!-- <bal:WixDotNetCoreBootstrapperApplicationHost /> --> |
10 | </BootstrapperApplication> | 10 | </BootstrapperApplication> |
11 | <Chain> | 11 | <Chain> |
12 | <ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" bal:PrereqPackage="yes" /> | 12 | <ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" bal:PrereqPackage="yes" /> |
diff --git a/src/ext/Bal/test/examples/LatestCoreBundleFDDx86/FrameworkDependentBundle.wxs b/src/ext/Bal/test/examples/LatestCoreBundleFDDx86/FrameworkDependentBundle.wxs index 15dd290a..ab40a543 100644 --- a/src/ext/Bal/test/examples/LatestCoreBundleFDDx86/FrameworkDependentBundle.wxs +++ b/src/ext/Bal/test/examples/LatestCoreBundleFDDx86/FrameworkDependentBundle.wxs | |||
@@ -1,12 +1,12 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> |
2 | <Bundle Name="FDDx86LatestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="{E547C546-5E0E-4BF9-A675-BBEF4C77FF0D}"> | 2 | <Bundle Name="FDDx86LatestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="{E547C546-5E0E-4BF9-A675-BBEF4C77FF0D}"> |
3 | <BootstrapperApplication> | 3 | <BootstrapperApplication SourceFile="publish\Example.LatestCoreMBA\fdd-x86\Example.LatestCoreMBA.exe"> |
4 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd-x86\Example.LatestCoreMBA.deps.json" Name="Example.LatestCoreMBA.deps.json" /> | 4 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd-x86\Example.LatestCoreMBA.deps.json" Name="Example.LatestCoreMBA.deps.json" /> |
5 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd-x86\Example.LatestCoreMBA.dll" Name="Example.LatestCoreMBA.dll" bal:BAFactoryAssembly="yes" /> | 5 | <!-- <Payload SourceFile="publish\Example.LatestCoreMBA\fdd-x86\Example.LatestCoreMBA.dll" Name="Example.LatestCoreMBA.dll" bal:BAFactoryAssembly="yes" /> --> |
6 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd-x86\Example.LatestCoreMBA.runtimeconfig.json" Name="Example.LatestCoreMBA.runtimeconfig.json" /> | 6 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd-x86\Example.LatestCoreMBA.runtimeconfig.json" Name="Example.LatestCoreMBA.runtimeconfig.json" /> |
7 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd-x86\mbanative.dll" Name="mbanative.dll" /> | 7 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd-x86\mbanative.dll" Name="mbanative.dll" /> |
8 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd-x86\WixToolset.Mba.Core.dll" Name="WixToolset.Mba.Core.dll" /> | 8 | <Payload SourceFile="publish\Example.LatestCoreMBA\fdd-x86\WixToolset.Mba.Core.dll" Name="WixToolset.Mba.Core.dll" /> |
9 | <bal:WixDotNetCoreBootstrapperApplicationHost /> | 9 | <!-- <bal:WixDotNetCoreBootstrapperApplicationHost /> --> |
10 | </BootstrapperApplication> | 10 | </BootstrapperApplication> |
11 | <Chain> | 11 | <Chain> |
12 | <ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" bal:PrereqPackage="yes" /> | 12 | <ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" bal:PrereqPackage="yes" /> |
diff --git a/src/ext/Bal/test/examples/LatestCoreBundleSCD/SelfContainedBundle.wxs b/src/ext/Bal/test/examples/LatestCoreBundleSCD/SelfContainedBundle.wxs index 56edc986..0022b690 100644 --- a/src/ext/Bal/test/examples/LatestCoreBundleSCD/SelfContainedBundle.wxs +++ b/src/ext/Bal/test/examples/LatestCoreBundleSCD/SelfContainedBundle.wxs | |||
@@ -1,7 +1,7 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> |
2 | <Bundle Name="SCDLatestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> | 2 | <Bundle Name="SCDLatestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> |
3 | <BootstrapperApplication> | 3 | <BootstrapperApplication SourceFile="Example.LatestCoreMBA.exe"> |
4 | <bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment="yes" /> | 4 | <!-- <bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment="yes" /> --> |
5 | <PayloadGroupRef Id="publish.Example.LatestCoreMBA.scd" /> | 5 | <PayloadGroupRef Id="publish.Example.LatestCoreMBA.scd" /> |
6 | </BootstrapperApplication> | 6 | </BootstrapperApplication> |
7 | <Chain> | 7 | <Chain> |
diff --git a/src/ext/Bal/test/examples/LatestCoreBundleSCD/ba.xslt b/src/ext/Bal/test/examples/LatestCoreBundleSCD/ba.xslt index acc7474c..f606296e 100644 --- a/src/ext/Bal/test/examples/LatestCoreBundleSCD/ba.xslt +++ b/src/ext/Bal/test/examples/LatestCoreBundleSCD/ba.xslt | |||
@@ -11,10 +11,5 @@ | |||
11 | </xsl:copy> | 11 | </xsl:copy> |
12 | </xsl:template> | 12 | </xsl:template> |
13 | 13 | ||
14 | <xsl:template match="wix:Payload[@SourceFile='SourceDir\Example.LatestCoreMBA.dll']" > | 14 | <xsl:template match="wix:Payload[@SourceFile='SourceDir\Example.LatestCoreMBA.exe']" /> |
15 | <xsl:copy> | ||
16 | <xsl:attribute name="BAFactoryAssembly" namespace="http://wixtoolset.org/schemas/v4/wxs/bal">yes</xsl:attribute> | ||
17 | <xsl:apply-templates select="@* | node()"/> | ||
18 | </xsl:copy> | ||
19 | </xsl:template> | ||
20 | </xsl:stylesheet> | 15 | </xsl:stylesheet> |
diff --git a/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs b/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs index 7ac9c34a..322a27a3 100644 --- a/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs +++ b/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs | |||
@@ -1,7 +1,7 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> |
2 | <Bundle Name="TrimmedSCDLatestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> | 2 | <Bundle Name="TrimmedSCDLatestCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> |
3 | <BootstrapperApplication> | 3 | <BootstrapperApplication SourceFile="Example.LatestCoreMBA.exe"> |
4 | <bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment="yes" /> | 4 | <!-- <bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment="yes" /> --> |
5 | <PayloadGroupRef Id="publish.Example.LatestCoreMBA.trimmedscd" /> | 5 | <PayloadGroupRef Id="publish.Example.LatestCoreMBA.trimmedscd" /> |
6 | </BootstrapperApplication> | 6 | </BootstrapperApplication> |
7 | <Chain> | 7 | <Chain> |
diff --git a/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/ba.xslt b/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/ba.xslt index acc7474c..f606296e 100644 --- a/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/ba.xslt +++ b/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/ba.xslt | |||
@@ -11,10 +11,5 @@ | |||
11 | </xsl:copy> | 11 | </xsl:copy> |
12 | </xsl:template> | 12 | </xsl:template> |
13 | 13 | ||
14 | <xsl:template match="wix:Payload[@SourceFile='SourceDir\Example.LatestCoreMBA.dll']" > | 14 | <xsl:template match="wix:Payload[@SourceFile='SourceDir\Example.LatestCoreMBA.exe']" /> |
15 | <xsl:copy> | ||
16 | <xsl:attribute name="BAFactoryAssembly" namespace="http://wixtoolset.org/schemas/v4/wxs/bal">yes</xsl:attribute> | ||
17 | <xsl:apply-templates select="@* | node()"/> | ||
18 | </xsl:copy> | ||
19 | </xsl:template> | ||
20 | </xsl:stylesheet> | 15 | </xsl:stylesheet> |
diff --git a/src/ext/Bal/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj b/src/ext/Bal/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj index 236e715c..c4d31151 100644 --- a/src/ext/Bal/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj +++ b/src/ext/Bal/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj | |||
@@ -3,7 +3,12 @@ | |||
3 | <PropertyGroup> | 3 | <PropertyGroup> |
4 | <TargetFramework>net6.0</TargetFramework> | 4 | <TargetFramework>net6.0</TargetFramework> |
5 | <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers> | 5 | <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers> |
6 | <IsDncBA>true</IsDncBA> | 6 | <OutputType>WinExe</OutputType> |
7 | <DebugType>embedded</DebugType> | ||
7 | <Description>Latest .NET Core MBA</Description> | 8 | <Description>Latest .NET Core MBA</Description> |
8 | </PropertyGroup> | 9 | </PropertyGroup> |
10 | |||
11 | <ItemGroup> | ||
12 | <PackageReference Include="WixToolset.Mba.Core" /> | ||
13 | </ItemGroup> | ||
9 | </Project> | 14 | </Project> |
diff --git a/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBA.cs b/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBA.cs index 50386a87..bd5378eb 100644 --- a/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBA.cs +++ b/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBA.cs | |||
@@ -6,13 +6,9 @@ namespace Example.LatestCoreMBA | |||
6 | 6 | ||
7 | public class LatestCoreBA : BootstrapperApplication | 7 | public class LatestCoreBA : BootstrapperApplication |
8 | { | 8 | { |
9 | public LatestCoreBA(IEngine engine) | ||
10 | : base(engine) | ||
11 | { | ||
12 | } | ||
13 | |||
14 | protected override void Run() | 9 | protected override void Run() |
15 | { | 10 | { |
11 | this.engine.Quit(0); | ||
16 | } | 12 | } |
17 | 13 | ||
18 | protected override void OnStartup(StartupEventArgs args) | 14 | protected override void OnStartup(StartupEventArgs args) |
diff --git a/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs b/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs deleted file mode 100644 index fff3b5c5..00000000 --- a/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | [assembly: WixToolset.Mba.Core.BootstrapperApplicationFactory(typeof(Example.LatestCoreMBA.LatestCoreBAFactory))] | ||
4 | namespace Example.LatestCoreMBA | ||
5 | { | ||
6 | using WixToolset.Mba.Core; | ||
7 | |||
8 | public class LatestCoreBAFactory : BaseBootstrapperApplicationFactory | ||
9 | { | ||
10 | private static int loadCount = 0; | ||
11 | |||
12 | protected override IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand) | ||
13 | { | ||
14 | if (loadCount > 0) | ||
15 | { | ||
16 | engine.Log(LogLevel.Standard, $"Reloaded {loadCount} time(s)"); | ||
17 | } | ||
18 | ++loadCount; | ||
19 | return new LatestCoreBA(engine); | ||
20 | } | ||
21 | } | ||
22 | } | ||
diff --git a/src/ext/Bal/test/examples/LatestCoreMBA/Program.cs b/src/ext/Bal/test/examples/LatestCoreMBA/Program.cs new file mode 100644 index 00000000..94da360b --- /dev/null +++ b/src/ext/Bal/test/examples/LatestCoreMBA/Program.cs | |||
@@ -0,0 +1,18 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace Example.LatestCoreMBA | ||
4 | { | ||
5 | using WixToolset.Mba.Core; | ||
6 | |||
7 | internal class Program | ||
8 | { | ||
9 | private static int Main() | ||
10 | { | ||
11 | var application = new LatestCoreBA(); | ||
12 | |||
13 | ManagedBootstrapperApplication.Run(application); | ||
14 | |||
15 | return 0; | ||
16 | } | ||
17 | } | ||
18 | } | ||
diff --git a/src/ext/Bal/test/examples/TestEngine/TestEngine.cpp b/src/ext/Bal/test/examples/TestEngine/TestEngine.cpp index 5c6ed398..197e3116 100644 --- a/src/ext/Bal/test/examples/TestEngine/TestEngine.cpp +++ b/src/ext/Bal/test/examples/TestEngine/TestEngine.cpp | |||
@@ -26,16 +26,12 @@ HRESULT TestEngine::LoadBA( | |||
26 | { | 26 | { |
27 | HRESULT hr = S_OK; | 27 | HRESULT hr = S_OK; |
28 | BOOTSTRAPPER_COMMAND command = { }; | 28 | BOOTSTRAPPER_COMMAND command = { }; |
29 | BOOTSTRAPPER_CREATE_ARGS args = { }; | ||
30 | PFN_BOOTSTRAPPER_APPLICATION_CREATE pfnCreate = NULL; | ||
31 | 29 | ||
32 | if (m_pCreateResults || m_hBAModule) | 30 | if (m_hBAModule) |
33 | { | 31 | { |
34 | ExitFunction1(hr = E_INVALIDSTATE); | 32 | ExitFunction1(hr = E_INVALIDSTATE); |
35 | } | 33 | } |
36 | 34 | ||
37 | m_pCreateResults = static_cast<BOOTSTRAPPER_CREATE_RESULTS*>(MemAlloc(sizeof(BOOTSTRAPPER_CREATE_RESULTS), TRUE)); | ||
38 | |||
39 | command.cbSize = sizeof(BOOTSTRAPPER_COMMAND); | 35 | command.cbSize = sizeof(BOOTSTRAPPER_COMMAND); |
40 | 36 | ||
41 | hr = PathGetDirectory(wzBAFilePath, &command.wzBootstrapperWorkingFolder); | 37 | hr = PathGetDirectory(wzBAFilePath, &command.wzBootstrapperWorkingFolder); |
@@ -44,14 +40,7 @@ HRESULT TestEngine::LoadBA( | |||
44 | hr = PathConcat(command.wzBootstrapperWorkingFolder, L"BootstrapperApplicationData.xml", &command.wzBootstrapperApplicationDataPath); | 40 | hr = PathConcat(command.wzBootstrapperWorkingFolder, L"BootstrapperApplicationData.xml", &command.wzBootstrapperApplicationDataPath); |
45 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to allocate wzBootstrapperApplicationDataPath"); | 41 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to allocate wzBootstrapperApplicationDataPath"); |
46 | 42 | ||
47 | args.cbSize = sizeof(BOOTSTRAPPER_CREATE_ARGS); | 43 | #ifdef TODO_DELETE |
48 | args.pCommand = &command; | ||
49 | args.pfnBootstrapperEngineProc = TestEngine::EngineProc; | ||
50 | args.pvBootstrapperEngineProcContext = this; | ||
51 | args.qwEngineAPIVersion = MAKEQWORDVERSION(0, 0, 0, 1); | ||
52 | |||
53 | m_pCreateResults->cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); | ||
54 | |||
55 | m_hBAModule = ::LoadLibraryExW(wzBAFilePath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); | 44 | m_hBAModule = ::LoadLibraryExW(wzBAFilePath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); |
56 | ConsoleExitOnNullWithLastError(m_hBAModule, hr, CONSOLE_COLOR_RED, "Failed to load BA dll."); | 45 | ConsoleExitOnNullWithLastError(m_hBAModule, hr, CONSOLE_COLOR_RED, "Failed to load BA dll."); |
57 | 46 | ||
@@ -60,6 +49,7 @@ HRESULT TestEngine::LoadBA( | |||
60 | 49 | ||
61 | hr = pfnCreate(&args, m_pCreateResults); | 50 | hr = pfnCreate(&args, m_pCreateResults); |
62 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure on BootstrapperApplicationCreate."); | 51 | ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure on BootstrapperApplicationCreate."); |
52 | #endif | ||
63 | 53 | ||
64 | LExit: | 54 | LExit: |
65 | ReleaseStr(command.wzBootstrapperApplicationDataPath); | 55 | ReleaseStr(command.wzBootstrapperApplicationDataPath); |
@@ -117,7 +107,7 @@ HRESULT TestEngine::SendShutdownEvent( | |||
117 | shutdownArgs.cbSize = sizeof(BA_ONSHUTDOWN_ARGS); | 107 | shutdownArgs.cbSize = sizeof(BA_ONSHUTDOWN_ARGS); |
118 | shutdownResults.action = defaultAction; | 108 | shutdownResults.action = defaultAction; |
119 | shutdownResults.cbSize = sizeof(BA_ONSHUTDOWN_RESULTS); | 109 | shutdownResults.cbSize = sizeof(BA_ONSHUTDOWN_RESULTS); |
120 | hr = m_pCreateResults->pfnBootstrapperApplicationProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONSHUTDOWN, &shutdownArgs, &shutdownResults, m_pCreateResults->pvBootstrapperApplicationProcContext); | 110 | // hr = m_pCreateResults->pfnBootstrapperApplicationProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONSHUTDOWN, &shutdownArgs, &shutdownResults, m_pCreateResults->pvBootstrapperApplicationProcContext); |
121 | return hr; | 111 | return hr; |
122 | } | 112 | } |
123 | 113 | ||
@@ -128,7 +118,7 @@ HRESULT TestEngine::SendStartupEvent() | |||
128 | BA_ONSTARTUP_RESULTS startupResults = { }; | 118 | BA_ONSTARTUP_RESULTS startupResults = { }; |
129 | startupArgs.cbSize = sizeof(BA_ONSTARTUP_ARGS); | 119 | startupArgs.cbSize = sizeof(BA_ONSTARTUP_ARGS); |
130 | startupResults.cbSize = sizeof(BA_ONSTARTUP_RESULTS); | 120 | startupResults.cbSize = sizeof(BA_ONSTARTUP_RESULTS); |
131 | hr = m_pCreateResults->pfnBootstrapperApplicationProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONSTARTUP, &startupArgs, &startupResults, m_pCreateResults->pvBootstrapperApplicationProcContext); | 121 | // hr = m_pCreateResults->pfnBootstrapperApplicationProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONSTARTUP, &startupArgs, &startupResults, m_pCreateResults->pvBootstrapperApplicationProcContext); |
132 | return hr; | 122 | return hr; |
133 | } | 123 | } |
134 | 124 | ||
@@ -151,6 +141,7 @@ void TestEngine::UnloadBA( | |||
151 | __in BOOL fReload | 141 | __in BOOL fReload |
152 | ) | 142 | ) |
153 | { | 143 | { |
144 | #ifdef TODO_DELETE | ||
154 | PFN_BOOTSTRAPPER_APPLICATION_DESTROY pfnDestroy = NULL; | 145 | PFN_BOOTSTRAPPER_APPLICATION_DESTROY pfnDestroy = NULL; |
155 | BOOTSTRAPPER_DESTROY_ARGS args = { }; | 146 | BOOTSTRAPPER_DESTROY_ARGS args = { }; |
156 | BOOTSTRAPPER_DESTROY_RESULTS results = { }; | 147 | BOOTSTRAPPER_DESTROY_RESULTS results = { }; |
@@ -178,6 +169,7 @@ void TestEngine::UnloadBA( | |||
178 | 169 | ||
179 | m_hBAModule = NULL; | 170 | m_hBAModule = NULL; |
180 | } | 171 | } |
172 | #endif | ||
181 | } | 173 | } |
182 | 174 | ||
183 | HRESULT TestEngine::BAEngineLog( | 175 | HRESULT TestEngine::BAEngineLog( |
@@ -254,11 +246,9 @@ HRESULT TestEngine::ProcessBAMessage( | |||
254 | TestEngine::TestEngine() | 246 | TestEngine::TestEngine() |
255 | { | 247 | { |
256 | m_hBAModule = NULL; | 248 | m_hBAModule = NULL; |
257 | m_pCreateResults = NULL; | ||
258 | m_dwThreadId = ::GetCurrentThreadId(); | 249 | m_dwThreadId = ::GetCurrentThreadId(); |
259 | } | 250 | } |
260 | 251 | ||
261 | TestEngine::~TestEngine() | 252 | TestEngine::~TestEngine() |
262 | { | 253 | { |
263 | ReleaseMem(m_pCreateResults); | ||
264 | } | 254 | } |
diff --git a/src/ext/Bal/test/examples/TestEngine/TestEngine.h b/src/ext/Bal/test/examples/TestEngine/TestEngine.h index 248e979a..6c4867b0 100644 --- a/src/ext/Bal/test/examples/TestEngine/TestEngine.h +++ b/src/ext/Bal/test/examples/TestEngine/TestEngine.h | |||
@@ -77,6 +77,5 @@ public: | |||
77 | 77 | ||
78 | private: | 78 | private: |
79 | HMODULE m_hBAModule; | 79 | HMODULE m_hBAModule; |
80 | BOOTSTRAPPER_CREATE_RESULTS* m_pCreateResults; | ||
81 | DWORD m_dwThreadId; | 80 | DWORD m_dwThreadId; |
82 | }; | 81 | }; |
diff --git a/src/ext/Bal/test/examples/TestEngine/precomp.h b/src/ext/Bal/test/examples/TestEngine/precomp.h index f943f420..e9ba3f98 100644 --- a/src/ext/Bal/test/examples/TestEngine/precomp.h +++ b/src/ext/Bal/test/examples/TestEngine/precomp.h | |||
@@ -11,8 +11,8 @@ | |||
11 | #include "pathutil.h" | 11 | #include "pathutil.h" |
12 | #include "strutil.h" | 12 | #include "strutil.h" |
13 | 13 | ||
14 | #include "BootstrapperEngine.h" | 14 | #include <baenginetypes.h> |
15 | #include "BootstrapperApplication.h" | 15 | #include <batypes.h> |
16 | 16 | ||
17 | #include "TestEngine.h" | 17 | #include "TestEngine.h" |
18 | #include "ReloadEngine.h" | 18 | #include "ReloadEngine.h" |
diff --git a/src/ext/Bal/test/examples/WPFCoreBundleFDD/FrameworkDependentBundle.wxs b/src/ext/Bal/test/examples/WPFCoreBundleFDD/FrameworkDependentBundle.wxs index 5f054ca4..e95fbba0 100644 --- a/src/ext/Bal/test/examples/WPFCoreBundleFDD/FrameworkDependentBundle.wxs +++ b/src/ext/Bal/test/examples/WPFCoreBundleFDD/FrameworkDependentBundle.wxs | |||
@@ -1,12 +1,12 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> |
2 | <Bundle Name="FDDWPFCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> | 2 | <Bundle Name="FDDWPFCoreMBA" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="5CE5B5C7-4B6B-4B95-B297-731F1F956533"> |
3 | <BootstrapperApplication> | 3 | <BootstrapperApplication SourceFile="publish\Example.WPFCoreMBA\fdd\Example.WPFCoreMBA.exe"> |
4 | <Payload SourceFile="publish\Example.WPFCoreMBA\fdd\Example.WPFCoreMBA.deps.json" Name="Example.WPFCoreMBA.deps.json" /> | 4 | <Payload SourceFile="publish\Example.WPFCoreMBA\fdd\Example.WPFCoreMBA.deps.json" Name="Example.WPFCoreMBA.deps.json" /> |
5 | <Payload SourceFile="publish\Example.WPFCoreMBA\fdd\Example.WPFCoreMBA.dll" Name="Example.WPFCoreMBA.dll" bal:BAFactoryAssembly="yes" /> | 5 | <!-- <Payload SourceFile="publish\Example.WPFCoreMBA\fdd\Example.WPFCoreMBA.dll" Name="Example.WPFCoreMBA.dll" bal:BAFactoryAssembly="yes" /> --> |
6 | <Payload SourceFile="publish\Example.WPFCoreMBA\fdd\Example.WPFCoreMBA.runtimeconfig.json" Name="Example.WPFCoreMBA.runtimeconfig.json" /> | 6 | <Payload SourceFile="publish\Example.WPFCoreMBA\fdd\Example.WPFCoreMBA.runtimeconfig.json" Name="Example.WPFCoreMBA.runtimeconfig.json" /> |
7 | <Payload SourceFile="publish\Example.WPFCoreMBA\fdd\mbanative.dll" Name="mbanative.dll" /> | 7 | <Payload SourceFile="publish\Example.WPFCoreMBA\fdd\mbanative.dll" Name="mbanative.dll" /> |
8 | <Payload SourceFile="publish\Example.WPFCoreMBA\fdd\WixToolset.Mba.Core.dll" Name="WixToolset.Mba.Core.dll" /> | 8 | <Payload SourceFile="publish\Example.WPFCoreMBA\fdd\WixToolset.Mba.Core.dll" Name="WixToolset.Mba.Core.dll" /> |
9 | <bal:WixDotNetCoreBootstrapperApplicationHost /> | 9 | <!-- <bal:WixDotNetCoreBootstrapperApplicationHost /> --> |
10 | </BootstrapperApplication> | 10 | </BootstrapperApplication> |
11 | <Chain> | 11 | <Chain> |
12 | <ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" bal:PrereqPackage="yes" /> | 12 | <ExePackage DetectCondition="none" UninstallArguments="-foo" SourceFile="..\.data\notanexe.exe" bal:PrereqPackage="yes" /> |
diff --git a/src/ext/Bal/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj b/src/ext/Bal/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj index 338da446..279b498f 100644 --- a/src/ext/Bal/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj +++ b/src/ext/Bal/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj | |||
@@ -1,10 +1,14 @@ | |||
1 | <Project Sdk="Microsoft.NET.Sdk"> | 1 | <Project Sdk="Microsoft.NET.Sdk"> |
2 | 2 | ||
3 | <PropertyGroup> | 3 | <PropertyGroup> |
4 | <OutputType>WinExe</OutputType> | ||
4 | <TargetFramework>net6.0-windows</TargetFramework> | 5 | <TargetFramework>net6.0-windows</TargetFramework> |
5 | <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers> | 6 | <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers> |
6 | <IsDncBA>true</IsDncBA> | ||
7 | <Description>WPF .NET Core MBA</Description> | 7 | <Description>WPF .NET Core MBA</Description> |
8 | <UseWPF>true</UseWPF> | 8 | <UseWPF>true</UseWPF> |
9 | </PropertyGroup> | 9 | </PropertyGroup> |
10 | |||
11 | <ItemGroup> | ||
12 | <PackageReference Include="WixToolset.Mba.Core" /> | ||
13 | </ItemGroup> | ||
10 | </Project> | 14 | </Project> |
diff --git a/src/ext/Bal/test/examples/WPFCoreMBA/Program.cs b/src/ext/Bal/test/examples/WPFCoreMBA/Program.cs new file mode 100644 index 00000000..185e92cc --- /dev/null +++ b/src/ext/Bal/test/examples/WPFCoreMBA/Program.cs | |||
@@ -0,0 +1,19 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace Example.WPFCoreMBA | ||
4 | { | ||
5 | using WixToolset.Mba.Core; | ||
6 | // using WixToolset.BootstrapperApplications.Managed; | ||
7 | |||
8 | public class Program | ||
9 | { | ||
10 | public static int Main(string[] args) | ||
11 | { | ||
12 | var app = new WPFCoreBA(); | ||
13 | |||
14 | ManagedBootstrapperApplication.Run(app); | ||
15 | |||
16 | return 0; | ||
17 | } | ||
18 | } | ||
19 | } | ||
diff --git a/src/ext/Bal/test/examples/WPFCoreMBA/WPFCoreBA.cs b/src/ext/Bal/test/examples/WPFCoreMBA/WPFCoreBA.cs index d50be813..7bc06094 100644 --- a/src/ext/Bal/test/examples/WPFCoreMBA/WPFCoreBA.cs +++ b/src/ext/Bal/test/examples/WPFCoreMBA/WPFCoreBA.cs | |||
@@ -7,11 +7,6 @@ namespace Example.WPFCoreMBA | |||
7 | 7 | ||
8 | public class WPFCoreBA : BootstrapperApplication | 8 | public class WPFCoreBA : BootstrapperApplication |
9 | { | 9 | { |
10 | public WPFCoreBA(IEngine engine) | ||
11 | : base(engine) | ||
12 | { | ||
13 | } | ||
14 | |||
15 | public Dispatcher BADispatcher { get; private set; } | 10 | public Dispatcher BADispatcher { get; private set; } |
16 | 11 | ||
17 | protected override void Run() | 12 | protected override void Run() |
@@ -21,7 +16,7 @@ namespace Example.WPFCoreMBA | |||
21 | window.Closed += (s, e) => this.BADispatcher.InvokeShutdown(); | 16 | window.Closed += (s, e) => this.BADispatcher.InvokeShutdown(); |
22 | //window.Show(); | 17 | //window.Show(); |
23 | //Dispatcher.Run(); | 18 | //Dispatcher.Run(); |
24 | //this.engine.Quit(0); | 19 | this.engine.Quit(0); |
25 | } | 20 | } |
26 | 21 | ||
27 | protected override void OnStartup(StartupEventArgs args) | 22 | protected override void OnStartup(StartupEventArgs args) |
diff --git a/src/ext/Bal/test/examples/WPFCoreMBA/WPFCoreBAFactory.cs b/src/ext/Bal/test/examples/WPFCoreMBA/WPFCoreBAFactory.cs deleted file mode 100644 index a3ccdf9f..00000000 --- a/src/ext/Bal/test/examples/WPFCoreMBA/WPFCoreBAFactory.cs +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | [assembly: WixToolset.Mba.Core.BootstrapperApplicationFactory(typeof(Example.WPFCoreMBA.WPFCoreBAFactory))] | ||
4 | namespace Example.WPFCoreMBA | ||
5 | { | ||
6 | using WixToolset.Mba.Core; | ||
7 | |||
8 | public class WPFCoreBAFactory : BaseBootstrapperApplicationFactory | ||
9 | { | ||
10 | private static int loadCount = 0; | ||
11 | |||
12 | protected override IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand) | ||
13 | { | ||
14 | if (loadCount > 0) | ||
15 | { | ||
16 | engine.Log(LogLevel.Standard, $"Reloaded {loadCount} time(s)"); | ||
17 | } | ||
18 | ++loadCount; | ||
19 | return new WPFCoreBA(engine); | ||
20 | } | ||
21 | } | ||
22 | } | ||
diff --git a/src/ext/Bal/test/examples/examples.proj b/src/ext/Bal/test/examples/examples.proj index 60388a93..c1544766 100644 --- a/src/ext/Bal/test/examples/examples.proj +++ b/src/ext/Bal/test/examples/examples.proj | |||
@@ -6,8 +6,6 @@ | |||
6 | 6 | ||
7 | <PropertyGroup> | 7 | <PropertyGroup> |
8 | <EarliestCoreMBAProjectPath>EarliestCoreMBA\Example.EarliestCoreMBA.csproj</EarliestCoreMBAProjectPath> | 8 | <EarliestCoreMBAProjectPath>EarliestCoreMBA\Example.EarliestCoreMBA.csproj</EarliestCoreMBAProjectPath> |
9 | <FullFramework2MBAProjectPath>FullFramework2MBA\Example.FullFramework2MBA.csproj</FullFramework2MBAProjectPath> | ||
10 | <FullFramework4MBAProjectPath>FullFramework4MBA\Example.FullFramework4MBA.csproj</FullFramework4MBAProjectPath> | ||
11 | <LatestCoreMBAProjectPath>LatestCoreMBA\Example.LatestCoreMBA.csproj</LatestCoreMBAProjectPath> | 9 | <LatestCoreMBAProjectPath>LatestCoreMBA\Example.LatestCoreMBA.csproj</LatestCoreMBAProjectPath> |
12 | <WPFCoreMBAProjectPath>WPFCoreMBA\Example.WPFCoreMBA.csproj</WPFCoreMBAProjectPath> | 10 | <WPFCoreMBAProjectPath>WPFCoreMBA\Example.WPFCoreMBA.csproj</WPFCoreMBAProjectPath> |
13 | <MBAPublishPath>$(OutputPath)examples\publish\</MBAPublishPath> | 11 | <MBAPublishPath>$(OutputPath)examples\publish\</MBAPublishPath> |
@@ -27,9 +25,6 @@ | |||
27 | <SkipFDDx86>true</SkipFDDx86> | 25 | <SkipFDDx86>true</SkipFDDx86> |
28 | <SkipSCD>true</SkipSCD> | 26 | <SkipSCD>true</SkipSCD> |
29 | </CoreMBAProject> | 27 | </CoreMBAProject> |
30 | |||
31 | <FullMBAProject Include="$(FullFramework2MBAProjectPath)" /> | ||
32 | <FullMBAProject Include="$(FullFramework4MBAProjectPath)" /> | ||
33 | </ItemGroup> | 28 | </ItemGroup> |
34 | 29 | ||
35 | <Target Name="PublishCoreExamples" BeforeTargets="Build"> | 30 | <Target Name="PublishCoreExamples" BeforeTargets="Build"> |
@@ -41,7 +36,7 @@ | |||
41 | Condition="'%(CoreMBAProject.SkipSCD)'==''" /> | 36 | Condition="'%(CoreMBAProject.SkipSCD)'==''" /> |
42 | <!-- | 37 | <!-- |
43 | Publishing a library is "undefined" (per https://github.com/dotnet/runtime/issues/91535) | 38 | Publishing a library is "undefined" (per https://github.com/dotnet/runtime/issues/91535) |
44 | and is now a build error. This will go away when BAs go out of proc, so not spending a | 39 | and is now a build error. This will go away when BAs go out of proc, so not spending a |
45 | lot of time to keep building trimmed in VS 17.8. | 40 | lot of time to keep building trimmed in VS 17.8. |
46 | --> | 41 | --> |
47 | <Exec Command='dotnet publish -o "%(CoreMBAProject.PublishPath)\trimmedscd" -r win-x64 -c $(Configuration) --self-contained true -p:PublishTrimmed=false -p:TrimMode=%(CoreMBAProject.TrimMode) "%(CoreMBAProject.Identity)"' | 42 | <Exec Command='dotnet publish -o "%(CoreMBAProject.PublishPath)\trimmedscd" -r win-x64 -c $(Configuration) --self-contained true -p:PublishTrimmed=false -p:TrimMode=%(CoreMBAProject.TrimMode) "%(CoreMBAProject.Identity)"' |