aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Bal
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2021-05-03 15:55:48 -0700
committerRob Mensching <rob@firegiant.com>2021-05-03 15:55:48 -0700
commitba7bab476501c16e437b0aee71c1be02c3dda176 (patch)
tree814fba485c29a7dfe1adb396169e27ed641ef9a3 /src/ext/Bal
parent14987a72cc1a3493ca8f80693d273352fc314bd9 (diff)
downloadwix-ba7bab476501c16e437b0aee71c1be02c3dda176.tar.gz
wix-ba7bab476501c16e437b0aee71c1be02c3dda176.tar.bz2
wix-ba7bab476501c16e437b0aee71c1be02c3dda176.zip
Move Bal.wixext into ext
Diffstat (limited to 'src/ext/Bal')
-rw-r--r--src/ext/Bal/Bal.wixext.sln319
-rw-r--r--src/ext/Bal/CSharp.Build.props13
-rw-r--r--src/ext/Bal/Cpp.Build.props94
-rw-r--r--src/ext/Bal/Custom.Build.props11
-rw-r--r--src/ext/Bal/CustomizedNativeRecommendedRules.ruleset8
-rw-r--r--src/ext/Bal/Directory.Build.props29
-rw-r--r--src/ext/Bal/Directory.Build.targets56
-rw-r--r--src/ext/Bal/README.md2
-rw-r--r--src/ext/Bal/Samples/bafunctions/Readme.txt85
-rw-r--r--src/ext/Bal/Samples/bafunctions/WixSampleBAFunctions.cpp95
-rw-r--r--src/ext/Bal/Samples/bafunctions/bafunctions.cpp46
-rw-r--r--src/ext/Bal/Samples/bafunctions/bafunctions.def6
-rw-r--r--src/ext/Bal/Samples/bafunctions/bafunctions.vcxproj81
-rw-r--r--src/ext/Bal/Samples/bafunctions/packages.config7
-rw-r--r--src/ext/Bal/Samples/bafunctions/precomp.h52
-rw-r--r--src/ext/Bal/Samples/bafunctions/resource.h15
-rw-r--r--src/ext/Bal/WixToolset.Dnc.Host/BootstrapperApplicationFactory.cs89
-rw-r--r--src/ext/Bal/WixToolset.Dnc.Host/DnchostAssemblyLoadContext.cs58
-rw-r--r--src/ext/Bal/WixToolset.Dnc.Host/Exceptions.cs145
-rw-r--r--src/ext/Bal/WixToolset.Dnc.Host/IBootstrapperApplicationFactory.cs16
-rw-r--r--src/ext/Bal/WixToolset.Dnc.Host/NativeMethods.cs18
-rw-r--r--src/ext/Bal/WixToolset.Dnc.Host/WixToolset.Dnc.Host.csproj44
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/BootstrapperApplicationFactory.cs86
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/BootstrapperSectionGroup.cs29
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/Exceptions.cs145
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/HostSection.cs47
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/NativeMethods.cs18
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElement.cs47
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElementCollection.cs36
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.config26
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.csproj54
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.nuspec23
-rw-r--r--src/ext/Bal/appveyor.cmd17
-rw-r--r--src/ext/Bal/appveyor.yml40
-rw-r--r--src/ext/Bal/dnchost/coreclrhost.h137
-rw-r--r--src/ext/Bal/dnchost/dnchost.cpp309
-rw-r--r--src/ext/Bal/dnchost/dnchost.def6
-rw-r--r--src/ext/Bal/dnchost/dnchost.h35
-rw-r--r--src/ext/Bal/dnchost/dnchost.vcxproj106
-rw-r--r--src/ext/Bal/dnchost/dncutil.cpp411
-rw-r--r--src/ext/Bal/dnchost/dncutil.h38
-rw-r--r--src/ext/Bal/dnchost/packages.config13
-rw-r--r--src/ext/Bal/dnchost/precomp.cpp3
-rw-r--r--src/ext/Bal/dnchost/precomp.h31
-rw-r--r--src/ext/Bal/mbahost/mbahost.cpp649
-rw-r--r--src/ext/Bal/mbahost/mbahost.def6
-rw-r--r--src/ext/Bal/mbahost/mbahost.vcxproj106
-rw-r--r--src/ext/Bal/mbahost/packages.config10
-rw-r--r--src/ext/Bal/mbahost/precomp.cpp3
-rw-r--r--src/ext/Bal/mbahost/precomp.h25
-rw-r--r--src/ext/Bal/nuget.config19
-rw-r--r--src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs133
-rw-r--r--src/ext/Bal/test/WixToolsetTest.Bal/TestData/MBA/Bundle.wxs12
-rw-r--r--src/ext/Bal/test/WixToolsetTest.Bal/TestData/Overridable/Bundle.wxs13
-rw-r--r--src/ext/Bal/test/WixToolsetTest.Bal/TestData/WixStdBa/Bundle.wxs12
-rw-r--r--src/ext/Bal/test/WixToolsetTest.Bal/TestData/WixStdBa/Data/test.msibin0 -> 32768 bytes
-rw-r--r--src/ext/Bal/test/WixToolsetTest.Bal/TestData/WixStdBa/DisplayInternalUIConditionBundle.wxs12
-rw-r--r--src/ext/Bal/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj43
-rw-r--r--src/ext/Bal/test/WixToolsetTest.Bal/WixToolsetTest.Bal.v3.ncrunchproject5
-rw-r--r--src/ext/Bal/test/WixToolsetTest.ManagedHost/DncHostFixture.cs209
-rw-r--r--src/ext/Bal/test/WixToolsetTest.ManagedHost/MbaHostFixture.cs94
-rw-r--r--src/ext/Bal/test/WixToolsetTest.ManagedHost/README.md5
-rw-r--r--src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngine.cs74
-rw-r--r--src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngineResult.cs12
-rw-r--r--src/ext/Bal/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj25
-rw-r--r--src/ext/Bal/test/examples/Directory.Build.props6
-rw-r--r--src/ext/Bal/test/examples/Directory.Build.targets6
-rw-r--r--src/ext/Bal/test/examples/EarliestCoreBundleFDD/EarliestCoreBundleFDD.wixproj2
-rw-r--r--src/ext/Bal/test/examples/EarliestCoreBundleFDD/FrameworkDependentBundle.wxs16
-rw-r--r--src/ext/Bal/test/examples/EarliestCoreBundleSCD/EarliestCoreBundleSCD.wixproj10
-rw-r--r--src/ext/Bal/test/examples/EarliestCoreBundleSCD/SelfContainedBundle.wxs11
-rw-r--r--src/ext/Bal/test/examples/EarliestCoreBundleSCD/ba.xslt20
-rw-r--r--src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/EarliestCoreBundleTrimmedSCD.wixproj10
-rw-r--r--src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs11
-rw-r--r--src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/ba.xslt20
-rw-r--r--src/ext/Bal/test/examples/EarliestCoreMBA/EarliestCoreBA.cs34
-rw-r--r--src/ext/Bal/test/examples/EarliestCoreMBA/EarliestCoreBAFactory.cs22
-rw-r--r--src/ext/Bal/test/examples/EarliestCoreMBA/Example.EarliestCoreMBA.csproj18
-rw-r--r--src/ext/Bal/test/examples/FullFramework2Bundle/Bundle.wxs14
-rw-r--r--src/ext/Bal/test/examples/FullFramework2Bundle/FullFramework2Bundle.wixproj2
-rw-r--r--src/ext/Bal/test/examples/FullFramework2MBA/Example.FullFramework2MBA.csproj20
-rw-r--r--src/ext/Bal/test/examples/FullFramework2MBA/FullFramework2BA.cs34
-rw-r--r--src/ext/Bal/test/examples/FullFramework2MBA/FullFramework2BAFactory.cs22
-rw-r--r--src/ext/Bal/test/examples/FullFramework2MBA/WixToolset.Mba.Host.config20
-rw-r--r--src/ext/Bal/test/examples/FullFramework4Bundle/Bundle.wxs14
-rw-r--r--src/ext/Bal/test/examples/FullFramework4Bundle/FullFramework4Bundle.wixproj2
-rw-r--r--src/ext/Bal/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj19
-rw-r--r--src/ext/Bal/test/examples/FullFramework4MBA/FullFramework4BA.cs34
-rw-r--r--src/ext/Bal/test/examples/FullFramework4MBA/FullFramework4BAFactory.cs22
-rw-r--r--src/ext/Bal/test/examples/FullFramework4MBA/WixToolset.Mba.Host.config17
-rw-r--r--src/ext/Bal/test/examples/LatestCoreBundleFDD/FrameworkDependentBundle.wxs16
-rw-r--r--src/ext/Bal/test/examples/LatestCoreBundleFDD/LatestCoreBundleFDD.wixproj2
-rw-r--r--src/ext/Bal/test/examples/LatestCoreBundleSCD/LatestCoreBundleSCD.wixproj10
-rw-r--r--src/ext/Bal/test/examples/LatestCoreBundleSCD/SelfContainedBundle.wxs11
-rw-r--r--src/ext/Bal/test/examples/LatestCoreBundleSCD/ba.xslt20
-rw-r--r--src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/LatestCoreBundleTrimmedSCD.wixproj10
-rw-r--r--src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs11
-rw-r--r--src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/ba.xslt20
-rw-r--r--src/ext/Bal/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj21
-rw-r--r--src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBA.cs33
-rw-r--r--src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs22
-rw-r--r--src/ext/Bal/test/examples/TestEngine/Example.TestEngine.vcxproj83
-rw-r--r--src/ext/Bal/test/examples/TestEngine/ExampleTestEngine.cpp53
-rw-r--r--src/ext/Bal/test/examples/TestEngine/ReloadEngine.cpp55
-rw-r--r--src/ext/Bal/test/examples/TestEngine/ReloadEngine.h8
-rw-r--r--src/ext/Bal/test/examples/TestEngine/ShutdownEngine.cpp38
-rw-r--r--src/ext/Bal/test/examples/TestEngine/ShutdownEngine.h8
-rw-r--r--src/ext/Bal/test/examples/TestEngine/TestEngine.cpp256
-rw-r--r--src/ext/Bal/test/examples/TestEngine/TestEngine.h80
-rw-r--r--src/ext/Bal/test/examples/TestEngine/WaitForQuitEngine.cpp35
-rw-r--r--src/ext/Bal/test/examples/TestEngine/WaitForQuitEngine.h8
-rw-r--r--src/ext/Bal/test/examples/TestEngine/packages.config7
-rw-r--r--src/ext/Bal/test/examples/TestEngine/precomp.cpp3
-rw-r--r--src/ext/Bal/test/examples/TestEngine/precomp.h20
-rw-r--r--src/ext/Bal/test/examples/WPFCoreBundleFDD/FrameworkDependentBundle.wxs16
-rw-r--r--src/ext/Bal/test/examples/WPFCoreBundleFDD/WPFCoreBundleFDD.wixproj2
-rw-r--r--src/ext/Bal/test/examples/WPFCoreMBA/AssemblyInfo.cs12
-rw-r--r--src/ext/Bal/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj16
-rw-r--r--src/ext/Bal/test/examples/WPFCoreMBA/MainWindow.xaml16
-rw-r--r--src/ext/Bal/test/examples/WPFCoreMBA/MainWindow.xaml.cs17
-rw-r--r--src/ext/Bal/test/examples/WPFCoreMBA/WPFCoreBA.cs42
-rw-r--r--src/ext/Bal/test/examples/WPFCoreMBA/WPFCoreBAFactory.cs22
-rw-r--r--src/ext/Bal/test/examples/Wix.Build.props10
-rw-r--r--src/ext/Bal/test/examples/Wix.Build.targets8
-rw-r--r--src/ext/Bal/test/examples/examples.proj50
-rw-r--r--src/ext/Bal/wix.snkbin0 -> 596 bytes
-rw-r--r--src/ext/Bal/wixext/BalBurnBackendExtension.cs171
-rw-r--r--src/ext/Bal/wixext/BalCompiler.cs923
-rw-r--r--src/ext/Bal/wixext/BalErrors.cs61
-rw-r--r--src/ext/Bal/wixext/BalExtensionData.cs30
-rw-r--r--src/ext/Bal/wixext/BalExtensionFactory.cs18
-rw-r--r--src/ext/Bal/wixext/BalWarnings.cs31
-rw-r--r--src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs80
-rw-r--r--src/ext/Bal/wixext/Symbols/WixBalBAFactoryAssemblySymbol.cs55
-rw-r--r--src/ext/Bal/wixext/Symbols/WixBalBAFunctionsSymbol.cs47
-rw-r--r--src/ext/Bal/wixext/Symbols/WixBalConditionSymbol.cs55
-rw-r--r--src/ext/Bal/wixext/Symbols/WixBalPackageInfoSymbol.cs55
-rw-r--r--src/ext/Bal/wixext/Symbols/WixDncOptionsSymbol.cs47
-rw-r--r--src/ext/Bal/wixext/Symbols/WixMbaPrereqInformationSymbol.cs63
-rw-r--r--src/ext/Bal/wixext/Symbols/WixStdbaOptionsSymbol.cs79
-rw-r--r--src/ext/Bal/wixext/Symbols/WixStdbaOverridableVariableSymbol.cs47
-rw-r--r--src/ext/Bal/wixext/WixToolset.Bal.wixext.csproj39
-rw-r--r--src/ext/Bal/wixext/WixToolset.Bal.wixext.nuspec26
-rw-r--r--src/ext/Bal/wixext/WixToolset.Bal.wixext.targets11
-rw-r--r--src/ext/Bal/wixlib/BalExtension_arm64.wxs7
-rw-r--r--src/ext/Bal/wixlib/BalExtension_platform.wxi69
-rw-r--r--src/ext/Bal/wixlib/BalExtension_x64.wxs7
-rw-r--r--src/ext/Bal/wixlib/BalExtension_x86.wxs7
-rw-r--r--src/ext/Bal/wixlib/Dnc.wxs20
-rw-r--r--src/ext/Bal/wixlib/Mba.wxs43
-rw-r--r--src/ext/Bal/wixlib/bal.wixproj36
-rw-r--r--src/ext/Bal/wixlib/caDecor.wxi39
-rw-r--r--src/ext/Bal/wixlib/wixstdba.wxs92
-rw-r--r--src/ext/Bal/wixstdba/Resources/1028/mbapreq.wxl27
-rw-r--r--src/ext/Bal/wixstdba/Resources/1029/mbapreq.wxl30
-rw-r--r--src/ext/Bal/wixstdba/Resources/1030/mbapreq.wxl30
-rw-r--r--src/ext/Bal/wixstdba/Resources/1031/mbapreq.wxl33
-rw-r--r--src/ext/Bal/wixstdba/Resources/1032/mbapreq.wxl32
-rw-r--r--src/ext/Bal/wixstdba/Resources/1035/mbapreq.wxl30
-rw-r--r--src/ext/Bal/wixstdba/Resources/1036/mbapreq.wxl30
-rw-r--r--src/ext/Bal/wixstdba/Resources/1038/mbapreq.wxl30
-rw-r--r--src/ext/Bal/wixstdba/Resources/1040/mbapreq.wxl31
-rw-r--r--src/ext/Bal/wixstdba/Resources/1041/mbapreq.wxl27
-rw-r--r--src/ext/Bal/wixstdba/Resources/1042/mbapreq.wxl27
-rw-r--r--src/ext/Bal/wixstdba/Resources/1043/mbapreq.wxl30
-rw-r--r--src/ext/Bal/wixstdba/Resources/1044/mbapreq.wxl30
-rw-r--r--src/ext/Bal/wixstdba/Resources/1045/mbapreq.wxl30
-rw-r--r--src/ext/Bal/wixstdba/Resources/1046/mbapreq.wxl29
-rw-r--r--src/ext/Bal/wixstdba/Resources/1049/mbapreq.wxl29
-rw-r--r--src/ext/Bal/wixstdba/Resources/1051/mbapreq.wxl30
-rw-r--r--src/ext/Bal/wixstdba/Resources/1053/mbapreq.wxl30
-rw-r--r--src/ext/Bal/wixstdba/Resources/1055/mbapreq.wxl30
-rw-r--r--src/ext/Bal/wixstdba/Resources/1060/mbapreq.wxl30
-rw-r--r--src/ext/Bal/wixstdba/Resources/2052/mbapreq.wxl27
-rw-r--r--src/ext/Bal/wixstdba/Resources/2070/mbapreq.wxl29
-rw-r--r--src/ext/Bal/wixstdba/Resources/3082/mbapreq.wxl31
-rw-r--r--src/ext/Bal/wixstdba/Resources/HyperlinkLargeTheme.xml109
-rw-r--r--src/ext/Bal/wixstdba/Resources/HyperlinkSidebarTheme.xml120
-rw-r--r--src/ext/Bal/wixstdba/Resources/HyperlinkTheme.wxl61
-rw-r--r--src/ext/Bal/wixstdba/Resources/HyperlinkTheme.xml106
-rw-r--r--src/ext/Bal/wixstdba/Resources/LoremIpsumLicense.rtfbin0 -> 4908 bytes
-rw-r--r--src/ext/Bal/wixstdba/Resources/RtfLargeTheme.xml108
-rw-r--r--src/ext/Bal/wixstdba/Resources/RtfTheme.wxl58
-rw-r--r--src/ext/Bal/wixstdba/Resources/RtfTheme.xml106
-rw-r--r--src/ext/Bal/wixstdba/Resources/dncpreq.thm47
-rw-r--r--src/ext/Bal/wixstdba/Resources/dncpreq.wxl29
-rw-r--r--src/ext/Bal/wixstdba/Resources/logo.pngbin0 -> 852 bytes
-rw-r--r--src/ext/Bal/wixstdba/Resources/logoSide.pngbin0 -> 3477 bytes
-rw-r--r--src/ext/Bal/wixstdba/Resources/mbapreq.pngbin0 -> 797 bytes
-rw-r--r--src/ext/Bal/wixstdba/Resources/mbapreq.thm47
-rw-r--r--src/ext/Bal/wixstdba/Resources/mbapreq.wxl29
-rw-r--r--src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp4264
-rw-r--r--src/ext/Bal/wixstdba/packages.config10
-rw-r--r--src/ext/Bal/wixstdba/precomp.cpp3
-rw-r--r--src/ext/Bal/wixstdba/precomp.h58
-rw-r--r--src/ext/Bal/wixstdba/resource.h15
-rw-r--r--src/ext/Bal/wixstdba/wixstdba.cpp144
-rw-r--r--src/ext/Bal/wixstdba/wixstdba.def10
-rw-r--r--src/ext/Bal/wixstdba/wixstdba.mc73
-rw-r--r--src/ext/Bal/wixstdba/wixstdba.vcxproj101
200 files changed, 14198 insertions, 0 deletions
diff --git a/src/ext/Bal/Bal.wixext.sln b/src/ext/Bal/Bal.wixext.sln
new file mode 100644
index 00000000..0b4c5afa
--- /dev/null
+++ b/src/ext/Bal/Bal.wixext.sln
@@ -0,0 +1,319 @@
1
2Microsoft Visual Studio Solution File, Format Version 12.00
3# Visual Studio Version 16
4VisualStudioVersion = 16.0.29503.13
5MinimumVisualStudioVersion = 10.0.40219.1
6Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{C70E3534-A018-4D0A-A340-916C9777EEF7}"
7EndProject
8Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bafunctions", "src\Samples\bafunctions\bafunctions.vcxproj", "{EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}"
9EndProject
10Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mbahost", "src\mbahost\mbahost.vcxproj", "{12C87C77-3547-44F8-8134-29BC915CB19D}"
11EndProject
12Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wixstdba", "src\wixstdba\wixstdba.vcxproj", "{41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}"
13EndProject
14Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "bal", "src\wixlib\bal.wixproj", "{3444D952-F21C-496F-AB6B-56435BFD0787}"
15EndProject
16Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Bal.wixext", "src\wixext\WixToolset.Bal.wixext.csproj", "{BF720A63-9D7B-456E-B60C-8122852D9FED}"
17EndProject
18Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Dnc.Host", "src\WixToolset.Dnc.Host\WixToolset.Dnc.Host.csproj", "{0D780900-C2FF-4FA2-8CB5-8A19768724C5}"
19EndProject
20Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WixToolset.Mba.Host", "src\WixToolset.Mba.Host\WixToolset.Mba.Host.csproj", "{F2BA1935-70FA-4156-B161-FD03850B4FAA}"
21EndProject
22Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example.FullFramework2MBA", "src\test\examples\FullFramework2MBA\Example.FullFramework2MBA.csproj", "{CC4236FC-226E-4232-AB50-24CBEC4D314D}"
23EndProject
24Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Example.TestEngine", "src\test\examples\TestEngine\Example.TestEngine.vcxproj", "{3D44B67D-A475-49BA-8310-E39F6C117CC9}"
25EndProject
26Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.ManagedHost", "src\test\WixToolsetTest.ManagedHost\WixToolsetTest.ManagedHost.csproj", "{FED9D707-E5C3-4867-87B0-FABDB5EB0823}"
27EndProject
28Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example.FullFramework4MBA", "src\test\examples\FullFramework4MBA\Example.FullFramework4MBA.csproj", "{44297646-706D-4508-8E96-1B35B109694C}"
29EndProject
30Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.Bal", "src\test\WixToolsetTest.Bal\WixToolsetTest.Bal.csproj", "{89D479FC-20DA-44D8-AE38-48F063223498}"
31EndProject
32Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example.EarliestCoreMBA", "src\test\examples\EarliestCoreMBA\Example.EarliestCoreMBA.csproj", "{1E86D8DF-DABD-4B6E-A812-64CD2040C73A}"
33EndProject
34Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dnchost", "src\dnchost\dnchost.vcxproj", "{B6F70281-6583-4138-BB7F-AABFEBBB3CA2}"
35EndProject
36Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example.LatestCoreMBA", "src\test\examples\LatestCoreMBA\Example.LatestCoreMBA.csproj", "{A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}"
37EndProject
38Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example.WPFCoreMBA", "src\test\examples\WPFCoreMBA\Example.WPFCoreMBA.csproj", "{8E707BF2-FD72-4649-8727-BA5955D48D40}"
39EndProject
40Global
41 GlobalSection(SolutionConfigurationPlatforms) = preSolution
42 Debug|Any CPU = Debug|Any CPU
43 Debug|ARM64 = Debug|ARM64
44 Debug|x64 = Debug|x64
45 Debug|x86 = Debug|x86
46 Release|Any CPU = Release|Any CPU
47 Release|ARM64 = Release|ARM64
48 Release|x64 = Release|x64
49 Release|x86 = Release|x86
50 EndGlobalSection
51 GlobalSection(ProjectConfigurationPlatforms) = postSolution
52 {EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}.Debug|Any CPU.ActiveCfg = Debug|Win32
53 {EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}.Debug|Any CPU.Build.0 = Debug|Win32
54 {EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}.Debug|ARM64.ActiveCfg = Debug|ARM64
55 {EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}.Debug|ARM64.Build.0 = Debug|ARM64
56 {EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}.Debug|x64.ActiveCfg = Debug|x64
57 {EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}.Debug|x64.Build.0 = Debug|x64
58 {EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}.Debug|x86.ActiveCfg = Debug|Win32
59 {EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}.Debug|x86.Build.0 = Debug|Win32
60 {EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}.Release|Any CPU.ActiveCfg = Release|Win32
61 {EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}.Release|Any CPU.Build.0 = Release|Win32
62 {EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}.Release|ARM64.ActiveCfg = Release|ARM64
63 {EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}.Release|ARM64.Build.0 = Release|ARM64
64 {EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}.Release|x64.ActiveCfg = Release|x64
65 {EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}.Release|x64.Build.0 = Release|x64
66 {EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}.Release|x86.ActiveCfg = Release|Win32
67 {EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}.Release|x86.Build.0 = Release|Win32
68 {12C87C77-3547-44F8-8134-29BC915CB19D}.Debug|Any CPU.ActiveCfg = Debug|Win32
69 {12C87C77-3547-44F8-8134-29BC915CB19D}.Debug|Any CPU.Build.0 = Debug|Win32
70 {12C87C77-3547-44F8-8134-29BC915CB19D}.Debug|ARM64.ActiveCfg = Debug|ARM64
71 {12C87C77-3547-44F8-8134-29BC915CB19D}.Debug|ARM64.Build.0 = Debug|ARM64
72 {12C87C77-3547-44F8-8134-29BC915CB19D}.Debug|x64.ActiveCfg = Debug|x64
73 {12C87C77-3547-44F8-8134-29BC915CB19D}.Debug|x64.Build.0 = Debug|x64
74 {12C87C77-3547-44F8-8134-29BC915CB19D}.Debug|x86.ActiveCfg = Debug|Win32
75 {12C87C77-3547-44F8-8134-29BC915CB19D}.Debug|x86.Build.0 = Debug|Win32
76 {12C87C77-3547-44F8-8134-29BC915CB19D}.Release|Any CPU.ActiveCfg = Release|Win32
77 {12C87C77-3547-44F8-8134-29BC915CB19D}.Release|Any CPU.Build.0 = Release|Win32
78 {12C87C77-3547-44F8-8134-29BC915CB19D}.Release|ARM64.ActiveCfg = Release|ARM64
79 {12C87C77-3547-44F8-8134-29BC915CB19D}.Release|ARM64.Build.0 = Release|ARM64
80 {12C87C77-3547-44F8-8134-29BC915CB19D}.Release|x64.ActiveCfg = Release|x64
81 {12C87C77-3547-44F8-8134-29BC915CB19D}.Release|x64.Build.0 = Release|x64
82 {12C87C77-3547-44F8-8134-29BC915CB19D}.Release|x86.ActiveCfg = Release|Win32
83 {12C87C77-3547-44F8-8134-29BC915CB19D}.Release|x86.Build.0 = Release|Win32
84 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Debug|Any CPU.ActiveCfg = Debug|Win32
85 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Debug|Any CPU.Build.0 = Debug|Win32
86 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Debug|ARM64.ActiveCfg = Debug|ARM64
87 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Debug|ARM64.Build.0 = Debug|ARM64
88 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Debug|x64.ActiveCfg = Debug|x64
89 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Debug|x64.Build.0 = Debug|x64
90 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Debug|x86.ActiveCfg = Debug|Win32
91 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Debug|x86.Build.0 = Debug|Win32
92 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Release|Any CPU.ActiveCfg = Release|Win32
93 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Release|Any CPU.Build.0 = Release|Win32
94 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Release|ARM64.ActiveCfg = Release|ARM64
95 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Release|ARM64.Build.0 = Release|ARM64
96 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Release|x64.ActiveCfg = Release|x64
97 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Release|x64.Build.0 = Release|x64
98 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Release|x86.ActiveCfg = Release|Win32
99 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Release|x86.Build.0 = Release|Win32
100 {3444D952-F21C-496F-AB6B-56435BFD0787}.Debug|Any CPU.ActiveCfg = Debug|x86
101 {3444D952-F21C-496F-AB6B-56435BFD0787}.Debug|Any CPU.Build.0 = Debug|x86
102 {3444D952-F21C-496F-AB6B-56435BFD0787}.Debug|ARM64.ActiveCfg = Debug|x86
103 {3444D952-F21C-496F-AB6B-56435BFD0787}.Debug|x64.ActiveCfg = Debug|x86
104 {3444D952-F21C-496F-AB6B-56435BFD0787}.Debug|x86.ActiveCfg = Debug|x86
105 {3444D952-F21C-496F-AB6B-56435BFD0787}.Debug|x86.Build.0 = Debug|x86
106 {3444D952-F21C-496F-AB6B-56435BFD0787}.Release|Any CPU.ActiveCfg = Release|x86
107 {3444D952-F21C-496F-AB6B-56435BFD0787}.Release|Any CPU.Build.0 = Release|x86
108 {3444D952-F21C-496F-AB6B-56435BFD0787}.Release|ARM64.ActiveCfg = Release|x86
109 {3444D952-F21C-496F-AB6B-56435BFD0787}.Release|x64.ActiveCfg = Release|x86
110 {3444D952-F21C-496F-AB6B-56435BFD0787}.Release|x86.ActiveCfg = Release|x86
111 {3444D952-F21C-496F-AB6B-56435BFD0787}.Release|x86.Build.0 = Release|x86
112 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
113 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Debug|Any CPU.Build.0 = Debug|Any CPU
114 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Debug|ARM64.ActiveCfg = Debug|Any CPU
115 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Debug|ARM64.Build.0 = Debug|Any CPU
116 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Debug|x64.ActiveCfg = Debug|Any CPU
117 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Debug|x64.Build.0 = Debug|Any CPU
118 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Debug|x86.ActiveCfg = Debug|Any CPU
119 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Debug|x86.Build.0 = Debug|Any CPU
120 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Release|Any CPU.ActiveCfg = Release|Any CPU
121 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Release|Any CPU.Build.0 = Release|Any CPU
122 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Release|ARM64.ActiveCfg = Release|Any CPU
123 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Release|ARM64.Build.0 = Release|Any CPU
124 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Release|x64.ActiveCfg = Release|Any CPU
125 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Release|x64.Build.0 = Release|Any CPU
126 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Release|x86.ActiveCfg = Release|Any CPU
127 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Release|x86.Build.0 = Release|Any CPU
128 {0D780900-C2FF-4FA2-8CB5-8A19768724C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
129 {0D780900-C2FF-4FA2-8CB5-8A19768724C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
130 {0D780900-C2FF-4FA2-8CB5-8A19768724C5}.Debug|ARM64.ActiveCfg = Debug|Any CPU
131 {0D780900-C2FF-4FA2-8CB5-8A19768724C5}.Debug|ARM64.Build.0 = Debug|Any CPU
132 {0D780900-C2FF-4FA2-8CB5-8A19768724C5}.Debug|x64.ActiveCfg = Debug|Any CPU
133 {0D780900-C2FF-4FA2-8CB5-8A19768724C5}.Debug|x64.Build.0 = Debug|Any CPU
134 {0D780900-C2FF-4FA2-8CB5-8A19768724C5}.Debug|x86.ActiveCfg = Debug|Any CPU
135 {0D780900-C2FF-4FA2-8CB5-8A19768724C5}.Debug|x86.Build.0 = Debug|Any CPU
136 {0D780900-C2FF-4FA2-8CB5-8A19768724C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
137 {0D780900-C2FF-4FA2-8CB5-8A19768724C5}.Release|Any CPU.Build.0 = Release|Any CPU
138 {0D780900-C2FF-4FA2-8CB5-8A19768724C5}.Release|ARM64.ActiveCfg = Release|Any CPU
139 {0D780900-C2FF-4FA2-8CB5-8A19768724C5}.Release|ARM64.Build.0 = Release|Any CPU
140 {0D780900-C2FF-4FA2-8CB5-8A19768724C5}.Release|x64.ActiveCfg = Release|Any CPU
141 {0D780900-C2FF-4FA2-8CB5-8A19768724C5}.Release|x64.Build.0 = Release|Any CPU
142 {0D780900-C2FF-4FA2-8CB5-8A19768724C5}.Release|x86.ActiveCfg = Release|Any CPU
143 {0D780900-C2FF-4FA2-8CB5-8A19768724C5}.Release|x86.Build.0 = Release|Any CPU
144 {F2BA1935-70FA-4156-B161-FD03850B4FAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
145 {F2BA1935-70FA-4156-B161-FD03850B4FAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
146 {F2BA1935-70FA-4156-B161-FD03850B4FAA}.Debug|ARM64.ActiveCfg = Debug|Any CPU
147 {F2BA1935-70FA-4156-B161-FD03850B4FAA}.Debug|ARM64.Build.0 = Debug|Any CPU
148 {F2BA1935-70FA-4156-B161-FD03850B4FAA}.Debug|x64.ActiveCfg = Debug|Any CPU
149 {F2BA1935-70FA-4156-B161-FD03850B4FAA}.Debug|x64.Build.0 = Debug|Any CPU
150 {F2BA1935-70FA-4156-B161-FD03850B4FAA}.Debug|x86.ActiveCfg = Debug|Any CPU
151 {F2BA1935-70FA-4156-B161-FD03850B4FAA}.Debug|x86.Build.0 = Debug|Any CPU
152 {F2BA1935-70FA-4156-B161-FD03850B4FAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
153 {F2BA1935-70FA-4156-B161-FD03850B4FAA}.Release|Any CPU.Build.0 = Release|Any CPU
154 {F2BA1935-70FA-4156-B161-FD03850B4FAA}.Release|ARM64.ActiveCfg = Release|Any CPU
155 {F2BA1935-70FA-4156-B161-FD03850B4FAA}.Release|ARM64.Build.0 = Release|Any CPU
156 {F2BA1935-70FA-4156-B161-FD03850B4FAA}.Release|x64.ActiveCfg = Release|Any CPU
157 {F2BA1935-70FA-4156-B161-FD03850B4FAA}.Release|x64.Build.0 = Release|Any CPU
158 {F2BA1935-70FA-4156-B161-FD03850B4FAA}.Release|x86.ActiveCfg = Release|Any CPU
159 {F2BA1935-70FA-4156-B161-FD03850B4FAA}.Release|x86.Build.0 = Release|Any CPU
160 {CC4236FC-226E-4232-AB50-24CBEC4D314D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
161 {CC4236FC-226E-4232-AB50-24CBEC4D314D}.Debug|Any CPU.Build.0 = Debug|Any CPU
162 {CC4236FC-226E-4232-AB50-24CBEC4D314D}.Debug|ARM64.ActiveCfg = Debug|Any CPU
163 {CC4236FC-226E-4232-AB50-24CBEC4D314D}.Debug|ARM64.Build.0 = Debug|Any CPU
164 {CC4236FC-226E-4232-AB50-24CBEC4D314D}.Debug|x64.ActiveCfg = Debug|Any CPU
165 {CC4236FC-226E-4232-AB50-24CBEC4D314D}.Debug|x64.Build.0 = Debug|Any CPU
166 {CC4236FC-226E-4232-AB50-24CBEC4D314D}.Debug|x86.ActiveCfg = Debug|Any CPU
167 {CC4236FC-226E-4232-AB50-24CBEC4D314D}.Debug|x86.Build.0 = Debug|Any CPU
168 {CC4236FC-226E-4232-AB50-24CBEC4D314D}.Release|Any CPU.ActiveCfg = Release|Any CPU
169 {CC4236FC-226E-4232-AB50-24CBEC4D314D}.Release|Any CPU.Build.0 = Release|Any CPU
170 {CC4236FC-226E-4232-AB50-24CBEC4D314D}.Release|ARM64.ActiveCfg = Release|Any CPU
171 {CC4236FC-226E-4232-AB50-24CBEC4D314D}.Release|ARM64.Build.0 = Release|Any CPU
172 {CC4236FC-226E-4232-AB50-24CBEC4D314D}.Release|x64.ActiveCfg = Release|Any CPU
173 {CC4236FC-226E-4232-AB50-24CBEC4D314D}.Release|x64.Build.0 = Release|Any CPU
174 {CC4236FC-226E-4232-AB50-24CBEC4D314D}.Release|x86.ActiveCfg = Release|Any CPU
175 {CC4236FC-226E-4232-AB50-24CBEC4D314D}.Release|x86.Build.0 = Release|Any CPU
176 {3D44B67D-A475-49BA-8310-E39F6C117CC9}.Debug|Any CPU.ActiveCfg = Debug|Win32
177 {3D44B67D-A475-49BA-8310-E39F6C117CC9}.Debug|Any CPU.Build.0 = Debug|Win32
178 {3D44B67D-A475-49BA-8310-E39F6C117CC9}.Debug|ARM64.ActiveCfg = Debug|ARM64
179 {3D44B67D-A475-49BA-8310-E39F6C117CC9}.Debug|ARM64.Build.0 = Debug|ARM64
180 {3D44B67D-A475-49BA-8310-E39F6C117CC9}.Debug|x64.ActiveCfg = Debug|x64
181 {3D44B67D-A475-49BA-8310-E39F6C117CC9}.Debug|x64.Build.0 = Debug|x64
182 {3D44B67D-A475-49BA-8310-E39F6C117CC9}.Debug|x86.ActiveCfg = Debug|Win32
183 {3D44B67D-A475-49BA-8310-E39F6C117CC9}.Debug|x86.Build.0 = Debug|Win32
184 {3D44B67D-A475-49BA-8310-E39F6C117CC9}.Release|Any CPU.ActiveCfg = Release|Win32
185 {3D44B67D-A475-49BA-8310-E39F6C117CC9}.Release|Any CPU.Build.0 = Release|Win32
186 {3D44B67D-A475-49BA-8310-E39F6C117CC9}.Release|ARM64.ActiveCfg = Release|ARM64
187 {3D44B67D-A475-49BA-8310-E39F6C117CC9}.Release|ARM64.Build.0 = Release|ARM64
188 {3D44B67D-A475-49BA-8310-E39F6C117CC9}.Release|x64.ActiveCfg = Release|x64
189 {3D44B67D-A475-49BA-8310-E39F6C117CC9}.Release|x64.Build.0 = Release|x64
190 {3D44B67D-A475-49BA-8310-E39F6C117CC9}.Release|x86.ActiveCfg = Release|Win32
191 {3D44B67D-A475-49BA-8310-E39F6C117CC9}.Release|x86.Build.0 = Release|Win32
192 {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
193 {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|Any CPU.Build.0 = Debug|Any CPU
194 {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|ARM64.ActiveCfg = Debug|Any CPU
195 {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|ARM64.Build.0 = Debug|Any CPU
196 {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|x64.ActiveCfg = Debug|Any CPU
197 {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|x64.Build.0 = Debug|Any CPU
198 {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|x86.ActiveCfg = Debug|Any CPU
199 {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|x86.Build.0 = Debug|Any CPU
200 {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|Any CPU.ActiveCfg = Release|Any CPU
201 {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|Any CPU.Build.0 = Release|Any CPU
202 {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|ARM64.ActiveCfg = Release|Any CPU
203 {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|ARM64.Build.0 = Release|Any CPU
204 {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|x64.ActiveCfg = Release|Any CPU
205 {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|x64.Build.0 = Release|Any CPU
206 {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|x86.ActiveCfg = Release|Any CPU
207 {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|x86.Build.0 = Release|Any CPU
208 {44297646-706D-4508-8E96-1B35B109694C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
209 {44297646-706D-4508-8E96-1B35B109694C}.Debug|Any CPU.Build.0 = Debug|Any CPU
210 {44297646-706D-4508-8E96-1B35B109694C}.Debug|ARM64.ActiveCfg = Debug|Any CPU
211 {44297646-706D-4508-8E96-1B35B109694C}.Debug|ARM64.Build.0 = Debug|Any CPU
212 {44297646-706D-4508-8E96-1B35B109694C}.Debug|x64.ActiveCfg = Debug|Any CPU
213 {44297646-706D-4508-8E96-1B35B109694C}.Debug|x64.Build.0 = Debug|Any CPU
214 {44297646-706D-4508-8E96-1B35B109694C}.Debug|x86.ActiveCfg = Debug|Any CPU
215 {44297646-706D-4508-8E96-1B35B109694C}.Debug|x86.Build.0 = Debug|Any CPU
216 {44297646-706D-4508-8E96-1B35B109694C}.Release|Any CPU.ActiveCfg = Release|Any CPU
217 {44297646-706D-4508-8E96-1B35B109694C}.Release|Any CPU.Build.0 = Release|Any CPU
218 {44297646-706D-4508-8E96-1B35B109694C}.Release|ARM64.ActiveCfg = Release|Any CPU
219 {44297646-706D-4508-8E96-1B35B109694C}.Release|ARM64.Build.0 = Release|Any CPU
220 {44297646-706D-4508-8E96-1B35B109694C}.Release|x64.ActiveCfg = Release|Any CPU
221 {44297646-706D-4508-8E96-1B35B109694C}.Release|x64.Build.0 = Release|Any CPU
222 {44297646-706D-4508-8E96-1B35B109694C}.Release|x86.ActiveCfg = Release|Any CPU
223 {44297646-706D-4508-8E96-1B35B109694C}.Release|x86.Build.0 = Release|Any CPU
224 {89D479FC-20DA-44D8-AE38-48F063223498}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
225 {89D479FC-20DA-44D8-AE38-48F063223498}.Debug|Any CPU.Build.0 = Debug|Any CPU
226 {89D479FC-20DA-44D8-AE38-48F063223498}.Debug|ARM64.ActiveCfg = Debug|Any CPU
227 {89D479FC-20DA-44D8-AE38-48F063223498}.Debug|ARM64.Build.0 = Debug|Any CPU
228 {89D479FC-20DA-44D8-AE38-48F063223498}.Debug|x64.ActiveCfg = Debug|Any CPU
229 {89D479FC-20DA-44D8-AE38-48F063223498}.Debug|x64.Build.0 = Debug|Any CPU
230 {89D479FC-20DA-44D8-AE38-48F063223498}.Debug|x86.ActiveCfg = Debug|Any CPU
231 {89D479FC-20DA-44D8-AE38-48F063223498}.Debug|x86.Build.0 = Debug|Any CPU
232 {89D479FC-20DA-44D8-AE38-48F063223498}.Release|Any CPU.ActiveCfg = Release|Any CPU
233 {89D479FC-20DA-44D8-AE38-48F063223498}.Release|Any CPU.Build.0 = Release|Any CPU
234 {89D479FC-20DA-44D8-AE38-48F063223498}.Release|ARM64.ActiveCfg = Release|Any CPU
235 {89D479FC-20DA-44D8-AE38-48F063223498}.Release|ARM64.Build.0 = Release|Any CPU
236 {89D479FC-20DA-44D8-AE38-48F063223498}.Release|x64.ActiveCfg = Release|Any CPU
237 {89D479FC-20DA-44D8-AE38-48F063223498}.Release|x64.Build.0 = Release|Any CPU
238 {89D479FC-20DA-44D8-AE38-48F063223498}.Release|x86.ActiveCfg = Release|Any CPU
239 {89D479FC-20DA-44D8-AE38-48F063223498}.Release|x86.Build.0 = Release|Any CPU
240 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
241 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A}.Debug|Any CPU.Build.0 = Debug|Any CPU
242 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A}.Debug|ARM64.ActiveCfg = Debug|Any CPU
243 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A}.Debug|ARM64.Build.0 = Debug|Any CPU
244 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A}.Debug|x64.ActiveCfg = Debug|Any CPU
245 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A}.Debug|x64.Build.0 = Debug|Any CPU
246 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A}.Debug|x86.ActiveCfg = Debug|Any CPU
247 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A}.Debug|x86.Build.0 = Debug|Any CPU
248 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A}.Release|Any CPU.ActiveCfg = Release|Any CPU
249 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A}.Release|Any CPU.Build.0 = Release|Any CPU
250 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A}.Release|ARM64.ActiveCfg = Release|Any CPU
251 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A}.Release|ARM64.Build.0 = Release|Any CPU
252 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A}.Release|x64.ActiveCfg = Release|Any CPU
253 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A}.Release|x64.Build.0 = Release|Any CPU
254 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A}.Release|x86.ActiveCfg = Release|Any CPU
255 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A}.Release|x86.Build.0 = Release|Any CPU
256 {B6F70281-6583-4138-BB7F-AABFEBBB3CA2}.Debug|Any CPU.ActiveCfg = Debug|Win32
257 {B6F70281-6583-4138-BB7F-AABFEBBB3CA2}.Debug|Any CPU.Build.0 = Debug|Win32
258 {B6F70281-6583-4138-BB7F-AABFEBBB3CA2}.Debug|ARM64.ActiveCfg = Debug|ARM64
259 {B6F70281-6583-4138-BB7F-AABFEBBB3CA2}.Debug|ARM64.Build.0 = Debug|ARM64
260 {B6F70281-6583-4138-BB7F-AABFEBBB3CA2}.Debug|x64.ActiveCfg = Debug|x64
261 {B6F70281-6583-4138-BB7F-AABFEBBB3CA2}.Debug|x64.Build.0 = Debug|x64
262 {B6F70281-6583-4138-BB7F-AABFEBBB3CA2}.Debug|x86.ActiveCfg = Debug|Win32
263 {B6F70281-6583-4138-BB7F-AABFEBBB3CA2}.Debug|x86.Build.0 = Debug|Win32
264 {B6F70281-6583-4138-BB7F-AABFEBBB3CA2}.Release|Any CPU.ActiveCfg = Release|Win32
265 {B6F70281-6583-4138-BB7F-AABFEBBB3CA2}.Release|Any CPU.Build.0 = Release|Win32
266 {B6F70281-6583-4138-BB7F-AABFEBBB3CA2}.Release|ARM64.ActiveCfg = Release|ARM64
267 {B6F70281-6583-4138-BB7F-AABFEBBB3CA2}.Release|ARM64.Build.0 = Release|ARM64
268 {B6F70281-6583-4138-BB7F-AABFEBBB3CA2}.Release|x64.ActiveCfg = Release|x64
269 {B6F70281-6583-4138-BB7F-AABFEBBB3CA2}.Release|x64.Build.0 = Release|x64
270 {B6F70281-6583-4138-BB7F-AABFEBBB3CA2}.Release|x86.ActiveCfg = Release|Win32
271 {B6F70281-6583-4138-BB7F-AABFEBBB3CA2}.Release|x86.Build.0 = Release|Win32
272 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
273 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}.Debug|Any CPU.Build.0 = Debug|Any CPU
274 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}.Debug|ARM64.ActiveCfg = Debug|Any CPU
275 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}.Debug|ARM64.Build.0 = Debug|Any CPU
276 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}.Debug|x64.ActiveCfg = Debug|Any CPU
277 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}.Debug|x64.Build.0 = Debug|Any CPU
278 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}.Debug|x86.ActiveCfg = Debug|Any CPU
279 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}.Debug|x86.Build.0 = Debug|Any CPU
280 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}.Release|Any CPU.ActiveCfg = Release|Any CPU
281 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}.Release|Any CPU.Build.0 = Release|Any CPU
282 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}.Release|ARM64.ActiveCfg = Release|Any CPU
283 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}.Release|ARM64.Build.0 = Release|Any CPU
284 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}.Release|x64.ActiveCfg = Release|Any CPU
285 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}.Release|x64.Build.0 = Release|Any CPU
286 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}.Release|x86.ActiveCfg = Release|Any CPU
287 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618}.Release|x86.Build.0 = Release|Any CPU
288 {8E707BF2-FD72-4649-8727-BA5955D48D40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
289 {8E707BF2-FD72-4649-8727-BA5955D48D40}.Debug|Any CPU.Build.0 = Debug|Any CPU
290 {8E707BF2-FD72-4649-8727-BA5955D48D40}.Debug|ARM64.ActiveCfg = Debug|Any CPU
291 {8E707BF2-FD72-4649-8727-BA5955D48D40}.Debug|ARM64.Build.0 = Debug|Any CPU
292 {8E707BF2-FD72-4649-8727-BA5955D48D40}.Debug|x64.ActiveCfg = Debug|Any CPU
293 {8E707BF2-FD72-4649-8727-BA5955D48D40}.Debug|x64.Build.0 = Debug|Any CPU
294 {8E707BF2-FD72-4649-8727-BA5955D48D40}.Debug|x86.ActiveCfg = Debug|Any CPU
295 {8E707BF2-FD72-4649-8727-BA5955D48D40}.Debug|x86.Build.0 = Debug|Any CPU
296 {8E707BF2-FD72-4649-8727-BA5955D48D40}.Release|Any CPU.ActiveCfg = Release|Any CPU
297 {8E707BF2-FD72-4649-8727-BA5955D48D40}.Release|Any CPU.Build.0 = Release|Any CPU
298 {8E707BF2-FD72-4649-8727-BA5955D48D40}.Release|ARM64.ActiveCfg = Release|Any CPU
299 {8E707BF2-FD72-4649-8727-BA5955D48D40}.Release|ARM64.Build.0 = Release|Any CPU
300 {8E707BF2-FD72-4649-8727-BA5955D48D40}.Release|x64.ActiveCfg = Release|Any CPU
301 {8E707BF2-FD72-4649-8727-BA5955D48D40}.Release|x64.Build.0 = Release|Any CPU
302 {8E707BF2-FD72-4649-8727-BA5955D48D40}.Release|x86.ActiveCfg = Release|Any CPU
303 {8E707BF2-FD72-4649-8727-BA5955D48D40}.Release|x86.Build.0 = Release|Any CPU
304 EndGlobalSection
305 GlobalSection(SolutionProperties) = preSolution
306 HideSolutionNode = FALSE
307 EndGlobalSection
308 GlobalSection(NestedProjects) = preSolution
309 {CC4236FC-226E-4232-AB50-24CBEC4D314D} = {C70E3534-A018-4D0A-A340-916C9777EEF7}
310 {3D44B67D-A475-49BA-8310-E39F6C117CC9} = {C70E3534-A018-4D0A-A340-916C9777EEF7}
311 {44297646-706D-4508-8E96-1B35B109694C} = {C70E3534-A018-4D0A-A340-916C9777EEF7}
312 {1E86D8DF-DABD-4B6E-A812-64CD2040C73A} = {C70E3534-A018-4D0A-A340-916C9777EEF7}
313 {A4247D9D-3CC9-4BE1-B23A-BEC166AF3618} = {C70E3534-A018-4D0A-A340-916C9777EEF7}
314 {8E707BF2-FD72-4649-8727-BA5955D48D40} = {C70E3534-A018-4D0A-A340-916C9777EEF7}
315 EndGlobalSection
316 GlobalSection(ExtensibilityGlobals) = postSolution
317 SolutionGuid = {74046961-48BF-467A-A6C2-F886C75CE0BE}
318 EndGlobalSection
319EndGlobal
diff --git a/src/ext/Bal/CSharp.Build.props b/src/ext/Bal/CSharp.Build.props
new file mode 100644
index 00000000..81d24ad1
--- /dev/null
+++ b/src/ext/Bal/CSharp.Build.props
@@ -0,0 +1,13 @@
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 Do NOT modify this file. Update the canonical version in Home\repo-template\src\CSharp.Build.props
4 then update all of the repos.
5-->
6<Project>
7 <PropertyGroup>
8 <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
9 <SignAssembly>true</SignAssembly>
10 <AssemblyOriginatorKeyFile>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)wix.snk))</AssemblyOriginatorKeyFile>
11 <NBGV_EmitThisAssemblyClass>false</NBGV_EmitThisAssemblyClass>
12 </PropertyGroup>
13</Project>
diff --git a/src/ext/Bal/Cpp.Build.props b/src/ext/Bal/Cpp.Build.props
new file mode 100644
index 00000000..e7bba117
--- /dev/null
+++ b/src/ext/Bal/Cpp.Build.props
@@ -0,0 +1,94 @@
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>
5 <PropertyGroup>
6 <Platform Condition=" '$(Platform)' == '' OR '$(Platform)' == 'AnyCPU' ">Win32</Platform>
7 <IntDir>$(BaseIntermediateOutputPath)$(Configuration)\$(Platform)\</IntDir>
8 <OutDir>$(OutputPath)$(Platform)\</OutDir>
9
10 <!-- NBGV properties -->
11 <AssemblyCompany>$(Company)</AssemblyCompany>
12 <AssemblyCopyright>$(Copyright)</AssemblyCopyright>
13 </PropertyGroup>
14
15 <PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'=='' AND '$(VisualStudioVersion)'>='15.0'">
16 <WindowsTargetPlatformVersion>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</WindowsTargetPlatformVersion>
17 </PropertyGroup>
18
19 <PropertyGroup>
20 <CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CustomizedNativeRecommendedRules.ruleset</CodeAnalysisRuleSet>
21 </PropertyGroup>
22
23 <ItemDefinitionGroup>
24 <ClCompile>
25 <DisableSpecificWarnings>$(DisableSpecificCompilerWarnings)</DisableSpecificWarnings>
26 <WarningLevel>Level4</WarningLevel>
27 <AdditionalIncludeDirectories>$(ProjectDir)inc;$(MSBuildProjectDirectory);$(IntDir);$(SqlCESdkIncludePath);$(ProjectAdditionalIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
28 <PreprocessorDefinitions>WIN32;_WINDOWS;_WIN32_MSI=500;_WIN32_WINNT=0x0501;$(ArmPreprocessorDefinitions);$(UnicodePreprocessorDefinitions);_CRT_STDIO_LEGACY_WIDE_SPECIFIERS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
29 <PrecompiledHeader>Use</PrecompiledHeader>
30 <PrecompiledHeaderFile>precomp.h</PrecompiledHeaderFile>
31 <CallingConvention Condition="'$(Platform)'=='Win32'">StdCall</CallingConvention>
32 <TreatWarningAsError>true</TreatWarningAsError>
33 <ExceptionHandling>false</ExceptionHandling>
34 <AdditionalOptions>-YlprecompDefine</AdditionalOptions>
35 <AdditionalOptions Condition=" $(PlatformToolset.StartsWith('v14')) ">/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
36 <MultiProcessorCompilation Condition=" $(NUMBER_OF_PROCESSORS) &gt; 4 ">true</MultiProcessorCompilation>
37 </ClCompile>
38 <ResourceCompile>
39 <PreprocessorDefinitions>$(ArmPreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
40 <AdditionalIncludeDirectories>$(ProjectAdditionalResourceIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
41 </ResourceCompile>
42 <Lib>
43 <AdditionalLibraryDirectories>$(OutDir);$(AdditionalMultiTargetLibraryPath);$(ProjectAdditionalLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
44 </Lib>
45 <Link>
46 <SubSystem>$(ProjectSubSystem)</SubSystem>
47 <ModuleDefinitionFile>$(ProjectModuleDefinitionFile)</ModuleDefinitionFile>
48 <NoEntryPoint>$(ResourceOnlyDll)</NoEntryPoint>
49 <GenerateDebugInformation>true</GenerateDebugInformation>
50 <AdditionalDependencies>$(ProjectAdditionalLinkLibraries);advapi32.lib;comdlg32.lib;user32.lib;oleaut32.lib;gdi32.lib;shell32.lib;ole32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
51 <AdditionalLibraryDirectories>$(OutDir);$(AdditionalMultiTargetLibraryPath);$(ArmLibraryDirectories);$(ProjectAdditionalLinkLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
52 <AdditionalOptions Condition=" $(PlatformToolset.StartsWith('v14')) ">/IGNORE:4099 %(AdditionalOptions)</AdditionalOptions>
53 </Link>
54 </ItemDefinitionGroup>
55
56 <ItemDefinitionGroup Condition=" '$(Platform)'=='Win32' and '$(PlatformToolset)'!='v100'">
57 <ClCompile>
58 <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
59 </ClCompile>
60 </ItemDefinitionGroup>
61 <ItemDefinitionGroup Condition=" '$(Platform)'=='arm' ">
62 <ClCompile>
63 <CallingConvention>CDecl</CallingConvention>
64 </ClCompile>
65 </ItemDefinitionGroup>
66 <ItemDefinitionGroup Condition=" '$(ConfigurationType)'=='StaticLibrary' ">
67 <ClCompile>
68 <DebugInformationFormat>OldStyle</DebugInformationFormat>
69 <OmitDefaultLibName>true</OmitDefaultLibName>
70 <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
71 </ClCompile>
72 </ItemDefinitionGroup>
73 <ItemDefinitionGroup Condition=" '$(Configuration)'=='Debug' ">
74 <ClCompile>
75 <Optimization>Disabled</Optimization>
76 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
77 <PreprocessorDefinitions>_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
78 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
79 </ClCompile>
80 </ItemDefinitionGroup>
81 <ItemDefinitionGroup Condition=" '$(Configuration)'=='Release' ">
82 <ClCompile>
83 <Optimization>MinSpace</Optimization>
84 <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
85 <FunctionLevelLinking>true</FunctionLevelLinking>
86 <IntrinsicFunctions>true</IntrinsicFunctions>
87 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
88 </ClCompile>
89 <Link>
90 <EnableCOMDATFolding>true</EnableCOMDATFolding>
91 <OptimizeReferences>true</OptimizeReferences>
92 </Link>
93 </ItemDefinitionGroup>
94</Project>
diff --git a/src/ext/Bal/Custom.Build.props b/src/ext/Bal/Custom.Build.props
new file mode 100644
index 00000000..66e74d81
--- /dev/null
+++ b/src/ext/Bal/Custom.Build.props
@@ -0,0 +1,11 @@
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 xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 <PropertyGroup Condition="$(ProjectName.StartsWith('Example.')) And '$(MSBuildProjectExtension)'=='.csproj' ">
6 <OutputPath>$(OutputPath)examples\$(ProjectName)\</OutputPath>
7 </PropertyGroup>
8 <PropertyGroup Condition="$(ProjectName.StartsWith('Example.')) And '$(MSBuildProjectExtension)'=='.vcxproj' ">
9 <OutDir>$(OutDir)examples\$(ProjectName)\</OutDir>
10 </PropertyGroup>
11</Project>
diff --git a/src/ext/Bal/CustomizedNativeRecommendedRules.ruleset b/src/ext/Bal/CustomizedNativeRecommendedRules.ruleset
new file mode 100644
index 00000000..142b141c
--- /dev/null
+++ b/src/ext/Bal/CustomizedNativeRecommendedRules.ruleset
@@ -0,0 +1,8 @@
1<?xml version="1.0" encoding="utf-8"?>
2<RuleSet Name="Customized Microsoft Native Recommended Rules" Description="Microsoft Native Recommended Rules, -C26812" ToolsVersion="16.0">
3 <Include Path="nativerecommendedrules.ruleset" Action="Default" />
4 <Rules AnalyzerId="Microsoft.Analyzers.NativeCodeAnalysis" RuleNamespace="Microsoft.Rules.Native">
5 <!-- We need C style enums since we support BAs written in C -->
6 <Rule Id="C26812" Action="None" />
7 </Rules>
8</RuleSet> \ No newline at end of file
diff --git a/src/ext/Bal/Directory.Build.props b/src/ext/Bal/Directory.Build.props
new file mode 100644
index 00000000..f83cc154
--- /dev/null
+++ b/src/ext/Bal/Directory.Build.props
@@ -0,0 +1,29 @@
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 Do NOT modify this file. Update the canonical version in Home\repo-template\src\Directory.Build.props
5 then update all of the repos.
6-->
7<Project>
8 <PropertyGroup>
9 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
10 <EnableSourceLink Condition=" '$(NCrunch)' == '1' ">false</EnableSourceLink>
11 <MSBuildWarningsAsMessages>MSB3246</MSBuildWarningsAsMessages>
12
13 <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName>
14 <BaseOutputPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\))</BaseOutputPath>
15 <BaseIntermediateOutputPath>$(BaseOutputPath)obj\$(ProjectName)\</BaseIntermediateOutputPath>
16 <OutputPath>$(BaseOutputPath)$(Configuration)\</OutputPath>
17
18 <Authors>WiX Toolset Team</Authors>
19 <Company>WiX Toolset</Company>
20 <Copyright>Copyright (c) .NET Foundation and contributors. All rights reserved.</Copyright>
21 <PackageLicenseExpression>MS-RL</PackageLicenseExpression>
22 <Product>WiX Toolset</Product>
23 </PropertyGroup>
24
25 <Import Project="CSharp.Build.props" Condition=" '$(MSBuildProjectExtension)'=='.csproj' and Exists('CSharp.Build.props') " />
26 <Import Project="Cpp.Build.props" Condition=" Exists('Cpp.Build.props') And '$(MSBuildProjectExtension)'=='.vcxproj' " />
27 <Import Project="Wix.Build.props" Condition=" Exists('Wix.Build.props') And '$(MSBuildProjectExtension)'=='.wixproj' " />
28 <Import Project="Custom.Build.props" Condition=" Exists('Custom.Build.props') " />
29</Project>
diff --git a/src/ext/Bal/Directory.Build.targets b/src/ext/Bal/Directory.Build.targets
new file mode 100644
index 00000000..cb988931
--- /dev/null
+++ b/src/ext/Bal/Directory.Build.targets
@@ -0,0 +1,56 @@
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 Do NOT modify this file. Update the canonical version in Home\repo-template\src\Directory.Build.targets
5 then update all of the repos.
6-->
7<!--
8 Replace PackageReferences with ProjectReferences when the projects can be found in .sln.
9 See the original here: https://github.com/dotnet/sdk/issues/1151#issuecomment-385133284
10-->
11<Project>
12 <PropertyGroup>
13 <CreateDocumentation Condition=" '$(CreateDocumentationFile)'!='true' ">false</CreateDocumentation>
14 <DocumentationFile Condition=" '$(CreateDocumentationFile)'=='true' ">$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
15 </PropertyGroup>
16
17 <PropertyGroup>
18 <ReplacePackageReferences>true</ReplacePackageReferences>
19 <TheSolutionPath Condition=" '$(NCrunch)'=='' ">$(SolutionPath)</TheSolutionPath>
20 <TheSolutionPath Condition=" '$(NCrunch)'=='1' ">$(NCrunchOriginalSolutionPath)</TheSolutionPath>
21 </PropertyGroup>
22
23 <Choose>
24 <When Condition="$(ReplacePackageReferences) AND '$(TheSolutionPath)' != '' AND '$(TheSolutionPath)' != '*undefined*' AND Exists('$(TheSolutionPath)')">
25
26 <PropertyGroup>
27 <SolutionFileContent>$([System.IO.File]::ReadAllText($(TheSolutionPath)))</SolutionFileContent>
28 <SmartSolutionDir>$([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) ))</SmartSolutionDir>
29 <RegexPattern>(?&lt;="[PackageName]", ")(.*)(?=", ")</RegexPattern>
30 </PropertyGroup>
31
32 <ItemGroup>
33 <!-- Keep the identity of the PackageReference -->
34 <SmartPackageReference Include="@(PackageReference)">
35 <PackageName>%(Identity)</PackageName>
36 <InSolution>$(SolutionFileContent.Contains('\%(Identity).csproj'))</InSolution>
37 </SmartPackageReference>
38
39 <!-- Filter them by mapping them to another ItemGroup using the WithMetadataValue item function -->
40 <PackageInSolution Include="@(SmartPackageReference->WithMetadataValue('InSolution', True))">
41 <Pattern>$(RegexPattern.Replace('[PackageName]','%(PackageName)') )</Pattern>
42 <SmartPath>$([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)'))</SmartPath>
43 </PackageInSolution>
44
45 <ProjectReference Include="@(PackageInSolution->'$(SmartSolutionDir)\%(SmartPath)' )"/>
46
47 <!-- Remove the package references that are now referenced as projects -->
48 <PackageReference Remove="@(PackageInSolution->'%(PackageName)' )"/>
49 </ItemGroup>
50
51 </When>
52 </Choose>
53
54 <Import Project="Wix.Build.targets" Condition=" Exists('Wix.Build.targets') And '$(MSBuildProjectExtension)'=='.wixproj' " />
55 <Import Project="Custom.Build.targets" Condition=" Exists('Custom.Build.targets') " />
56</Project>
diff --git a/src/ext/Bal/README.md b/src/ext/Bal/README.md
new file mode 100644
index 00000000..cc5d9b34
--- /dev/null
+++ b/src/ext/Bal/README.md
@@ -0,0 +1,2 @@
1# Bal.wixext
2WixToolset.Bal.wixext - Bootstrapper Application Layer WiX Toolset Extension
diff --git a/src/ext/Bal/Samples/bafunctions/Readme.txt b/src/ext/Bal/Samples/bafunctions/Readme.txt
new file mode 100644
index 00000000..517d0d4c
--- /dev/null
+++ b/src/ext/Bal/Samples/bafunctions/Readme.txt
@@ -0,0 +1,85 @@
1
2This is a sample project showing how to create a BA function assembly.
3
4The four interfaces are in the WixSampleBAFunctions.cpp file.
5
6
7Example code:
8~~~~~~~~~~~~~
9
10
11 HRESULT hr = S_OK;
12 HKEY hkKey = NULL;
13 LPWSTR sczValue = NULL;
14 LPWSTR sczFormatedValue = NULL;
15
16
17 //---------------------------------------------------------------------------------------------
18 // Example of BA function failure
19 hr = E_NOTIMPL;
20 BalExitOnFailure(hr, "Test failure.");
21 //---------------------------------------------------------------------------------------------
22
23 //---------------------------------------------------------------------------------------------
24 // Example of setting a variables
25 hr = m_pEngine->SetVariableString(L"Variable1", L"String value");
26 BalExitOnFailure(hr, "Failed to set variable.");
27 hr = m_pEngine->SetVariableNumeric(L"Variable2", 1234);
28 BalExitOnFailure(hr, "Failed to set variable.");
29 //---------------------------------------------------------------------------------------------
30
31 //---------------------------------------------------------------------------------------------
32 // Example of reading burn variable.
33 BalGetStringVariable(L"WixBundleName", &sczValue);
34 BalExitOnFailure(hr, "Failed to get variable.");
35
36 hr = m_pEngine->SetVariableString(L"Variable4", sczValue);
37 BalExitOnFailure(hr, "Failed to set variable.");
38 //---------------------------------------------------------------------------------------------
39
40 ReleaseNullStr(sczValue); // Release string so it can be re-used
41
42 //---------------------------------------------------------------------------------------------
43 // Examples of reading burn variable and formatting it.
44 BalGetStringVariable(L"InstallFolder", &sczValue);
45 BalExitOnFailure(hr, "Failed to get variable.");
46
47 hr = m_pEngine->SetVariableString(L"Variable5", sczValue);
48 BalExitOnFailure(hr, "Failed to set variable.");
49
50 BalFormatString(sczValue, &sczFormatedValue);
51 BalExitOnFailure(hr, "Failed to format variable.");
52
53 hr = m_pEngine->SetVariableString(L"Variable6", sczFormatedValue);
54 BalExitOnFailure(hr, "Failed to set variable.");
55 //---------------------------------------------------------------------------------------------
56
57 ReleaseNullStr(sczValue); // Release string so it can be re-used
58
59 //---------------------------------------------------------------------------------------------
60 // Example of reading 64 bit registry and setting the InstallFolder variable to the value read.
61 hr = RegOpen(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v3.5", KEY_READ | KEY_WOW64_64KEY, &hkKey);
62 BalExitOnFailure(hr, "Failed to open registry key.");
63
64 hr = RegReadString(hkKey, L"InstallPath", &sczValue);
65 BalExitOnFailure(hr, "Failed to read registry value.");
66
67 // Example of function call
68 PathBackslashTerminate(&sczValue);
69
70 hr = m_pEngine->SetVariableString(L"InstallFolder", sczValue);
71 BalExitOnFailure(hr, "Failed to set variable.");
72 //---------------------------------------------------------------------------------------------
73
74 ReleaseNullStr(sczValue); // Release string so it can be re-used
75
76 //---------------------------------------------------------------------------------------------
77 // Example of calling a function that return HRESULT
78 hr = GetFileVersion();
79 BalExitOnFailure(hr, "Failed to get version.");
80 //---------------------------------------------------------------------------------------------
81
82 LExit:
83 ReleaseRegKey(hkKey);
84 ReleaseStr(sczValue);
85 ReleaseStr(sczFormatedValue);
diff --git a/src/ext/Bal/Samples/bafunctions/WixSampleBAFunctions.cpp b/src/ext/Bal/Samples/bafunctions/WixSampleBAFunctions.cpp
new file mode 100644
index 00000000..531b86a3
--- /dev/null
+++ b/src/ext/Bal/Samples/bafunctions/WixSampleBAFunctions.cpp
@@ -0,0 +1,95 @@
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#include "precomp.h"
4#include "BalBaseBAFunctions.h"
5#include "BalBaseBAFunctionsProc.h"
6
7class CWixSampleBAFunctions : public CBalBaseBAFunctions
8{
9public: // IBootstrapperApplication
10 virtual STDMETHODIMP OnDetectBegin(
11 __in BOOL fInstalled,
12 __in DWORD cPackages,
13 __inout BOOL* pfCancel
14 )
15 {
16 HRESULT hr = S_OK;
17
18 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Running detect begin BA function. fInstalled=%d, cPackages=%u, fCancel=%d", fInstalled, cPackages, *pfCancel);
19
20 //-------------------------------------------------------------------------------------------------
21 // YOUR CODE GOES HERE
22 BalExitOnFailure(hr, "Change this message to represent real error handling.");
23 //-------------------------------------------------------------------------------------------------
24
25 LExit:
26 return hr;
27 }
28
29public: // IBAFunctions
30 virtual STDMETHODIMP OnPlanBegin(
31 __in DWORD cPackages,
32 __inout BOOL* pfCancel
33 )
34 {
35 HRESULT hr = S_OK;
36
37 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Running plan begin BA function. cPackages=%u, fCancel=%d", cPackages, *pfCancel);
38
39 //-------------------------------------------------------------------------------------------------
40 // YOUR CODE GOES HERE
41 BalExitOnFailure(hr, "Change this message to represent real error handling.");
42 //-------------------------------------------------------------------------------------------------
43
44 LExit:
45 return hr;
46 }
47
48public:
49 //
50 // Constructor - initialize member variables.
51 //
52 CWixSampleBAFunctions(
53 __in HMODULE hModule,
54 __in IBootstrapperEngine* pEngine,
55 __in const BA_FUNCTIONS_CREATE_ARGS* pArgs
56 ) : CBalBaseBAFunctions(hModule, pEngine, pArgs)
57 {
58 }
59
60 //
61 // Destructor - release member variables.
62 //
63 ~CWixSampleBAFunctions()
64 {
65 }
66};
67
68
69HRESULT WINAPI CreateBAFunctions(
70 __in HMODULE hModule,
71 __in const BA_FUNCTIONS_CREATE_ARGS* pArgs,
72 __inout BA_FUNCTIONS_CREATE_RESULTS* pResults
73 )
74{
75 HRESULT hr = S_OK;
76 CWixSampleBAFunctions* pBAFunctions = NULL;
77 IBootstrapperEngine* pEngine = NULL;
78
79 // This is required to enable logging functions.
80 hr = BalInitializeFromCreateArgs(pArgs->pBootstrapperCreateArgs, &pEngine);
81 ExitOnFailure(hr, "Failed to initialize Bal.");
82
83 pBAFunctions = new CWixSampleBAFunctions(hModule, pEngine, pArgs);
84 ExitOnNull(pBAFunctions, hr, E_OUTOFMEMORY, "Failed to create new CWixSampleBAFunctions object.");
85
86 pResults->pfnBAFunctionsProc = BalBaseBAFunctionsProc;
87 pResults->pvBAFunctionsProcContext = pBAFunctions;
88 pBAFunctions = NULL;
89
90LExit:
91 ReleaseObject(pBAFunctions);
92 ReleaseObject(pEngine);
93
94 return hr;
95}
diff --git a/src/ext/Bal/Samples/bafunctions/bafunctions.cpp b/src/ext/Bal/Samples/bafunctions/bafunctions.cpp
new file mode 100644
index 00000000..b20f4230
--- /dev/null
+++ b/src/ext/Bal/Samples/bafunctions/bafunctions.cpp
@@ -0,0 +1,46 @@
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#include "precomp.h"
4
5static HINSTANCE vhInstance = NULL;
6
7extern "C" BOOL WINAPI DllMain(
8 IN HINSTANCE hInstance,
9 IN DWORD dwReason,
10 IN LPVOID /* pvReserved */
11 )
12{
13 switch (dwReason)
14 {
15 case DLL_PROCESS_ATTACH:
16 ::DisableThreadLibraryCalls(hInstance);
17 vhInstance = hInstance;
18 break;
19
20 case DLL_PROCESS_DETACH:
21 vhInstance = NULL;
22 break;
23 }
24
25 return TRUE;
26}
27
28extern "C" HRESULT WINAPI BAFunctionsCreate(
29 __in const BA_FUNCTIONS_CREATE_ARGS* pArgs,
30 __inout BA_FUNCTIONS_CREATE_RESULTS* pResults
31 )
32{
33 HRESULT hr = S_OK;
34
35 hr = CreateBAFunctions(vhInstance, pArgs, pResults);
36 BalExitOnFailure(hr, "Failed to create BAFunctions interface.");
37
38LExit:
39 return hr;
40}
41
42extern "C" void WINAPI BAFunctionsDestroy(
43 )
44{
45 BalUninitialize();
46}
diff --git a/src/ext/Bal/Samples/bafunctions/bafunctions.def b/src/ext/Bal/Samples/bafunctions/bafunctions.def
new file mode 100644
index 00000000..6e016dad
--- /dev/null
+++ b/src/ext/Bal/Samples/bafunctions/bafunctions.def
@@ -0,0 +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.
2
3
4EXPORTS
5 BAFunctionsCreate
6 BAFunctionsDestroy
diff --git a/src/ext/Bal/Samples/bafunctions/bafunctions.vcxproj b/src/ext/Bal/Samples/bafunctions/bafunctions.vcxproj
new file mode 100644
index 00000000..640c812d
--- /dev/null
+++ b/src/ext/Bal/Samples/bafunctions/bafunctions.vcxproj
@@ -0,0 +1,81 @@
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 DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 <Import Project="..\..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props" Condition="Exists('..\..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props')" />
6 <Import Project="..\..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props')" />
7 <Import Project="..\..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props" Condition="Exists('..\..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props')" />
8
9 <ItemGroup Label="ProjectConfigurations">
10 <ProjectConfiguration Include="Debug|ARM64">
11 <Configuration>Debug</Configuration>
12 <Platform>ARM64</Platform>
13 </ProjectConfiguration>
14 <ProjectConfiguration Include="Release|ARM64">
15 <Configuration>Release</Configuration>
16 <Platform>ARM64</Platform>
17 </ProjectConfiguration>
18 <ProjectConfiguration Include="Debug|Win32">
19 <Configuration>Debug</Configuration>
20 <Platform>Win32</Platform>
21 </ProjectConfiguration>
22 <ProjectConfiguration Include="Release|Win32">
23 <Configuration>Release</Configuration>
24 <Platform>Win32</Platform>
25 </ProjectConfiguration>
26 <ProjectConfiguration Include="Debug|x64">
27 <Configuration>Debug</Configuration>
28 <Platform>x64</Platform>
29 </ProjectConfiguration>
30 <ProjectConfiguration Include="Release|x64">
31 <Configuration>Release</Configuration>
32 <Platform>x64</Platform>
33 </ProjectConfiguration>
34 </ItemGroup>
35
36 <PropertyGroup Label="Globals">
37 <ProjectGuid>{EB0A7D51-2133-4EE7-B6CA-87DBEAC67E02}</ProjectGuid>
38 <ConfigurationType>DynamicLibrary</ConfigurationType>
39 <PlatformToolset>v142</PlatformToolset>
40 <CharacterSet>Unicode</CharacterSet>
41 <TargetName>BAFunctions</TargetName>
42 <ProjectModuleDefinitionFile>bafunctions.def</ProjectModuleDefinitionFile>
43 </PropertyGroup>
44
45 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
46 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
47
48 <PropertyGroup>
49 <ProjectAdditionalLinkLibraries>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;wininet.lib</ProjectAdditionalLinkLibraries>
50 </PropertyGroup>
51 <ItemGroup>
52 <ClCompile Include="WixSampleBAFunctions.cpp" />
53 <ClCompile Include="bafunctions.cpp">
54 <PrecompiledHeader>Create</PrecompiledHeader>
55 </ClCompile>
56 </ItemGroup>
57 <ItemGroup>
58 <ClInclude Include="precomp.h" />
59 <ClInclude Include="resource.h" />
60 </ItemGroup>
61 <ItemGroup>
62 <None Include="bafunctions.def" />
63 <None Include="Readme.txt" />
64 </ItemGroup>
65
66 <ItemGroup>
67 <None Include="packages.config" />
68 </ItemGroup>
69
70 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
71 <Import Project="..\..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets')" />
72 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
73 <PropertyGroup>
74 <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
75 </PropertyGroup>
76 <Error Condition="!Exists('..\..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props'))" />
77 <Error Condition="!Exists('..\..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props'))" />
78 <Error Condition="!Exists('..\..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props'))" />
79 <Error Condition="!Exists('..\..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets'))" />
80 </Target>
81</Project>
diff --git a/src/ext/Bal/Samples/bafunctions/packages.config b/src/ext/Bal/Samples/bafunctions/packages.config
new file mode 100644
index 00000000..548ddb48
--- /dev/null
+++ b/src/ext/Bal/Samples/bafunctions/packages.config
@@ -0,0 +1,7 @@
1<?xml version="1.0" encoding="utf-8"?>
2<packages>
3 <package id="Nerdbank.GitVersioning" version="3.3.37" targetFramework="native" developmentDependency="true" />
4 <package id="WixToolset.BootstrapperCore.Native" version="4.0.141" targetFramework="native" />
5 <package id="WixToolset.BalUtil" version="4.0.58" targetFramework="native" />
6 <package id="WixToolset.DUtil" version="4.0.72" targetFramework="native" />
7</packages> \ No newline at end of file
diff --git a/src/ext/Bal/Samples/bafunctions/precomp.h b/src/ext/Bal/Samples/bafunctions/precomp.h
new file mode 100644
index 00000000..9d2fe726
--- /dev/null
+++ b/src/ext/Bal/Samples/bafunctions/precomp.h
@@ -0,0 +1,52 @@
1#pragma once
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#include <windows.h>
6
7#pragma warning(push)
8#pragma warning(disable:4458) // declaration of 'xxx' hides class member
9#include <gdiplus.h>
10#pragma warning(pop)
11
12#include <msiquery.h>
13#include <objbase.h>
14#include <shlobj.h>
15#include <shlwapi.h>
16#include <stdlib.h>
17#include <strsafe.h>
18#include <CommCtrl.h>
19
20// Standard WiX header files, include as required
21#include "dutil.h"
22//#include "memutil.h"
23//#include "dictutil.h"
24//#include "dirutil.h"
25#include "fileutil.h"
26#include "locutil.h"
27//#include "logutil.h"
28#include "pathutil.h"
29//#include "resrutil.h"
30//#include "shelutil.h"
31#include "strutil.h"
32#include "thmutil.h"
33//#include "uriutil.h"
34//#include "xmlutil.h"
35#include "regutil.h"
36
37//#include "IBootstrapperEngine.h"
38//#include "IBootstrapperApplication.h"
39
40#include "BalBaseBootstrapperApplication.h"
41//#include "balinfo.h"
42//#include "balcondition.h"
43#include "balutil.h"
44
45#include "BAFunctions.h"
46#include "IBAFunctions.h"
47
48HRESULT WINAPI CreateBAFunctions(
49 __in HMODULE hModule,
50 __in const BA_FUNCTIONS_CREATE_ARGS* pArgs,
51 __inout BA_FUNCTIONS_CREATE_RESULTS* pResults
52 );
diff --git a/src/ext/Bal/Samples/bafunctions/resource.h b/src/ext/Bal/Samples/bafunctions/resource.h
new file mode 100644
index 00000000..149a8ff4
--- /dev/null
+++ b/src/ext/Bal/Samples/bafunctions/resource.h
@@ -0,0 +1,15 @@
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#define IDC_STATIC -1
4
5
6// Next default values for new objects
7//
8#ifdef APSTUDIO_INVOKED
9#ifndef APSTUDIO_READONLY_SYMBOLS
10#define _APS_NEXT_RESOURCE_VALUE 102
11#define _APS_NEXT_COMMAND_VALUE 40001
12#define _APS_NEXT_CONTROL_VALUE 1003
13#define _APS_NEXT_SYMED_VALUE 101
14#endif
15#endif
diff --git a/src/ext/Bal/WixToolset.Dnc.Host/BootstrapperApplicationFactory.cs b/src/ext/Bal/WixToolset.Dnc.Host/BootstrapperApplicationFactory.cs
new file mode 100644
index 00000000..d38fd1a9
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Dnc.Host/BootstrapperApplicationFactory.cs
@@ -0,0 +1,89 @@
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
3namespace WixToolset.Dnc.Host
4{
5 using System;
6 using System.Linq;
7 using System.Reflection;
8 using System.Runtime.InteropServices;
9
10 delegate IBootstrapperApplicationFactory StaticEntryDelegate([MarshalAs(UnmanagedType.LPWStr)] string baFactoryAssemblyName, [MarshalAs(UnmanagedType.LPWStr)] string baFactoryAssemblyPath);
11
12 /// <summary>
13 /// Entry point for the .NET Core host to create and return the BA to the engine.
14 /// Reflection is used instead of referencing WixToolset.Mba.Core directly to avoid requiring it in the AssemblyLoadContext.
15 /// </summary>
16 public sealed class BootstrapperApplicationFactory : IBootstrapperApplicationFactory
17 {
18 private string baFactoryAssemblyName;
19 private string baFactoryAssemblyPath;
20
21 public BootstrapperApplicationFactory(string baFactoryAssemblyName, string baFactoryAssemblyPath)
22 {
23 this.baFactoryAssemblyName = baFactoryAssemblyName;
24 this.baFactoryAssemblyPath = baFactoryAssemblyPath;
25 }
26
27 /// <summary>
28 /// Loads the bootstrapper application assembly and calls its IBootstrapperApplicationFactory.Create method.
29 /// </summary>
30 /// <param name="pArgs">Pointer to BOOTSTRAPPER_CREATE_ARGS struct.</param>
31 /// <param name="pResults">Pointer to BOOTSTRAPPER_CREATE_RESULTS struct.</param>
32 /// <exception cref="MissingAttributeException">The bootstrapper application assembly
33 /// does not define the <see cref="BootstrapperApplicationFactoryAttribute"/>.</exception>
34 public void Create(IntPtr pArgs, IntPtr pResults)
35 {
36 // Load the BA's IBootstrapperApplicationFactory.
37 var baFactoryType = BootstrapperApplicationFactory.GetBAFactoryTypeFromAssembly(this.baFactoryAssemblyName, this.baFactoryAssemblyPath);
38 var baFactory = Activator.CreateInstance(baFactoryType);
39 if (null == baFactory)
40 {
41 throw new InvalidBootstrapperApplicationFactoryException();
42 }
43
44 var createMethod = baFactoryType.GetMethod(nameof(Create), new[] { typeof(IntPtr), typeof(IntPtr) });
45 if (null == createMethod)
46 {
47 throw new InvalidBootstrapperApplicationFactoryException();
48 }
49 createMethod.Invoke(baFactory, new object[] { pArgs, pResults });
50 }
51
52 /// <summary>
53 /// Locates the <see cref="BootstrapperApplicationFactoryAttribute"/> and returns the specified type.
54 /// </summary>
55 /// <param name="assemblyName">The assembly that defines the IBootstrapperApplicationFactory implementation.</param>
56 /// <returns>The bootstrapper application factory <see cref="Type"/>.</returns>
57 private static Type GetBAFactoryTypeFromAssembly(string assemblyName, string assemblyPath)
58 {
59 // The default ALC shouldn't need help loading the assembly, since the host should have provided the deps.json
60 // when starting the runtime. But it doesn't hurt so keep this in case an isolated ALC is ever needed.
61 var alc = new DnchostAssemblyLoadContext(assemblyPath, false);
62 var asm = alc.LoadFromAssemblyName(new AssemblyName(assemblyName));
63
64 var attr = asm.GetCustomAttributes()
65 .Where(a => a.GetType().FullName == "WixToolset.Mba.Core.BootstrapperApplicationFactoryAttribute")
66 .SingleOrDefault();
67
68 if (null == attr)
69 {
70 throw new MissingAttributeException();
71 }
72
73 var baFactoryTypeProperty = attr.GetType().GetProperty("BootstrapperApplicationFactoryType", typeof(Type));
74 if (baFactoryTypeProperty == null || baFactoryTypeProperty.GetMethod == null)
75 {
76 throw new MissingAttributeException();
77 }
78
79 var baFactoryType = (Type)baFactoryTypeProperty.GetMethod.Invoke(attr, null);
80 return baFactoryType;
81 }
82
83 // Entry point for the DNC host.
84 public static IBootstrapperApplicationFactory CreateBAFactory([MarshalAs(UnmanagedType.LPWStr)] string baFactoryAssemblyName, [MarshalAs(UnmanagedType.LPWStr)] string baFactoryAssemblyPath)
85 {
86 return new BootstrapperApplicationFactory(baFactoryAssemblyName, baFactoryAssemblyPath);
87 }
88 }
89}
diff --git a/src/ext/Bal/WixToolset.Dnc.Host/DnchostAssemblyLoadContext.cs b/src/ext/Bal/WixToolset.Dnc.Host/DnchostAssemblyLoadContext.cs
new file mode 100644
index 00000000..1a383058
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Dnc.Host/DnchostAssemblyLoadContext.cs
@@ -0,0 +1,58 @@
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
3namespace WixToolset.Dnc.Host
4{
5 using System;
6 using System.Reflection;
7 using System.Runtime.Loader;
8
9 public sealed class DnchostAssemblyLoadContext : AssemblyLoadContext
10 {
11 private readonly AssemblyDependencyResolver resolver;
12
13 public DnchostAssemblyLoadContext(string assemblyPath, bool isolateFromDefault)
14 : base(nameof(DnchostAssemblyLoadContext), isolateFromDefault)
15 {
16 this.resolver = new AssemblyDependencyResolver(assemblyPath);
17
18 if (!this.IsCollectible)
19 {
20 AssemblyLoadContext.Default.Resolving += this.ResolveAssembly;
21 AssemblyLoadContext.Default.ResolvingUnmanagedDll += this.ResolveUnmanagedDll;
22 }
23 }
24
25 private Assembly ResolveAssembly(AssemblyLoadContext defaultAlc, AssemblyName assemblyName)
26 {
27 var path = this.resolver.ResolveAssemblyToPath(assemblyName);
28 if (path != null)
29 {
30 var targetAlc = this.IsCollectible ? this : defaultAlc;
31 return targetAlc.LoadFromAssemblyPath(path);
32 }
33
34 return null;
35 }
36
37 private IntPtr ResolveUnmanagedDll(Assembly assembly, string unmanagedDllName)
38 {
39 var path = this.resolver.ResolveUnmanagedDllToPath(unmanagedDllName);
40 if (path != null)
41 {
42 return this.LoadUnmanagedDllFromPath(path);
43 }
44
45 return IntPtr.Zero;
46 }
47
48 protected override Assembly Load(AssemblyName assemblyName)
49 {
50 return this.ResolveAssembly(AssemblyLoadContext.Default, assemblyName);
51 }
52
53 protected override IntPtr LoadUnmanagedDll(string unmanagedDllName)
54 {
55 return this.ResolveUnmanagedDll(null, unmanagedDllName);
56 }
57 }
58}
diff --git a/src/ext/Bal/WixToolset.Dnc.Host/Exceptions.cs b/src/ext/Bal/WixToolset.Dnc.Host/Exceptions.cs
new file mode 100644
index 00000000..32d4d4c5
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Dnc.Host/Exceptions.cs
@@ -0,0 +1,145 @@
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
3namespace WixToolset.Dnc.Host
4{
5 using System;
6 using System.Runtime.Serialization;
7
8 /// <summary>
9 /// Base class for exception returned to the bootstrapper application host.
10 /// </summary>
11 [Serializable]
12 public abstract class BootstrapperException : Exception
13 {
14 /// <summary>
15 /// Creates an instance of the <see cref="BootstrapperException"/> base class with the given HRESULT.
16 /// </summary>
17 /// <param name="hr">The HRESULT for the exception that is used by the bootstrapper application host.</param>
18 public BootstrapperException(int hr)
19 {
20 this.HResult = hr;
21 }
22
23 /// <summary>
24 /// Initializes a new instance of the <see cref="BootstrapperException"/> class.
25 /// </summary>
26 /// <param name="message">Exception message.</param>
27 public BootstrapperException(string message)
28 : base(message)
29 {
30 }
31
32 /// <summary>
33 /// Initializes a new instance of the <see cref="BootstrapperException"/> class.
34 /// </summary>
35 /// <param name="message">Exception message</param>
36 /// <param name="innerException">Inner exception associated with this one</param>
37 public BootstrapperException(string message, Exception innerException)
38 : base(message, innerException)
39 {
40 }
41
42 /// <summary>
43 /// Initializes a new instance of the <see cref="BootstrapperException"/> class.
44 /// </summary>
45 /// <param name="info">Serialization information for this exception</param>
46 /// <param name="context">Streaming context to serialize to</param>
47 protected BootstrapperException(SerializationInfo info, StreamingContext context)
48 : base(info, context)
49 {
50 }
51 }
52
53 /// <summary>
54 /// The bootstrapper application assembly loaded by the host does not contain exactly one instance of the
55 /// <see cref="Core.BootstrapperApplicationFactoryAttribute"/> class.
56 /// </summary>
57 /// <seealso cref="Core.BootstrapperApplicationFactoryAttribute"/>
58 [Serializable]
59 public class MissingAttributeException : BootstrapperException
60 {
61 /// <summary>
62 /// Creates a new instance of the <see cref="MissingAttributeException"/> class.
63 /// </summary>
64 public MissingAttributeException()
65 : base(NativeMethods.E_NOTFOUND)
66 {
67 }
68
69 /// <summary>
70 /// Initializes a new instance of the <see cref="MissingAttributeException"/> class.
71 /// </summary>
72 /// <param name="message">Exception message.</param>
73 public MissingAttributeException(string message)
74 : base(message)
75 {
76 }
77
78 /// <summary>
79 /// Initializes a new instance of the <see cref="MissingAttributeException"/> class.
80 /// </summary>
81 /// <param name="message">Exception message</param>
82 /// <param name="innerException">Inner exception associated with this one</param>
83 public MissingAttributeException(string message, Exception innerException)
84 : base(message, innerException)
85 {
86 }
87
88 /// <summary>
89 /// Initializes a new instance of the <see cref="MissingAttributeException"/> class.
90 /// </summary>
91 /// <param name="info">Serialization information for this exception</param>
92 /// <param name="context">Streaming context to serialize to</param>
93 protected MissingAttributeException(SerializationInfo info, StreamingContext context)
94 : base(info, context)
95 {
96 }
97 }
98
99 /// <summary>
100 /// The bootstrapper application factory specified by the <see cref="Core.BootstrapperApplicationFactoryAttribute"/>
101 /// does not extend the <see cref="Core.IBootstrapperApplicationFactory"/> base class.
102 /// </summary>
103 /// <seealso cref="Core.BaseBootstrapperApplicationFactory"/>
104 /// <seealso cref="Core.BootstrapperApplicationFactoryAttribute"/>
105 [Serializable]
106 public class InvalidBootstrapperApplicationFactoryException : BootstrapperException
107 {
108 /// <summary>
109 /// Creates a new instance of the <see cref="InvalidBootstrapperApplicationFactoryException"/> class.
110 /// </summary>
111 public InvalidBootstrapperApplicationFactoryException()
112 : base(NativeMethods.E_UNEXPECTED)
113 {
114 }
115
116 /// <summary>
117 /// Initializes a new instance of the <see cref="InvalidBootstrapperApplicationFactoryException"/> class.
118 /// </summary>
119 /// <param name="message">Exception message.</param>
120 public InvalidBootstrapperApplicationFactoryException(string message)
121 : base(message)
122 {
123 }
124
125 /// <summary>
126 /// Initializes a new instance of the <see cref="InvalidBootstrapperApplicationFactoryException"/> class.
127 /// </summary>
128 /// <param name="message">Exception message</param>
129 /// <param name="innerException">Inner exception associated with this one</param>
130 public InvalidBootstrapperApplicationFactoryException(string message, Exception innerException)
131 : base(message, innerException)
132 {
133 }
134
135 /// <summary>
136 /// Initializes a new instance of the <see cref="InvalidBootstrapperApplicationFactoryException"/> class.
137 /// </summary>
138 /// <param name="info">Serialization information for this exception</param>
139 /// <param name="context">Streaming context to serialize to</param>
140 protected InvalidBootstrapperApplicationFactoryException(SerializationInfo info, StreamingContext context)
141 : base(info, context)
142 {
143 }
144 }
145}
diff --git a/src/ext/Bal/WixToolset.Dnc.Host/IBootstrapperApplicationFactory.cs b/src/ext/Bal/WixToolset.Dnc.Host/IBootstrapperApplicationFactory.cs
new file mode 100644
index 00000000..96731192
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Dnc.Host/IBootstrapperApplicationFactory.cs
@@ -0,0 +1,16 @@
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
3namespace WixToolset.Dnc.Host
4{
5 using System;
6 using System.Runtime.InteropServices;
7
8 [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
9 public interface IBootstrapperApplicationFactory
10 {
11 void Create(
12 IntPtr pArgs,
13 IntPtr pResults
14 );
15 }
16}
diff --git a/src/ext/Bal/WixToolset.Dnc.Host/NativeMethods.cs b/src/ext/Bal/WixToolset.Dnc.Host/NativeMethods.cs
new file mode 100644
index 00000000..6dc393c6
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Dnc.Host/NativeMethods.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
3namespace WixToolset.Dnc.Host
4{
5 using System;
6 using System.Runtime.InteropServices;
7
8 /// <summary>
9 /// Contains native constants, functions, and structures for this assembly.
10 /// </summary>
11 internal static class NativeMethods
12 {
13 #region Error Constants
14 internal const int E_NOTFOUND = unchecked((int)0x80070490);
15 internal const int E_UNEXPECTED = unchecked((int)0x8000ffff);
16 #endregion
17 }
18}
diff --git a/src/ext/Bal/WixToolset.Dnc.Host/WixToolset.Dnc.Host.csproj b/src/ext/Bal/WixToolset.Dnc.Host/WixToolset.Dnc.Host.csproj
new file mode 100644
index 00000000..f347ca0b
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Dnc.Host/WixToolset.Dnc.Host.csproj
@@ -0,0 +1,44 @@
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>netcoreapp3.1</TargetFramework>
7 <RootNamespace>WixToolset.Dnc.Host</RootNamespace>
8 <Description>WiX Toolset .NET Core BA Host</Description>
9 <Title>WiX Toolset .NET Core BA Host</Title>
10 <DebugType>embedded</DebugType>
11 <PlatformTarget>AnyCPU</PlatformTarget>
12 </PropertyGroup>
13
14 <ItemGroup>
15 <HeaderPath Include="$(BaseOutputPath)obj\$(AssemblyName).h">
16 <Visible>False</Visible>
17 </HeaderPath>
18 </ItemGroup>
19
20 <Target Name="GenerateIdentityHeader" AfterTargets="Build" Inputs="$(TargetPath)" Outputs="@(HeaderPath)">
21 <GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
22 <Output TaskParameter="Assemblies" ItemName="AssemblyIdentity" />
23 </GetAssemblyIdentity>
24 <ItemGroup>
25 <Line Include='#define DNC_ASSEMBLY_FILE_NAME L"$(AssemblyName).dll"' />
26 <Line Include='#define DNC_ASSEMBLY_FULL_NAME "%(AssemblyIdentity.Identity)"' />
27 <Line Include='#define DNC_ENTRY_TYPE "$(RootNamespace).BootstrapperApplicationFactory"' />
28 <Line Include='#define DNC_ENTRY_TYPEW L"$(RootNamespace).BootstrapperApplicationFactory,$(AssemblyName)"' />
29 <Line Include='#define DNC_STATIC_ENTRY_METHOD "CreateBAFactory"' />
30 <Line Include='#define DNC_STATIC_ENTRY_METHODW L"CreateBAFactory"' />
31 <Line Include='#define DNC_STATIC_ENTRY_DELEGATEW L"$(RootNamespace).StaticEntryDelegate,$(AssemblyName)"' />
32 </ItemGroup>
33 <Message Importance="normal" Text="Generating identity definitions into @(HeaderPath->'%(FullPath)')" />
34 <WriteLinesToFile File="@(HeaderPath)" Lines="@(Line)" Overwrite="True" />
35 <ItemGroup>
36 <FileWrites Include="@(HeaderPath)" />
37 </ItemGroup>
38 </Target>
39
40 <ItemGroup>
41 <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="all" />
42 <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="all" />
43 </ItemGroup>
44</Project>
diff --git a/src/ext/Bal/WixToolset.Mba.Host/BootstrapperApplicationFactory.cs b/src/ext/Bal/WixToolset.Mba.Host/BootstrapperApplicationFactory.cs
new file mode 100644
index 00000000..78e68bd9
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/BootstrapperApplicationFactory.cs
@@ -0,0 +1,86 @@
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
3namespace WixToolset.Mba.Host
4{
5 using System;
6 using System.Configuration;
7 using System.Reflection;
8 using System.Runtime.InteropServices;
9 using WixToolset.Mba.Core;
10
11 /// <summary>
12 /// Entry point for the managed host to create and return the BA to the engine.
13 /// </summary>
14 [ClassInterface(ClassInterfaceType.None)]
15 public sealed class BootstrapperApplicationFactory : MarshalByRefObject, IBootstrapperApplicationFactory
16 {
17 /// <summary>
18 /// Creates a new instance of the <see cref="BootstrapperApplicationFactory"/> class.
19 /// Entry point for the MBA host.
20 /// </summary>
21 public BootstrapperApplicationFactory()
22 {
23 }
24
25 /// <summary>
26 /// Loads the bootstrapper application assembly and calls its IBootstrapperApplicationFactory.Create method.
27 /// </summary>
28 /// <param name="pArgs">Pointer to BOOTSTRAPPER_CREATE_ARGS struct.</param>
29 /// <param name="pResults">Pointer to BOOTSTRAPPER_CREATE_RESULTS struct.</param>
30 /// <exception cref="MissingAttributeException">The bootstrapper application assembly
31 /// does not define the <see cref="BootstrapperApplicationFactoryAttribute"/>.</exception>
32 public void Create(IntPtr pArgs, IntPtr pResults)
33 {
34 // Get the wix.boostrapper section group to get the name of the bootstrapper application assembly to host.
35 var section = ConfigurationManager.GetSection("wix.bootstrapper/host") as HostSection;
36 if (null == section)
37 {
38 throw new MissingAttributeException(); // TODO: throw a more specific exception than this.
39 }
40
41 // Load the BA's IBootstrapperApplicationFactory.
42 var baFactoryType = BootstrapperApplicationFactory.GetBAFactoryTypeFromAssembly(section.AssemblyName);
43 var baFactory = (IBootstrapperApplicationFactory)Activator.CreateInstance(baFactoryType);
44 if (null == baFactory)
45 {
46 throw new InvalidBootstrapperApplicationFactoryException();
47 }
48
49 baFactory.Create(pArgs, pResults);
50 }
51
52 /// <summary>
53 /// Locates the <see cref="BootstrapperApplicationFactoryAttribute"/> and returns the specified type.
54 /// </summary>
55 /// <param name="assemblyName">The assembly that defines the IBootstrapperApplicationFactory implementation.</param>
56 /// <returns>The bootstrapper application factory <see cref="Type"/>.</returns>
57 private static Type GetBAFactoryTypeFromAssembly(string assemblyName)
58 {
59 Type baFactoryType = null;
60
61 // Load the requested assembly.
62 Assembly asm = AppDomain.CurrentDomain.Load(assemblyName);
63
64 // If an assembly was loaded and is not the current assembly, check for the required attribute.
65 // This is done to avoid using the BootstrapperApplicationFactoryAttribute which we use at build time
66 // to specify the BootstrapperApplicationFactory assembly in the manifest.
67 if (!Assembly.GetExecutingAssembly().Equals(asm))
68 {
69 // There must be one and only one BootstrapperApplicationFactoryAttribute.
70 // The attribute prevents multiple declarations already.
71 var attrs = (BootstrapperApplicationFactoryAttribute[])asm.GetCustomAttributes(typeof(BootstrapperApplicationFactoryAttribute), false);
72 if (null != attrs)
73 {
74 baFactoryType = attrs[0].BootstrapperApplicationFactoryType;
75 }
76 }
77
78 if (null == baFactoryType)
79 {
80 throw new MissingAttributeException();
81 }
82
83 return baFactoryType;
84 }
85 }
86}
diff --git a/src/ext/Bal/WixToolset.Mba.Host/BootstrapperSectionGroup.cs b/src/ext/Bal/WixToolset.Mba.Host/BootstrapperSectionGroup.cs
new file mode 100644
index 00000000..5cf1bc9c
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/BootstrapperSectionGroup.cs
@@ -0,0 +1,29 @@
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
3namespace WixToolset.Mba.Host
4{
5 using System;
6 using System.Configuration;
7
8 /// <summary>
9 /// Handler for the wix.bootstrapper configuration section group.
10 /// </summary>
11 public class BootstrapperSectionGroup : ConfigurationSectionGroup
12 {
13 /// <summary>
14 /// Creates a new instance of the <see cref="BootstrapperSectionGroup"/> class.
15 /// </summary>
16 public BootstrapperSectionGroup()
17 {
18 }
19
20 /// <summary>
21 /// Gets the <see cref="HostSection"/> handler for the mba configuration section.
22 /// </summary>
23 [ConfigurationProperty("host")]
24 public HostSection Host
25 {
26 get { return (HostSection)base.Sections["host"]; }
27 }
28 }
29}
diff --git a/src/ext/Bal/WixToolset.Mba.Host/Exceptions.cs b/src/ext/Bal/WixToolset.Mba.Host/Exceptions.cs
new file mode 100644
index 00000000..c68951f0
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/Exceptions.cs
@@ -0,0 +1,145 @@
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
3namespace WixToolset.Mba.Host
4{
5 using System;
6 using System.Runtime.Serialization;
7
8 /// <summary>
9 /// Base class for exception returned to the bootstrapper application host.
10 /// </summary>
11 [Serializable]
12 public abstract class BootstrapperException : Exception
13 {
14 /// <summary>
15 /// Creates an instance of the <see cref="BootstrapperException"/> base class with the given HRESULT.
16 /// </summary>
17 /// <param name="hr">The HRESULT for the exception that is used by the bootstrapper application host.</param>
18 public BootstrapperException(int hr)
19 {
20 this.HResult = hr;
21 }
22
23 /// <summary>
24 /// Initializes a new instance of the <see cref="BootstrapperException"/> class.
25 /// </summary>
26 /// <param name="message">Exception message.</param>
27 public BootstrapperException(string message)
28 : base(message)
29 {
30 }
31
32 /// <summary>
33 /// Initializes a new instance of the <see cref="BootstrapperException"/> class.
34 /// </summary>
35 /// <param name="message">Exception message</param>
36 /// <param name="innerException">Inner exception associated with this one</param>
37 public BootstrapperException(string message, Exception innerException)
38 : base(message, innerException)
39 {
40 }
41
42 /// <summary>
43 /// Initializes a new instance of the <see cref="BootstrapperException"/> class.
44 /// </summary>
45 /// <param name="info">Serialization information for this exception</param>
46 /// <param name="context">Streaming context to serialize to</param>
47 protected BootstrapperException(SerializationInfo info, StreamingContext context)
48 : base(info, context)
49 {
50 }
51 }
52
53 /// <summary>
54 /// The bootstrapper application assembly loaded by the host does not contain exactly one instance of the
55 /// <see cref="Core.BootstrapperApplicationFactoryAttribute"/> class.
56 /// </summary>
57 /// <seealso cref="Core.BootstrapperApplicationFactoryAttribute"/>
58 [Serializable]
59 public class MissingAttributeException : BootstrapperException
60 {
61 /// <summary>
62 /// Creates a new instance of the <see cref="MissingAttributeException"/> class.
63 /// </summary>
64 public MissingAttributeException()
65 : base(NativeMethods.E_NOTFOUND)
66 {
67 }
68
69 /// <summary>
70 /// Initializes a new instance of the <see cref="MissingAttributeException"/> class.
71 /// </summary>
72 /// <param name="message">Exception message.</param>
73 public MissingAttributeException(string message)
74 : base(message)
75 {
76 }
77
78 /// <summary>
79 /// Initializes a new instance of the <see cref="MissingAttributeException"/> class.
80 /// </summary>
81 /// <param name="message">Exception message</param>
82 /// <param name="innerException">Inner exception associated with this one</param>
83 public MissingAttributeException(string message, Exception innerException)
84 : base(message, innerException)
85 {
86 }
87
88 /// <summary>
89 /// Initializes a new instance of the <see cref="MissingAttributeException"/> class.
90 /// </summary>
91 /// <param name="info">Serialization information for this exception</param>
92 /// <param name="context">Streaming context to serialize to</param>
93 protected MissingAttributeException(SerializationInfo info, StreamingContext context)
94 : base(info, context)
95 {
96 }
97 }
98
99 /// <summary>
100 /// The bootstrapper application factory specified by the <see cref="Core.BootstrapperApplicationFactoryAttribute"/>
101 /// does not extend the <see cref="Core.IBootstrapperApplicationFactory"/> base class.
102 /// </summary>
103 /// <seealso cref="Core.BaseBootstrapperApplicationFactory"/>
104 /// <seealso cref="Core.BootstrapperApplicationFactoryAttribute"/>
105 [Serializable]
106 public class InvalidBootstrapperApplicationFactoryException : BootstrapperException
107 {
108 /// <summary>
109 /// Creates a new instance of the <see cref="InvalidBootstrapperApplicationFactoryException"/> class.
110 /// </summary>
111 public InvalidBootstrapperApplicationFactoryException()
112 : base(NativeMethods.E_UNEXPECTED)
113 {
114 }
115
116 /// <summary>
117 /// Initializes a new instance of the <see cref="InvalidBootstrapperApplicationFactoryException"/> class.
118 /// </summary>
119 /// <param name="message">Exception message.</param>
120 public InvalidBootstrapperApplicationFactoryException(string message)
121 : base(message)
122 {
123 }
124
125 /// <summary>
126 /// Initializes a new instance of the <see cref="InvalidBootstrapperApplicationFactoryException"/> class.
127 /// </summary>
128 /// <param name="message">Exception message</param>
129 /// <param name="innerException">Inner exception associated with this one</param>
130 public InvalidBootstrapperApplicationFactoryException(string message, Exception innerException)
131 : base(message, innerException)
132 {
133 }
134
135 /// <summary>
136 /// Initializes a new instance of the <see cref="InvalidBootstrapperApplicationFactoryException"/> class.
137 /// </summary>
138 /// <param name="info">Serialization information for this exception</param>
139 /// <param name="context">Streaming context to serialize to</param>
140 protected InvalidBootstrapperApplicationFactoryException(SerializationInfo info, StreamingContext context)
141 : base(info, context)
142 {
143 }
144 }
145}
diff --git a/src/ext/Bal/WixToolset.Mba.Host/HostSection.cs b/src/ext/Bal/WixToolset.Mba.Host/HostSection.cs
new file mode 100644
index 00000000..632025c7
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/HostSection.cs
@@ -0,0 +1,47 @@
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
3namespace WixToolset.Mba.Host
4{
5 using System;
6 using System.Configuration;
7
8 /// <summary>
9 /// Handler for the Host configuration section.
10 /// </summary>
11 public sealed class HostSection : ConfigurationSection
12 {
13 private static readonly ConfigurationProperty assemblyNameProperty = new ConfigurationProperty("assemblyName", typeof(string), null, ConfigurationPropertyOptions.IsRequired);
14 private static readonly ConfigurationProperty supportedFrameworksProperty = new ConfigurationProperty("", typeof(SupportedFrameworkElementCollection), null, ConfigurationPropertyOptions.IsDefaultCollection);
15
16 /// <summary>
17 /// Creates a new instance of the <see cref="HostSection"/> class.
18 /// </summary>
19 public HostSection()
20 {
21 }
22
23 /// <summary>
24 /// Gets the name of the assembly that contians the <see cref="Core.IBootstrapperApplicationFactory"/> child class.
25 /// </summary>
26 /// <remarks>
27 /// The assembly specified by this name must contain the <see cref="Core.BootstrapperApplicationFactoryAttribute"/> to identify
28 /// the type of the <see cref="Core.IBootstrapperApplicationFactory"/> child class.
29 /// </remarks>
30 [ConfigurationProperty("assemblyName", IsRequired = true)]
31 public string AssemblyName
32 {
33 get { return (string)base[assemblyNameProperty]; }
34 set { base[assemblyNameProperty] = value; }
35 }
36
37 /// <summary>
38 /// Gets the <see cref="SupportedFrameworkElementCollection"/> of supported frameworks for the host configuration.
39 /// </summary>
40 [ConfigurationProperty("", IsDefaultCollection = true)]
41 [ConfigurationCollection(typeof(SupportedFrameworkElement))]
42 public SupportedFrameworkElementCollection SupportedFrameworks
43 {
44 get { return (SupportedFrameworkElementCollection)base[supportedFrameworksProperty]; }
45 }
46 }
47}
diff --git a/src/ext/Bal/WixToolset.Mba.Host/NativeMethods.cs b/src/ext/Bal/WixToolset.Mba.Host/NativeMethods.cs
new file mode 100644
index 00000000..b9fc85a0
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/NativeMethods.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
3namespace WixToolset.Mba.Host
4{
5 using System;
6 using System.Runtime.InteropServices;
7
8 /// <summary>
9 /// Contains native constants, functions, and structures for this assembly.
10 /// </summary>
11 internal static class NativeMethods
12 {
13 #region Error Constants
14 internal const int E_NOTFOUND = unchecked((int)0x80070490);
15 internal const int E_UNEXPECTED = unchecked((int)0x8000ffff);
16 #endregion
17 }
18}
diff --git a/src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElement.cs b/src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElement.cs
new file mode 100644
index 00000000..fe7fd2eb
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElement.cs
@@ -0,0 +1,47 @@
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
3namespace WixToolset.Mba.Host
4{
5 using System;
6 using System.Configuration;
7
8 /// <summary>
9 /// Handler for the supportedFramework configuration section.
10 /// </summary>
11 public sealed class SupportedFrameworkElement : ConfigurationElement
12 {
13 private static readonly ConfigurationProperty versionProperty = new ConfigurationProperty("version", typeof(string), null, ConfigurationPropertyOptions.IsRequired);
14 private static readonly ConfigurationProperty runtimeVersionProperty = new ConfigurationProperty("runtimeVersion", typeof(string));
15
16 /// <summary>
17 /// Creates a new instance of the <see cref="SupportedFrameworkElement"/> class.
18 /// </summary>
19 public SupportedFrameworkElement()
20 {
21 }
22
23 /// <summary>
24 /// Gets the version of the supported framework.
25 /// </summary>
26 /// <remarks>
27 /// The assembly specified by this name must contain a value matching the NETFX version registry key under
28 /// "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP".
29 /// </remarks>
30 [ConfigurationProperty("version", IsRequired = true)]
31 public string Version
32 {
33 get { return (string)base[versionProperty]; }
34 set { base[versionProperty] = value; }
35 }
36
37 /// <summary>
38 /// Gets the runtime version required by this supported framework.
39 /// </summary>
40 [ConfigurationProperty("runtimeVersion", IsRequired = false)]
41 public string RuntimeVersion
42 {
43 get { return (string)base[runtimeVersionProperty]; }
44 set { base[runtimeVersionProperty] = value; }
45 }
46 }
47}
diff --git a/src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElementCollection.cs b/src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElementCollection.cs
new file mode 100644
index 00000000..12c7cf3e
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElementCollection.cs
@@ -0,0 +1,36 @@
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
3namespace WixToolset.Mba.Host
4{
5 using System;
6 using System.Configuration;
7 using System.Diagnostics.CodeAnalysis;
8
9 /// <summary>
10 /// Handler for the supportedFramework collection.
11 /// </summary>
12 [SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface")]
13 [ConfigurationCollection(typeof(SupportedFrameworkElement), AddItemName = "supportedFramework", CollectionType = ConfigurationElementCollectionType.BasicMap)]
14 public sealed class SupportedFrameworkElementCollection : ConfigurationElementCollection
15 {
16 public override ConfigurationElementCollectionType CollectionType
17 {
18 get { return ConfigurationElementCollectionType.BasicMap; }
19 }
20
21 protected override string ElementName
22 {
23 get { return "supportedFramework"; }
24 }
25
26 protected override ConfigurationElement CreateNewElement()
27 {
28 return new SupportedFrameworkElement();
29 }
30
31 protected override object GetElementKey(ConfigurationElement element)
32 {
33 return (element as SupportedFrameworkElement).Version;
34 }
35 }
36}
diff --git a/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.config b/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.config
new file mode 100644
index 00000000..a19b66f1
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.config
@@ -0,0 +1,26 @@
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 useLegacyV2RuntimeActivationPolicy="true">
12 <supportedRuntime version="v4.0" />
13 <supportedRuntime version="v2.0.50727" />
14 </startup>
15 <wix.bootstrapper>
16 <!-- Example only. Use only if the startup/supportedRuntime above cannot discern supported frameworks. -->
17 <!--
18 <supportedFramework version="v4\Client" />
19 <supportedFramework version="v3.5" />
20 <supportedFramework version="v3.0" />
21 -->
22
23 <!-- Example only. Replace the host/@assemblyName attribute with assembly that implements IBootstrapperApplicationFactory. -->
24 <host assemblyName="AssemblyWithClassThatInheritsFromBootstrapperApplicationFactory" />
25 </wix.bootstrapper>
26</configuration>
diff --git a/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.csproj b/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.csproj
new file mode 100644
index 00000000..3ee0ad1e
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.csproj
@@ -0,0 +1,54 @@
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 <AssemblyName>WixToolset.Mba.Host</AssemblyName>
7 <RootNamespace>WixToolset.Mba.Host</RootNamespace>
8 <TargetFrameworks>net20</TargetFrameworks>
9 <Description>Managed Bootstrapper Application entry point</Description>
10 <DebugType>embedded</DebugType>
11 <NuspecFile>$(MSBuildThisFileName).nuspec</NuspecFile>
12 <PlatformTarget>AnyCPU</PlatformTarget>
13 </PropertyGroup>
14
15 <ItemGroup>
16 <None Include="WixToolset.Mba.Host.config" CopyToOutputDirectory="PreserveNewest" />
17 </ItemGroup>
18 <ItemGroup>
19 <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
20 <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="All" />
21 <PackageReference Include="WixToolset.Mba.Core" Version="4.0.*" />
22 </ItemGroup>
23 <ItemGroup>
24 <Reference Include="System.Configuration" />
25 </ItemGroup>
26 <ItemGroup>
27 <HeaderPath Include="$(BaseOutputPath)obj\$(AssemblyName).h">
28 <Visible>False</Visible>
29 </HeaderPath>
30 </ItemGroup>
31
32 <Target Name="GenerateIdentityHeader" AfterTargets="Build" Inputs="$(TargetPath)" Outputs="@(HeaderPath)">
33 <GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
34 <Output TaskParameter="Assemblies" ItemName="AssemblyIdentity" />
35 </GetAssemblyIdentity>
36 <ItemGroup>
37 <Line Include='#define MBA_ASSEMBLY_FULL_NAME L"%(AssemblyIdentity.Identity)"' />
38 <Line Include='#define MBA_CONFIG_FILE_NAME L"$(AssemblyName).config"' />
39 <Line Include='#define MBA_ENTRY_TYPE L"$(RootNamespace).BootstrapperApplicationFactory"' />
40 </ItemGroup>
41 <Message Importance="normal" Text="Generating identity definitions into @(HeaderPath->'%(FullPath)')" />
42 <WriteLinesToFile File="@(HeaderPath)" Lines="@(Line)" Overwrite="True" />
43 <ItemGroup>
44 <FileWrites Include="@(HeaderPath)" />
45 </ItemGroup>
46 </Target>
47
48 <Target Name="SetNuspecProperties" DependsOnTargets="InitializeSourceControlInformation" AfterTargets="GetBuildVersion">
49 <PropertyGroup>
50 <NuspecBasePath>$(OutputPath)</NuspecBasePath>
51 <NuspecProperties>Id=$(AssemblyName);Version=$(BuildVersionSimple);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description);RepositoryCommit=$(SourceRevisionId);RepositoryType=$(RepositoryType);RepositoryUrl=$(PrivateRepositoryUrl)</NuspecProperties>
52 </PropertyGroup>
53 </Target>
54</Project> \ No newline at end of file
diff --git a/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.nuspec b/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.nuspec
new file mode 100644
index 00000000..00fd21ac
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.nuspec
@@ -0,0 +1,23 @@
1<?xml version="1.0"?>
2<package >
3 <metadata>
4 <id>$id$</id>
5 <version>$version$</version>
6 <authors>WiX Toolset Team</authors>
7 <owners>WiX Toolset Team</owners>
8 <license type="expression">MS-RL</license>
9 <projectUrl>https://github.com/wixtoolset/Bal.wixext</projectUrl>
10 <requireLicenseAcceptance>false</requireLicenseAcceptance>
11 <description>$description$</description>
12 <copyright>$copyright$</copyright>
13 <repository type="$repositorytype$" url="$repositoryurl$" commit="$repositorycommit$" />
14 <dependencies>
15 <group targetFramework=".NETFramework2.0" />
16 </dependencies>
17 </metadata>
18
19 <files>
20 <file src="net20\$id$.config" target="samples" />
21 <file src="net20\$id$.dll" target="lib\net20" />
22 </files>
23</package>
diff --git a/src/ext/Bal/appveyor.cmd b/src/ext/Bal/appveyor.cmd
new file mode 100644
index 00000000..f4e9c26e
--- /dev/null
+++ b/src/ext/Bal/appveyor.cmd
@@ -0,0 +1,17 @@
1@setlocal
2@pushd %~dp0
3@set _C=Release
4
5nuget restore || exit /b
6
7msbuild -p:Configuration=%_C% -Restore || exit /b
8msbuild -p:Configuration=%_C% src\test\examples\examples.proj || exit /b
9
10dotnet test -c %_C% --no-build src\test\WixToolsetTest.Bal || exit /b
11dotnet test -c %_C% --no-build src\test\WixToolsetTest.ManagedHost || exit /b
12
13msbuild -p:Configuration=%_C% -p:NoBuild=true -t:Pack src\wixext\WixToolset.Bal.wixext.csproj || exit /b
14msbuild -p:Configuration=%_C% -p:NoBuild=true -t:Pack src\WixToolset.Mba.Host\WixToolset.Mba.Host.csproj || exit /b
15
16@popd
17@endlocal
diff --git a/src/ext/Bal/appveyor.yml b/src/ext/Bal/appveyor.yml
new file mode 100644
index 00000000..7c686b04
--- /dev/null
+++ b/src/ext/Bal/appveyor.yml
@@ -0,0 +1,40 @@
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# Do NOT modify this file. Update the canonical version in Home\repo-template\src\appveyor.yml
4# then update all of the repos.
5
6branches:
7 only:
8 - master
9 - develop
10
11image: Visual Studio 2019
12
13version: 0.0.0.{build}
14configuration: Release
15
16environment:
17 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
18 DOTNET_CLI_TELEMETRY_OPTOUT: 1
19 NUGET_XMLDOC_MODE: skip
20
21build_script:
22 - appveyor.cmd
23
24pull_requests:
25 do_not_increment_build_number: true
26
27nuget:
28 disable_publish_on_pr: true
29
30skip_branch_with_pr: true
31skip_tags: true
32
33artifacts:
34- path: build\Release\**\*.nupkg
35 name: nuget
36
37notifications:
38- provider: Slack
39 incoming_webhook:
40 secure: p5xuu+4x2JHfwGDMDe5KcG1k7gZxqYc4jWVwvyNZv5cvkubPD2waJs5yXMAXZNN7Z63/3PWHb7q4KoY/99AjauYa1nZ4c5qYqRPFRBKTHfA=
diff --git a/src/ext/Bal/dnchost/coreclrhost.h b/src/ext/Bal/dnchost/coreclrhost.h
new file mode 100644
index 00000000..07f28735
--- /dev/null
+++ b/src/ext/Bal/dnchost/coreclrhost.h
@@ -0,0 +1,137 @@
1// Licensed to the .NET Foundation under one or more agreements.
2// The .NET Foundation licenses this file to you under the MIT license.
3// See the LICENSE file in the project root for more information.
4
5
6
7// ***** ABOUT THIS HEADER *****
8// **************************************************************************************
9//
10// This is the version on 2019-12-22 from
11// https://github.com/dotnet/runtime/blob/master/src/coreclr/src/coreclr/hosts/inc/coreclrhost.h
12//
13// **************************************************************************************
14// ****************************
15
16
17//
18// APIs for hosting CoreCLR
19//
20
21#ifndef __CORECLR_HOST_H__
22#define __CORECLR_HOST_H__
23
24#if defined(_WIN32) && defined(_M_IX86)
25#define CORECLR_CALLING_CONVENTION __stdcall
26#else
27#define CORECLR_CALLING_CONVENTION
28#endif
29
30// For each hosting API, we define a function prototype and a function pointer
31// The prototype is useful for implicit linking against the dynamic coreclr
32// library and the pointer for explicit dynamic loading (dlopen, LoadLibrary)
33#define CORECLR_HOSTING_API(function, ...) \
34 extern "C" int CORECLR_CALLING_CONVENTION function(__VA_ARGS__); \
35 typedef int (CORECLR_CALLING_CONVENTION *function##_ptr)(__VA_ARGS__)
36
37//
38// Initialize the CoreCLR. Creates and starts CoreCLR host and creates an app domain
39//
40// Parameters:
41// exePath - Absolute path of the executable that invoked the ExecuteAssembly (the native host application)
42// appDomainFriendlyName - Friendly name of the app domain that will be created to execute the assembly
43// propertyCount - Number of properties (elements of the following two arguments)
44// propertyKeys - Keys of properties of the app domain
45// propertyValues - Values of properties of the app domain
46// hostHandle - Output parameter, handle of the created host
47// domainId - Output parameter, id of the created app domain
48//
49// Returns:
50// HRESULT indicating status of the operation. S_OK if the assembly was successfully executed
51//
52CORECLR_HOSTING_API(coreclr_initialize,
53 const char* exePath,
54 const char* appDomainFriendlyName,
55 int propertyCount,
56 const char** propertyKeys,
57 const char** propertyValues,
58 void** hostHandle,
59 unsigned int* domainId);
60
61//
62// Shutdown CoreCLR. It unloads the app domain and stops the CoreCLR host.
63//
64// Parameters:
65// hostHandle - Handle of the host
66// domainId - Id of the domain
67//
68// Returns:
69// HRESULT indicating status of the operation. S_OK if the assembly was successfully executed
70//
71CORECLR_HOSTING_API(coreclr_shutdown,
72 void* hostHandle,
73 unsigned int domainId);
74
75//
76// Shutdown CoreCLR. It unloads the app domain and stops the CoreCLR host.
77//
78// Parameters:
79// hostHandle - Handle of the host
80// domainId - Id of the domain
81// latchedExitCode - Latched exit code after domain unloaded
82//
83// Returns:
84// HRESULT indicating status of the operation. S_OK if the assembly was successfully executed
85//
86CORECLR_HOSTING_API(coreclr_shutdown_2,
87 void* hostHandle,
88 unsigned int domainId,
89 int* latchedExitCode);
90
91//
92// Create a native callable function pointer for a managed method.
93//
94// Parameters:
95// hostHandle - Handle of the host
96// domainId - Id of the domain
97// entryPointAssemblyName - Name of the assembly which holds the custom entry point
98// entryPointTypeName - Name of the type which holds the custom entry point
99// entryPointMethodName - Name of the method which is the custom entry point
100// delegate - Output parameter, the function stores a native callable function pointer to the delegate at the specified address
101//
102// Returns:
103// HRESULT indicating status of the operation. S_OK if the assembly was successfully executed
104//
105CORECLR_HOSTING_API(coreclr_create_delegate,
106 void* hostHandle,
107 unsigned int domainId,
108 const char* entryPointAssemblyName,
109 const char* entryPointTypeName,
110 const char* entryPointMethodName,
111 void** delegate);
112
113//
114// Execute a managed assembly with given arguments
115//
116// Parameters:
117// hostHandle - Handle of the host
118// domainId - Id of the domain
119// argc - Number of arguments passed to the executed assembly
120// argv - Array of arguments passed to the executed assembly
121// managedAssemblyPath - Path of the managed assembly to execute (or NULL if using a custom entrypoint).
122// exitCode - Exit code returned by the executed assembly
123//
124// Returns:
125// HRESULT indicating status of the operation. S_OK if the assembly was successfully executed
126//
127CORECLR_HOSTING_API(coreclr_execute_assembly,
128 void* hostHandle,
129 unsigned int domainId,
130 int argc,
131 const char** argv,
132 const char* managedAssemblyPath,
133 unsigned int* exitCode);
134
135#undef CORECLR_HOSTING_API
136
137#endif // __CORECLR_HOST_H__ \ No newline at end of file
diff --git a/src/ext/Bal/dnchost/dnchost.cpp b/src/ext/Bal/dnchost/dnchost.cpp
new file mode 100644
index 00000000..8ca326fc
--- /dev/null
+++ b/src/ext/Bal/dnchost/dnchost.cpp
@@ -0,0 +1,309 @@
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#include "precomp.h"
4
5static DNCSTATE vstate = { };
6
7
8// internal function declarations
9
10static HRESULT LoadModulePaths(
11 __in DNCSTATE* pState
12 );
13static HRESULT LoadDncConfiguration(
14 __in DNCSTATE* pState,
15 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs
16 );
17static HRESULT LoadRuntime(
18 __in DNCSTATE* pState
19 );
20static HRESULT LoadManagedBootstrapperApplicationFactory(
21 __in DNCSTATE* pState
22 );
23static HRESULT CreatePrerequisiteBA(
24 __in HRESULT hrHostInitialization,
25 __in IBootstrapperEngine* pEngine,
26 __in LPCWSTR wzAppBase,
27 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
28 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
29 );
30
31
32// function definitions
33
34extern "C" BOOL WINAPI DllMain(
35 IN HINSTANCE hInstance,
36 IN DWORD dwReason,
37 IN LPVOID /* pvReserved */
38 )
39{
40 switch (dwReason)
41 {
42 case DLL_PROCESS_ATTACH:
43 ::DisableThreadLibraryCalls(hInstance);
44 vstate.hInstance = hInstance;
45 break;
46
47 case DLL_PROCESS_DETACH:
48 vstate.hInstance = NULL;
49 break;
50 }
51
52 return TRUE;
53}
54
55extern "C" HRESULT WINAPI BootstrapperApplicationCreate(
56 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
57 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
58 )
59{
60 HRESULT hr = S_OK;
61 HRESULT hrHostInitialization = S_OK;
62 IBootstrapperEngine* pEngine = NULL;
63
64 // coreclr.dll doesn't support unloading, so the rest of the .NET Core hosting stack doesn't support it either.
65 // This means we also can't unload.
66 pResults->fDisableUnloading = TRUE;
67
68 hr = BalInitializeFromCreateArgs(pArgs, &pEngine);
69 ExitOnFailure(hr, "Failed to initialize Bal.");
70
71 if (!vstate.fInitialized)
72 {
73 hr = XmlInitialize();
74 BalExitOnFailure(hr, "Failed to initialize XML.");
75
76 hr = LoadModulePaths(&vstate);
77 BalExitOnFailure(hr, "Failed to get the host base path.");
78
79 hr = LoadDncConfiguration(&vstate, pArgs);
80 BalExitOnFailure(hr, "Failed to get the dnc configuration.");
81
82 vstate.fInitialized = TRUE;
83 }
84
85 if (!vstate.fInitializedRuntime)
86 {
87 hr = LoadRuntime(&vstate);
88
89 vstate.fInitializedRuntime = SUCCEEDED(hr);
90 }
91
92 if (vstate.fInitializedRuntime)
93 {
94 if (!vstate.pAppFactory)
95 {
96 hr = LoadManagedBootstrapperApplicationFactory(&vstate);
97 BalExitOnFailure(hr, "Failed to create the .NET Core bootstrapper application factory.");
98 }
99
100 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Loading .NET Core %ls bootstrapper application.", DNCHOSTTYPE_FDD == vstate.type ? L"FDD" : L"SCD");
101
102 hr = vstate.pAppFactory->Create(pArgs, pResults);
103 BalExitOnFailure(hr, "Failed to create the .NET Core bootstrapper application.");
104 }
105 else // fallback to the prerequisite BA.
106 {
107 if (DNCHOSTTYPE_SCD == vstate.type)
108 {
109 hrHostInitialization = E_DNCHOST_SCD_RUNTIME_FAILURE;
110 BalLogError(hr, "The self-contained .NET Core runtime failed to load. This is an unrecoverable error.");
111 }
112 else
113 {
114 hrHostInitialization = S_OK;
115 }
116 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Loading prerequisite bootstrapper application because .NET Core host could not be loaded, error: 0x%08x.", hr);
117
118 hr = CreatePrerequisiteBA(hrHostInitialization, pEngine, vstate.sczAppBase, pArgs, pResults);
119 BalExitOnFailure(hr, "Failed to create the pre-requisite bootstrapper application.");
120 }
121
122LExit:
123 ReleaseNullObject(pEngine);
124
125 return hr;
126}
127
128extern "C" void WINAPI BootstrapperApplicationDestroy()
129{
130 if (vstate.hMbapreqModule)
131 {
132 PFN_BOOTSTRAPPER_APPLICATION_DESTROY pfnDestroy = reinterpret_cast<PFN_BOOTSTRAPPER_APPLICATION_DESTROY>(::GetProcAddress(vstate.hMbapreqModule, "DncPrereqBootstrapperApplicationDestroy"));
133 if (pfnDestroy)
134 {
135 (*pfnDestroy)();
136 }
137
138 ::FreeLibrary(vstate.hMbapreqModule);
139 vstate.hMbapreqModule = NULL;
140 }
141
142 BalUninitialize();
143}
144
145static HRESULT LoadModulePaths(
146 __in DNCSTATE* pState
147 )
148{
149 HRESULT hr = S_OK;
150
151 hr = PathForCurrentProcess(&pState->sczModuleFullPath, pState->hInstance);
152 BalExitOnFailure(hr, "Failed to get the full host path.");
153
154 hr = PathGetDirectory(pState->sczModuleFullPath, &pState->sczAppBase);
155 BalExitOnFailure(hr, "Failed to get the directory of the full process path.");
156
157 hr = PathConcat(pState->sczAppBase, DNC_ASSEMBLY_FILE_NAME, &pState->sczManagedHostPath);
158 BalExitOnFailure(hr, "Failed to create managed host path.");
159
160LExit:
161 return hr;
162}
163
164static HRESULT LoadDncConfiguration(
165 __in DNCSTATE* pState,
166 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs
167 )
168{
169 HRESULT hr = S_OK;
170 IXMLDOMDocument* pixdManifest = NULL;
171 IXMLDOMNode* pixnHost = NULL;
172 LPWSTR sczPayloadName = NULL;
173 DWORD dwBool = 0;
174
175 hr = XmlLoadDocumentFromFile(pArgs->pCommand->wzBootstrapperApplicationDataPath, &pixdManifest);
176 BalExitOnFailure(hr, "Failed to load BalManifest '%ls'", pArgs->pCommand->wzBootstrapperApplicationDataPath);
177
178 hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/WixBalBAFactoryAssembly", &pixnHost);
179 BalExitOnFailure(hr, "Failed to get WixBalBAFactoryAssembly element.");
180
181 if (S_FALSE == hr)
182 {
183 hr = E_NOTFOUND;
184 BalExitOnRootFailure(hr, "Failed to find WixBalBAFactoryAssembly element in bootstrapper application config.");
185 }
186
187 hr = XmlGetAttributeEx(pixnHost, L"FilePath", &sczPayloadName);
188 BalExitOnFailure(hr, "Failed to get WixBalBAFactoryAssembly/@FilePath.");
189
190 hr = PathConcat(pArgs->pCommand->wzBootstrapperWorkingFolder, sczPayloadName, &pState->sczBaFactoryAssemblyPath);
191 BalExitOnFailure(hr, "Failed to create BaFactoryAssemblyPath.");
192
193 LPCWSTR wzFileName = PathFile(pState->sczBaFactoryAssemblyPath);
194 LPCWSTR wzExtension = PathExtension(pState->sczBaFactoryAssemblyPath);
195 if (!wzExtension)
196 {
197 BalExitOnFailure(hr = E_FAIL, "BaFactoryAssemblyPath has no extension.");
198 }
199
200 hr = StrAllocString(&pState->sczBaFactoryAssemblyName, wzFileName, wzExtension - wzFileName);
201 BalExitOnFailure(hr, "Failed to copy BAFactoryAssembly payload Name.");
202
203 hr = StrAllocString(&pState->sczBaFactoryDepsJsonPath, pState->sczBaFactoryAssemblyPath, wzExtension - pState->sczBaFactoryAssemblyPath);
204 BalExitOnFailure(hr, "Failed to initialize deps json path.");
205
206 hr = StrAllocString(&pState->sczBaFactoryRuntimeConfigPath, pState->sczBaFactoryDepsJsonPath, 0);
207 BalExitOnFailure(hr, "Failed to initialize runtime config path.");
208
209 hr = StrAllocConcat(&pState->sczBaFactoryDepsJsonPath, L".deps.json", 0);
210 BalExitOnFailure(hr, "Failed to concat extension to deps json path.");
211
212 hr = StrAllocConcat(&pState->sczBaFactoryRuntimeConfigPath, L".runtimeconfig.json", 0);
213 BalExitOnFailure(hr, "Failed to concat extension to runtime config path.");
214
215 pState->type = DNCHOSTTYPE_FDD;
216
217 hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/WixDncOptions", &pixnHost);
218 if (S_FALSE == hr)
219 {
220 ExitFunction1(hr = S_OK);
221 }
222 BalExitOnFailure(hr, "Failed to find WixDncOptions element in bootstrapper application config.");
223
224 hr = XmlGetAttributeNumber(pixnHost, L"SelfContainedDeployment", &dwBool);
225 if (S_FALSE == hr)
226 {
227 hr = S_OK;
228 }
229 else if (SUCCEEDED(hr) && dwBool)
230 {
231 pState->type = DNCHOSTTYPE_SCD;
232 }
233 BalExitOnFailure(hr, "Failed to get SelfContainedDeployment value.");
234
235LExit:
236 ReleaseStr(sczPayloadName);
237 ReleaseObject(pixnHost);
238 ReleaseObject(pixdManifest);
239
240 return hr;
241}
242
243static HRESULT LoadRuntime(
244 __in DNCSTATE* pState
245 )
246{
247 HRESULT hr = S_OK;
248
249 hr = DnchostLoadRuntime(
250 &pState->hostfxrState,
251 pState->sczModuleFullPath,
252 pState->sczManagedHostPath,
253 pState->sczBaFactoryDepsJsonPath,
254 pState->sczBaFactoryRuntimeConfigPath);
255
256 return hr;
257}
258
259static HRESULT LoadManagedBootstrapperApplicationFactory(
260 __in DNCSTATE* pState
261 )
262{
263 HRESULT hr = S_OK;
264
265 hr = DnchostCreateFactory(
266 &pState->hostfxrState,
267 pState->sczBaFactoryAssemblyName,
268 pState->sczBaFactoryAssemblyPath,
269 &pState->pAppFactory);
270
271 return hr;
272}
273
274static HRESULT CreatePrerequisiteBA(
275 __in HRESULT hrHostInitialization,
276 __in IBootstrapperEngine* pEngine,
277 __in LPCWSTR wzAppBase,
278 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
279 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
280 )
281{
282 HRESULT hr = S_OK;
283 LPWSTR sczDncpreqPath = NULL;
284 HMODULE hModule = NULL;
285
286 hr = PathConcat(wzAppBase, L"dncpreq.dll", &sczDncpreqPath);
287 BalExitOnFailure(hr, "Failed to get path to pre-requisite BA.");
288
289 hModule = ::LoadLibraryW(sczDncpreqPath);
290 BalExitOnNullWithLastError(hModule, hr, "Failed to load pre-requisite BA DLL.");
291
292 PFN_DNCPREQ_BOOTSTRAPPER_APPLICATION_CREATE pfnCreate = reinterpret_cast<PFN_DNCPREQ_BOOTSTRAPPER_APPLICATION_CREATE>(::GetProcAddress(hModule, "DncPrereqBootstrapperApplicationCreate"));
293 BalExitOnNullWithLastError(pfnCreate, hr, "Failed to get DncPrereqBootstrapperApplicationCreate entry-point from: %ls", sczDncpreqPath);
294
295 hr = pfnCreate(hrHostInitialization, pEngine, pArgs, pResults);
296 BalExitOnFailure(hr, "Failed to create prequisite bootstrapper app.");
297
298 vstate.hMbapreqModule = hModule;
299 hModule = NULL;
300
301LExit:
302 if (hModule)
303 {
304 ::FreeLibrary(hModule);
305 }
306 ReleaseStr(sczDncpreqPath);
307
308 return hr;
309}
diff --git a/src/ext/Bal/dnchost/dnchost.def b/src/ext/Bal/dnchost/dnchost.def
new file mode 100644
index 00000000..4488df94
--- /dev/null
+++ b/src/ext/Bal/dnchost/dnchost.def
@@ -0,0 +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.
2
3
4EXPORTS
5 BootstrapperApplicationCreate
6 BootstrapperApplicationDestroy
diff --git a/src/ext/Bal/dnchost/dnchost.h b/src/ext/Bal/dnchost/dnchost.h
new file mode 100644
index 00000000..22fd8f5e
--- /dev/null
+++ b/src/ext/Bal/dnchost/dnchost.h
@@ -0,0 +1,35 @@
1#pragma once
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
5enum DNCHOSTTYPE
6{
7 DNCHOSTTYPE_UNKNOWN,
8 DNCHOSTTYPE_FDD,
9 DNCHOSTTYPE_SCD,
10};
11
12extern "C" typedef HRESULT(WINAPI* PFN_DNCPREQ_BOOTSTRAPPER_APPLICATION_CREATE)(
13 __in HRESULT hrHostInitialization,
14 __in IBootstrapperEngine* pEngine,
15 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
16 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
17 );
18
19struct DNCSTATE
20{
21 BOOL fInitialized;
22 BOOL fInitializedRuntime;
23 HINSTANCE hInstance;
24 LPWSTR sczModuleFullPath;
25 LPWSTR sczAppBase;
26 LPWSTR sczManagedHostPath;
27 LPWSTR sczBaFactoryAssemblyName;
28 LPWSTR sczBaFactoryAssemblyPath;
29 LPWSTR sczBaFactoryDepsJsonPath;
30 LPWSTR sczBaFactoryRuntimeConfigPath;
31 DNCHOSTTYPE type;
32 HOSTFXR_STATE hostfxrState;
33 IBootstrapperApplicationFactory* pAppFactory;
34 HMODULE hMbapreqModule;
35};
diff --git a/src/ext/Bal/dnchost/dnchost.vcxproj b/src/ext/Bal/dnchost/dnchost.vcxproj
new file mode 100644
index 00000000..bef3f77e
--- /dev/null
+++ b/src/ext/Bal/dnchost/dnchost.vcxproj
@@ -0,0 +1,106 @@
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 DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
4 <Import Project="..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" />
5 <Import Project="..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" />
6 <Import Project="..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props" Condition="Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" />
7 <Import Project="..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props" Condition="Exists('..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props')" />
8 <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props')" />
9 <Import Project="..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props')" />
10 <ItemGroup Label="ProjectConfigurations">
11 <ProjectConfiguration Include="Debug|ARM64">
12 <Configuration>Debug</Configuration>
13 <Platform>ARM64</Platform>
14 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|ARM64">
16 <Configuration>Release</Configuration>
17 <Platform>ARM64</Platform>
18 </ProjectConfiguration>
19 <ProjectConfiguration Include="Debug|Win32">
20 <Configuration>Debug</Configuration>
21 <Platform>Win32</Platform>
22 </ProjectConfiguration>
23 <ProjectConfiguration Include="Release|Win32">
24 <Configuration>Release</Configuration>
25 <Platform>Win32</Platform>
26 </ProjectConfiguration>
27 <ProjectConfiguration Include="Debug|x64">
28 <Configuration>Debug</Configuration>
29 <Platform>x64</Platform>
30 </ProjectConfiguration>
31 <ProjectConfiguration Include="Release|x64">
32 <Configuration>Release</Configuration>
33 <Platform>x64</Platform>
34 </ProjectConfiguration>
35 </ItemGroup>
36 <PropertyGroup Label="Globals">
37 <ProjectGuid>{B6F70281-6583-4138-BB7F-AABFEBBB3CA2}</ProjectGuid>
38 <ConfigurationType>DynamicLibrary</ConfigurationType>
39 <PlatformToolset>v142</PlatformToolset>
40 <CharacterSet>Unicode</CharacterSet>
41 <TargetName>dnchost</TargetName>
42 <ProjectModuleDefinitionFile>dnchost.def</ProjectModuleDefinitionFile>
43 </PropertyGroup>
44 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
45 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
46 <PropertyGroup>
47 <NetHostPlatform>$(Platform)</NetHostPlatform>
48 <NetHostPlatform Condition=" '$(NetHostPlatform)'=='Win32' ">x86</NetHostPlatform>
49 <NetHostPath>..\..\packages\runtime.win-$(NetHostPlatform).Microsoft.NETCore.DotNetAppHost.5.0.0\runtimes\win-$(NetHostPlatform)\native\</NetHostPath>
50 <ProjectAdditionalLinkLibraries>shlwapi.lib;$(NetHostPath)libnethost.lib</ProjectAdditionalLinkLibraries>
51 </PropertyGroup>
52 <ItemGroup>
53 <ClCompile Include="dnchost.cpp" />
54 <ClCompile Include="dncutil.cpp" />
55 <ClCompile Include="precomp.cpp">
56 <PrecompiledHeader>Create</PrecompiledHeader>
57 </ClCompile>
58 </ItemGroup>
59 <ItemGroup>
60 <ClInclude Include="coreclrhost.h" />
61 <ClInclude Include="dnchost.h" />
62 <ClInclude Include="dncutil.h" />
63 <ClInclude Include="precomp.h" />
64 </ItemGroup>
65 <ItemGroup>
66 <None Include="dnchost.def" />
67 </ItemGroup>
68 <ItemGroup>
69 <None Include="packages.config" />
70 </ItemGroup>
71 <ItemDefinitionGroup>
72 <ClCompile>
73 <AdditionalIncludeDirectories>$(BaseOutputPath)obj;$(NetHostPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
74 </ClCompile>
75 <Link>
76 <AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions>
77 </Link>
78 </ItemDefinitionGroup>
79 <ItemGroup>
80 <ProjectReference Include="..\WixToolset.Dnc.Host\WixToolset.Dnc.Host.csproj">
81 <Project>{0D780900-C2FF-4FA2-8CB5-8A19768724C5}</Project>
82 <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
83 <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
84 </ProjectReference>
85 </ItemGroup>
86 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
87 <Import Project="..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets" Condition="Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets')" />
88 <Import Project="..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets" Condition="Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets')" />
89 <Import Project="..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets" Condition="Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" />
90 <Import Project="..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets')" />
91 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
92 <PropertyGroup>
93 <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
94 </PropertyGroup>
95 <Error Condition="!Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props'))" />
96 <Error Condition="!Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets'))" />
97 <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props'))" />
98 <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets'))" />
99 <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props'))" />
100 <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets'))" />
101 <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets'))" />
102 <Error Condition="!Exists('..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props'))" />
103 <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props'))" />
104 <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props'))" />
105 </Target>
106</Project> \ No newline at end of file
diff --git a/src/ext/Bal/dnchost/dncutil.cpp b/src/ext/Bal/dnchost/dncutil.cpp
new file mode 100644
index 00000000..34d14911
--- /dev/null
+++ b/src/ext/Bal/dnchost/dncutil.cpp
@@ -0,0 +1,411 @@
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#include "precomp.h"
4
5// https://github.com/dotnet/runtime/blob/master/src/installer/corehost/error_codes.h
6#define InvalidArgFailure 0x80008081
7#define HostApiBufferTooSmall 0x80008098
8#define HostApiUnsupportedVersion 0x800080a2
9
10// internal function declarations
11
12static HRESULT GetHostfxrPath(
13 __in HOSTFXR_STATE* pState,
14 __in LPCWSTR wzNativeHostPath
15 );
16static HRESULT LoadHostfxr(
17 __in HOSTFXR_STATE* pState
18 );
19static HRESULT InitializeHostfxr(
20 __in HOSTFXR_STATE* pState,
21 __in LPCWSTR wzManagedHostPath,
22 __in LPCWSTR wzDepsJsonPath,
23 __in LPCWSTR wzRuntimeConfigPath
24 );
25static HRESULT InitializeCoreClr(
26 __in HOSTFXR_STATE* pState,
27 __in LPCWSTR wzNativeHostPath
28 );
29static HRESULT InitializeCoreClrPre5(
30 __in HOSTFXR_STATE* pState,
31 __in LPCWSTR wzNativeHostPath
32 );
33static HRESULT LoadCoreClr(
34 __in HOSTFXR_STATE* pState,
35 __in LPCWSTR wzCoreClrPath
36 );
37static HRESULT StartCoreClr(
38 __in HOSTFXR_STATE* pState,
39 __in LPCWSTR wzNativeHostPath,
40 __in DWORD cProperties,
41 __in LPCWSTR* propertyKeys,
42 __in LPCWSTR* propertyValues
43 );
44
45
46// function definitions
47
48HRESULT DnchostLoadRuntime(
49 __in HOSTFXR_STATE* pState,
50 __in LPCWSTR wzNativeHostPath,
51 __in LPCWSTR wzManagedHostPath,
52 __in LPCWSTR wzDepsJsonPath,
53 __in LPCWSTR wzRuntimeConfigPath
54 )
55{
56 HRESULT hr = S_OK;
57
58 hr = GetHostfxrPath(pState, wzNativeHostPath);
59 BalExitOnFailure(hr, "Failed to find hostfxr.");
60
61 hr = LoadHostfxr(pState);
62 BalExitOnFailure(hr, "Failed to load hostfxr.");
63
64 hr = InitializeHostfxr(pState, wzManagedHostPath, wzDepsJsonPath, wzRuntimeConfigPath);
65 BalExitOnFailure(hr, "Failed to initialize hostfxr.");
66
67 hr = InitializeCoreClr(pState, wzNativeHostPath);
68 BalExitOnFailure(hr, "Failed to initialize coreclr.");
69
70LExit:
71 return hr;
72}
73
74HRESULT DnchostCreateFactory(
75 __in HOSTFXR_STATE* pState,
76 __in LPCWSTR wzBaFactoryAssemblyName,
77 __in LPCWSTR wzBaFactoryAssemblyPath,
78 __out IBootstrapperApplicationFactory** ppAppFactory
79 )
80{
81 HRESULT hr = S_OK;
82 PFNCREATEBAFACTORY pfnCreateBAFactory = NULL;
83
84 if (pState->pfnGetFunctionPointer)
85 {
86 hr = pState->pfnGetFunctionPointer(
87 DNC_ENTRY_TYPEW,
88 DNC_STATIC_ENTRY_METHODW,
89 DNC_STATIC_ENTRY_DELEGATEW,
90 NULL,
91 NULL,
92 reinterpret_cast<void**>(&pfnCreateBAFactory));
93 BalExitOnFailure(hr, "Failed to create delegate through GetFunctionPointer.");
94 }
95 else
96 {
97 hr = pState->pfnCoreclrCreateDelegate(
98 pState->pClrHandle,
99 pState->dwDomainId,
100 DNC_ASSEMBLY_FULL_NAME,
101 DNC_ENTRY_TYPE,
102 DNC_STATIC_ENTRY_METHOD,
103 reinterpret_cast<void**>(&pfnCreateBAFactory));
104 BalExitOnFailure(hr, "Failed to create delegate in app domain.");
105 }
106
107 *ppAppFactory = pfnCreateBAFactory(wzBaFactoryAssemblyName, wzBaFactoryAssemblyPath);
108
109LExit:
110 return hr;
111}
112
113static HRESULT GetHostfxrPath(
114 __in HOSTFXR_STATE* pState,
115 __in LPCWSTR wzNativeHostPath
116 )
117{
118 HRESULT hr = S_OK;
119 get_hostfxr_parameters getHostfxrParameters = { };
120 int nrc = 0;
121 size_t cchHostFxrPath = MAX_PATH;
122
123 getHostfxrParameters.size = sizeof(get_hostfxr_parameters);
124 getHostfxrParameters.assembly_path = wzNativeHostPath;
125
126 // get_hostfxr_path does a full search on every call, so
127 // minimize the number of calls
128 // need to loop
129 for (;;)
130 {
131 cchHostFxrPath *= 2;
132 hr = StrAlloc(&pState->sczHostfxrPath, cchHostFxrPath);
133 BalExitOnFailure(hr, "Failed to allocate hostFxrPath.");
134
135 nrc = get_hostfxr_path(pState->sczHostfxrPath, &cchHostFxrPath, &getHostfxrParameters);
136 if (HostApiBufferTooSmall != nrc)
137 {
138 break;
139 }
140 }
141 if (0 != nrc)
142 {
143 BalExitOnFailure(hr = nrc, "GetHostfxrPath failed");
144 }
145
146LExit:
147 return hr;
148}
149
150static HRESULT LoadHostfxr(
151 __in HOSTFXR_STATE* pState
152 )
153{
154 HRESULT hr = S_OK;
155 HMODULE hHostfxr;
156
157 hHostfxr = ::LoadLibraryExW(pState->sczHostfxrPath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
158 BalExitOnNullWithLastError(hHostfxr, hr, "Failed to load hostfxr from '%ls'.", pState->sczHostfxrPath);
159
160 pState->pfnHostfxrInitializeForApp = reinterpret_cast<hostfxr_initialize_for_dotnet_command_line_fn>(::GetProcAddress(hHostfxr, "hostfxr_initialize_for_dotnet_command_line"));
161 BalExitOnNullWithLastError(pState->pfnHostfxrInitializeForApp, hr, "Failed to get procedure address for hostfxr_initialize_for_dotnet_command_line.");
162
163 pState->pfnHostfxrGetRuntimeProperties = reinterpret_cast<hostfxr_get_runtime_properties_fn>(::GetProcAddress(hHostfxr, "hostfxr_get_runtime_properties"));
164 BalExitOnNullWithLastError(pState->pfnHostfxrGetRuntimeProperties, hr, "Failed to get procedure address for hostfxr_get_runtime_properties.");
165
166 pState->pfnHostfxrSetErrorWriter = reinterpret_cast<hostfxr_set_error_writer_fn>(::GetProcAddress(hHostfxr, "hostfxr_set_error_writer"));
167 BalExitOnNullWithLastError(pState->pfnHostfxrSetErrorWriter, hr, "Failed to get procedure address for hostfxr_set_error_writer.");
168
169 pState->pfnHostfxrClose = reinterpret_cast<hostfxr_close_fn>(::GetProcAddress(hHostfxr, "hostfxr_close"));
170 BalExitOnNullWithLastError(pState->pfnHostfxrClose, hr, "Failed to get procedure address for hostfxr_close.");
171
172 pState->pfnHostfxrGetRuntimeDelegate = reinterpret_cast<hostfxr_get_runtime_delegate_fn>(::GetProcAddress(hHostfxr, "hostfxr_get_runtime_delegate"));
173 BalExitOnNullWithLastError(pState->pfnHostfxrGetRuntimeDelegate, hr, "Failed to get procedure address for hostfxr_get_runtime_delegate.");
174
175LExit:
176 // Never unload the module since it isn't meant to be unloaded.
177
178 return hr;
179}
180
181static void HOSTFXR_CALLTYPE DnchostErrorWriter(
182 __in LPCWSTR wzMessage
183 )
184{
185 BOOTSTRAPPER_LOG_LEVEL level = BOOTSTRAPPER_LOG_LEVEL_ERROR;
186
187 if (CSTR_EQUAL == ::CompareString(LOCALE_INVARIANT, 0, wzMessage, -1, L"The requested delegate type is not available in the target framework.", -1))
188 {
189 level = BOOTSTRAPPER_LOG_LEVEL_DEBUG;
190 }
191
192 BalLog(level, "error from hostfxr: %ls", wzMessage);
193}
194
195static HRESULT InitializeHostfxr(
196 __in HOSTFXR_STATE* pState,
197 __in LPCWSTR wzManagedHostPath,
198 __in LPCWSTR wzDepsJsonPath,
199 __in LPCWSTR wzRuntimeConfigPath
200 )
201{
202 HRESULT hr = S_OK;
203
204 pState->pfnHostfxrSetErrorWriter(static_cast<hostfxr_error_writer_fn>(&DnchostErrorWriter));
205
206 LPCWSTR argv[] = {
207 L"exec",
208 L"--depsfile",
209 wzDepsJsonPath,
210 L"--runtimeconfig",
211 wzRuntimeConfigPath,
212 wzManagedHostPath,
213 };
214 hr = pState->pfnHostfxrInitializeForApp(sizeof(argv)/sizeof(LPWSTR), argv, NULL, &pState->hostContextHandle);
215 BalExitOnFailure(hr, "HostfxrInitializeForApp failed");
216
217LExit:
218 return hr;
219}
220
221static HRESULT InitializeCoreClr(
222 __in HOSTFXR_STATE* pState,
223 __in LPCWSTR wzNativeHostPath
224 )
225{
226 HRESULT hr = S_OK;
227
228 hr = pState->pfnHostfxrGetRuntimeDelegate(pState->hostContextHandle, hdt_get_function_pointer, reinterpret_cast<void**>(&pState->pfnGetFunctionPointer));
229 if (InvalidArgFailure == hr || // old versions of hostfxr don't allow calling GetRuntimeDelegate from InitializeForApp.
230 HostApiUnsupportedVersion == hr) // hdt_get_function_pointer was added in .NET 5.
231 {
232 hr = InitializeCoreClrPre5(pState, wzNativeHostPath);
233 }
234 else
235 {
236 ExitOnFailure(hr, "HostfxrGetRuntimeDelegate failed");
237 }
238
239LExit:
240 return hr;
241}
242
243static HRESULT InitializeCoreClrPre5(
244 __in HOSTFXR_STATE* pState,
245 __in LPCWSTR wzNativeHostPath
246 )
247{
248 HRESULT hr = S_OK;
249 int32_t rc = 0;
250 LPCWSTR* rgPropertyKeys = NULL;
251 LPCWSTR* rgPropertyValues = NULL;
252 size_t cProperties = 0;
253 LPWSTR* rgDirectories = NULL;
254 UINT cDirectories = 0;
255 LPWSTR sczCoreClrPath = NULL;
256
257 // We are not using hostfxr as it was intended to be used. We need to initialize hostfxr so that it properly initializes hostpolicy -
258 // there are pieces of the framework such as AssemblyDependencyResolver that won't work without that. We also need hostfxr to find a
259 // compatible framework for framework-dependent deployed BAs. We had to use hostfxr_initialize_for_dotnet_command_line since
260 // hostfxr_initialize_for_runtime_config doesn't currently (3.x) support self-contained deployed BAs. That means we're supposed to
261 // start the runtime through hostfxr_run_app, but that method shuts down the runtime before returning. We actually want to call
262 // hostfxr_get_runtime_delegate, but that method currently requires hostfxr to be initialized through
263 // hostfxr_initialize_for_runtime_config. So we're forced to locate coreclr.dll and manually load the runtime ourselves.
264
265 // Unfortunately, that's not the only problem. hostfxr has global state that tracks whether it started the runtime. While we keep our
266 // hostfxr_handle open, everyone that calls the hostfxr_initialize_* methods will block until we have started the runtime through
267 // hostfxr or closed our handle. If we close the handle, then hostfxr could potentially try to load a second runtime into the
268 // process, which is not supported. We're going to just keep our handle open since no one else in the process should be trying to
269 // start the runtime anyway.
270
271 rc = pState->pfnHostfxrGetRuntimeProperties(pState->hostContextHandle, &cProperties, rgPropertyKeys, rgPropertyValues);
272 if (HostApiBufferTooSmall != rc)
273 {
274 BalExitOnFailure(hr = rc, "HostfxrGetRuntimeProperties failed to return required size.");
275 }
276
277 rgPropertyKeys = static_cast<LPCWSTR*>(MemAlloc(sizeof(LPWSTR) * cProperties, TRUE));
278 rgPropertyValues = static_cast<LPCWSTR*>(MemAlloc(sizeof(LPWSTR) * cProperties, TRUE));
279 if (!rgPropertyKeys || !rgPropertyValues)
280 {
281 BalExitOnFailure(hr = E_OUTOFMEMORY, "Failed to allocate buffers for runtime properties.");
282 }
283
284 hr = pState->pfnHostfxrGetRuntimeProperties(pState->hostContextHandle, &cProperties, rgPropertyKeys, rgPropertyValues);
285 BalExitOnFailure(hr, "HostfxrGetRuntimeProperties failed.");
286
287 for (DWORD i = 0; i < cProperties; ++i)
288 {
289 if (CSTR_EQUAL == ::CompareString(LOCALE_INVARIANT, 0, rgPropertyKeys[i], -1, L"NATIVE_DLL_SEARCH_DIRECTORIES", -1))
290 {
291 hr = StrSplitAllocArray(&rgDirectories, &cDirectories, rgPropertyValues[i], L";");
292 BalExitOnFailure(hr, "Failed to split NATIVE_DLL_SEARCH_DIRECTORIES '%ls'", rgPropertyValues[i]);
293 }
294 }
295
296 for (DWORD i = 0; i < cDirectories; ++i)
297 {
298 hr = PathConcat(rgDirectories[i], L"coreclr.dll", &sczCoreClrPath);
299 BalExitOnFailure(hr, "Failed to allocate path to coreclr.");
300
301 if (::PathFileExists(sczCoreClrPath))
302 {
303 break;
304 }
305 else
306 {
307 ReleaseNullStr(sczCoreClrPath);
308 }
309 }
310
311 if (!sczCoreClrPath)
312 {
313 for (DWORD i = 0; i < cProperties; ++i)
314 {
315 BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "%ls: %ls", rgPropertyKeys[i], rgPropertyValues[i]);
316 }
317 BalExitOnFailure(hr = E_FILENOTFOUND, "Failed to locate coreclr.dll.");
318 }
319
320 hr = LoadCoreClr(pState, sczCoreClrPath);
321 BalExitOnFailure(hr, "Failed to load coreclr.");
322
323 hr = StartCoreClr(pState, wzNativeHostPath, (DWORD)cProperties, rgPropertyKeys, rgPropertyValues);
324 BalExitOnFailure(hr, "Failed to start coreclr.");
325
326LExit:
327 MemFree(rgDirectories);
328 MemFree(rgPropertyValues);
329 MemFree(rgPropertyKeys);
330 ReleaseStr(sczCoreClrPath);
331
332 return hr;
333}
334
335static HRESULT LoadCoreClr(
336 __in HOSTFXR_STATE* pState,
337 __in LPCWSTR wzCoreClrPath
338 )
339{
340 HRESULT hr = S_OK;
341 HMODULE hModule = NULL;
342
343 hModule = ::LoadLibraryExW(wzCoreClrPath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
344 BalExitOnNullWithLastError(hModule, hr, "Failed to load coreclr.dll from '%ls'.", wzCoreClrPath);
345
346 pState->pfnCoreclrInitialize = reinterpret_cast<coreclr_initialize_ptr>(::GetProcAddress(hModule, "coreclr_initialize"));
347 BalExitOnNullWithLastError(pState->pfnCoreclrInitialize, hr, "Failed to get procedure address for coreclr_initialize.");
348
349 pState->pfnCoreclrCreateDelegate = reinterpret_cast<coreclr_create_delegate_ptr>(::GetProcAddress(hModule, "coreclr_create_delegate"));
350 BalExitOnNullWithLastError(pState->pfnCoreclrCreateDelegate, hr, "Failed to get procedure address for coreclr_create_delegate.");
351
352LExit:
353 // Never unload the module since coreclr doesn't support it.
354
355 return hr;
356}
357
358static HRESULT StartCoreClr(
359 __in HOSTFXR_STATE* pState,
360 __in LPCWSTR wzNativeHostPath,
361 __in DWORD cProperties,
362 __in LPCWSTR* propertyKeys,
363 __in LPCWSTR* propertyValues
364 )
365{
366 HRESULT hr = S_OK;
367 LPSTR szNativeHostPath = NULL;
368 LPSTR* rgPropertyKeys = NULL;
369 LPSTR* rgPropertyValues = NULL;
370
371 rgPropertyKeys = static_cast<LPSTR*>(MemAlloc(sizeof(LPSTR) * cProperties, TRUE));
372 rgPropertyValues = static_cast<LPSTR*>(MemAlloc(sizeof(LPSTR) * cProperties, TRUE));
373 if (!rgPropertyKeys || !rgPropertyValues)
374 {
375 BalExitOnFailure(hr = E_OUTOFMEMORY, "Failed to allocate buffers for runtime properties.");
376 }
377
378 hr = StrAnsiAllocString(&szNativeHostPath, wzNativeHostPath, 0, CP_UTF8);
379 BalExitOnFailure(hr, "Failed to convert module path to UTF8: %ls", wzNativeHostPath);
380
381 for (DWORD i = 0; i < cProperties; ++i)
382 {
383 hr = StrAnsiAllocString(&rgPropertyKeys[i], propertyKeys[i], 0, CP_UTF8);
384 BalExitOnFailure(hr, "Failed to convert property key to UTF8: %ls", propertyKeys[i]);
385
386 hr = StrAnsiAllocString(&rgPropertyValues[i], propertyValues[i], 0, CP_UTF8);
387 BalExitOnFailure(hr, "Failed to convert property value to UTF8: %ls", propertyValues[i]);
388 }
389
390 hr = pState->pfnCoreclrInitialize(szNativeHostPath, "MBA", cProperties, (LPCSTR*)rgPropertyKeys, (LPCSTR*)rgPropertyValues, &pState->pClrHandle, &pState->dwDomainId);
391 BalExitOnFailure(hr, "CoreclrInitialize failed.");
392
393LExit:
394 for (DWORD i = 0; i < cProperties; ++i)
395 {
396 if (rgPropertyKeys)
397 {
398 ReleaseStr(rgPropertyKeys[i]);
399 }
400
401 if (rgPropertyValues)
402 {
403 ReleaseStr(rgPropertyValues[i]);
404 }
405 }
406 ReleaseMem(rgPropertyValues);
407 ReleaseMem(rgPropertyKeys);
408 ReleaseStr(szNativeHostPath);
409
410 return hr;
411}
diff --git a/src/ext/Bal/dnchost/dncutil.h b/src/ext/Bal/dnchost/dncutil.h
new file mode 100644
index 00000000..85eda3b2
--- /dev/null
+++ b/src/ext/Bal/dnchost/dncutil.h
@@ -0,0 +1,38 @@
1#pragma once
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
4typedef IBootstrapperApplicationFactory* (STDMETHODCALLTYPE* PFNCREATEBAFACTORY)(
5 __in LPCWSTR wzBaFactoryAssemblyName,
6 __in LPCWSTR wzBaFactoryAssemblyPath
7 );
8
9struct HOSTFXR_STATE
10{
11 LPWSTR sczHostfxrPath;
12 hostfxr_handle hostContextHandle;
13 hostfxr_initialize_for_dotnet_command_line_fn pfnHostfxrInitializeForApp;
14 hostfxr_get_runtime_properties_fn pfnHostfxrGetRuntimeProperties;
15 hostfxr_set_error_writer_fn pfnHostfxrSetErrorWriter;
16 hostfxr_close_fn pfnHostfxrClose;
17 hostfxr_get_runtime_delegate_fn pfnHostfxrGetRuntimeDelegate;
18 get_function_pointer_fn pfnGetFunctionPointer;
19 coreclr_initialize_ptr pfnCoreclrInitialize;
20 coreclr_create_delegate_ptr pfnCoreclrCreateDelegate;
21 void* pClrHandle;
22 UINT dwDomainId;
23};
24
25HRESULT DnchostLoadRuntime(
26 __in HOSTFXR_STATE* pState,
27 __in LPCWSTR wzNativeHostPath,
28 __in LPCWSTR wzManagedHostPath,
29 __in LPCWSTR wzDepsJsonPath,
30 __in LPCWSTR wzRuntimeConfigPath
31 );
32
33HRESULT DnchostCreateFactory(
34 __in HOSTFXR_STATE* pState,
35 __in LPCWSTR wzBaFactoryAssemblyName,
36 __in LPCWSTR wzBaFactoryAssemblyPath,
37 __out IBootstrapperApplicationFactory** ppAppFactory
38 );
diff --git a/src/ext/Bal/dnchost/packages.config b/src/ext/Bal/dnchost/packages.config
new file mode 100644
index 00000000..6c369364
--- /dev/null
+++ b/src/ext/Bal/dnchost/packages.config
@@ -0,0 +1,13 @@
1<?xml version="1.0" encoding="utf-8"?>
2<packages>
3 <package id="Microsoft.Build.Tasks.Git" version="1.0.0" targetFramework="native" developmentDependency="true" />
4 <package id="Microsoft.SourceLink.Common" version="1.0.0" targetFramework="native" developmentDependency="true" />
5 <package id="Microsoft.SourceLink.GitHub" version="1.0.0" targetFramework="native" developmentDependency="true" />
6 <package id="Nerdbank.GitVersioning" version="3.3.37" targetFramework="native" developmentDependency="true" />
7 <package id="runtime.win-arm64.Microsoft.NETCore.DotNetAppHost" version="5.0.0" targetFramework="native" />
8 <package id="runtime.win-x64.Microsoft.NETCore.DotNetAppHost" version="5.0.0" targetFramework="native" />
9 <package id="runtime.win-x86.Microsoft.NETCore.DotNetAppHost" version="5.0.0" targetFramework="native" />
10 <package id="WixToolset.BalUtil" version="4.0.58" targetFramework="native" />
11 <package id="WixToolset.BootstrapperCore.Native" version="4.0.141" targetFramework="native" />
12 <package id="WixToolset.DUtil" version="4.0.72" targetFramework="native" />
13</packages> \ No newline at end of file
diff --git a/src/ext/Bal/dnchost/precomp.cpp b/src/ext/Bal/dnchost/precomp.cpp
new file mode 100644
index 00000000..37664a1c
--- /dev/null
+++ b/src/ext/Bal/dnchost/precomp.cpp
@@ -0,0 +1,3 @@
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#include "precomp.h"
diff --git a/src/ext/Bal/dnchost/precomp.h b/src/ext/Bal/dnchost/precomp.h
new file mode 100644
index 00000000..84ff6424
--- /dev/null
+++ b/src/ext/Bal/dnchost/precomp.h
@@ -0,0 +1,31 @@
1#pragma once
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#include <windows.h>
5#include <msiquery.h>
6#include <corerror.h>
7#include <Shlwapi.h>
8
9#include <dutil.h>
10#include <memutil.h>
11#include <pathutil.h>
12#include <strutil.h>
13#include <xmlutil.h>
14
15#include <BootstrapperEngine.h>
16#include <BootstrapperApplication.h>
17
18#include <IBootstrapperEngine.h>
19#include <IBootstrapperApplication.h>
20#include <IBootstrapperApplicationFactory.h>
21#include <balutil.h>
22
23#include <WixToolset.Dnc.Host.h>
24#define NETHOST_USE_AS_STATIC
25#include <nethost.h>
26#include <hostfxr.h>
27#include <coreclr_delegates.h>
28
29#include "coreclrhost.h"
30#include "dncutil.h"
31#include "dnchost.h"
diff --git a/src/ext/Bal/mbahost/mbahost.cpp b/src/ext/Bal/mbahost/mbahost.cpp
new file mode 100644
index 00000000..735f9f21
--- /dev/null
+++ b/src/ext/Bal/mbahost/mbahost.cpp
@@ -0,0 +1,649 @@
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#include "precomp.h"
4#include <WixToolset.Mba.Host.h> // includes the generated assembly name macros.
5
6static const DWORD NET452_RELEASE = 379893;
7
8using namespace mscorlib;
9
10extern "C" typedef HRESULT (WINAPI *PFN_CORBINDTOCURRENTRUNTIME)(
11 __in LPCWSTR pwszFileName,
12 __in REFCLSID rclsid,
13 __in REFIID riid,
14 __out LPVOID *ppv
15 );
16
17extern "C" typedef HRESULT(WINAPI *PFN_MBAPREQ_BOOTSTRAPPER_APPLICATION_CREATE)(
18 __in HRESULT hrHostInitialization,
19 __in IBootstrapperEngine* pEngine,
20 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
21 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
22 );
23
24static HINSTANCE vhInstance = NULL;
25static ICorRuntimeHost *vpCLRHost = NULL;
26static _AppDomain *vpAppDomain = NULL;
27static HMODULE vhMbapreqModule = NULL;
28
29
30// internal function declarations
31
32static HRESULT GetAppDomain(
33 __out _AppDomain** ppAppDomain
34 );
35static HRESULT GetAppBase(
36 __out LPWSTR* psczAppBase
37 );
38static HRESULT CheckSupportedFrameworks(
39 __in LPCWSTR wzConfigPath
40 );
41static HRESULT UpdateSupportedRuntime(
42 __in IXMLDOMDocument* pixdManifest,
43 __in IXMLDOMNode* pixnSupportedFramework,
44 __out BOOL* pfUpdatedManifest
45 );
46static HRESULT GetCLRHost(
47 __in LPCWSTR wzConfigPath,
48 __out ICorRuntimeHost** ppCLRHost
49 );
50static HRESULT CreateManagedBootstrapperApplication(
51 __in _AppDomain* pAppDomain,
52 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
53 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
54 );
55static HRESULT CreateManagedBootstrapperApplicationFactory(
56 __in _AppDomain* pAppDomain,
57 __out IBootstrapperApplicationFactory** ppAppFactory
58 );
59static HRESULT CreatePrerequisiteBA(
60 __in HRESULT hrHostInitialization,
61 __in IBootstrapperEngine* pEngine,
62 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
63 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
64 );
65static HRESULT VerifyNET4RuntimeIsSupported(
66 );
67
68
69// function definitions
70
71extern "C" BOOL WINAPI DllMain(
72 IN HINSTANCE hInstance,
73 IN DWORD dwReason,
74 IN LPVOID /* pvReserved */
75 )
76{
77 switch (dwReason)
78 {
79 case DLL_PROCESS_ATTACH:
80 ::DisableThreadLibraryCalls(hInstance);
81 vhInstance = hInstance;
82 break;
83
84 case DLL_PROCESS_DETACH:
85 vhInstance = NULL;
86 break;
87 }
88
89 return TRUE;
90}
91
92// Note: This function assumes that COM was already initialized on the thread.
93extern "C" HRESULT WINAPI BootstrapperApplicationCreate(
94 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
95 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
96 )
97{
98 HRESULT hr = S_OK;
99 HRESULT hrHostInitialization = S_OK;
100 IBootstrapperEngine* pEngine = NULL;
101
102 hr = BalInitializeFromCreateArgs(pArgs, &pEngine);
103 ExitOnFailure(hr, "Failed to initialize Bal.");
104
105 hr = GetAppDomain(&vpAppDomain);
106 if (SUCCEEDED(hr))
107 {
108 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Loading managed bootstrapper application.");
109
110 hr = CreateManagedBootstrapperApplication(vpAppDomain, pArgs, pResults);
111 BalExitOnFailure(hr, "Failed to create the managed bootstrapper application.");
112 }
113 else // fallback to the prerequisite BA.
114 {
115 if (E_MBAHOST_NET452_ON_WIN7RTM == hr)
116 {
117 BalLogError(hr, "The Burn engine cannot run with an MBA under the .NET 4 CLR on Windows 7 RTM with .NET 4.5.2 (or greater) installed.");
118 hrHostInitialization = hr;
119 }
120 else
121 {
122 hrHostInitialization = S_OK;
123 }
124
125 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Loading prerequisite bootstrapper application because managed host could not be loaded, error: 0x%08x.", hr);
126
127 hr = CreatePrerequisiteBA(hrHostInitialization, pEngine, pArgs, pResults);
128 BalExitOnFailure(hr, "Failed to create the pre-requisite bootstrapper application.");
129 }
130
131LExit:
132 ReleaseNullObject(pEngine);
133
134 return hr;
135}
136
137extern "C" void WINAPI BootstrapperApplicationDestroy()
138{
139 if (vpAppDomain)
140 {
141 HRESULT hr = vpCLRHost->UnloadDomain(vpAppDomain);
142 if (FAILED(hr))
143 {
144 BalLogError(hr, "Failed to unload app domain.");
145 }
146
147 vpAppDomain->Release();
148 }
149
150 if (vpCLRHost)
151 {
152 vpCLRHost->Stop();
153 vpCLRHost->Release();
154 }
155
156 if (vhMbapreqModule)
157 {
158 PFN_BOOTSTRAPPER_APPLICATION_DESTROY pfnDestroy = reinterpret_cast<PFN_BOOTSTRAPPER_APPLICATION_DESTROY>(::GetProcAddress(vhMbapreqModule, "MbaPrereqBootstrapperApplicationDestroy"));
159 if (pfnDestroy)
160 {
161 (*pfnDestroy)();
162 }
163
164 ::FreeLibrary(vhMbapreqModule);
165 vhMbapreqModule = NULL;
166 }
167
168 BalUninitialize();
169}
170
171// Gets the custom AppDomain for loading managed BA.
172static HRESULT GetAppDomain(
173 __out _AppDomain **ppAppDomain
174 )
175{
176 HRESULT hr = S_OK;
177 ICorRuntimeHost *pCLRHost = NULL;
178 IUnknown *pUnk = NULL;
179 LPWSTR sczAppBase = NULL;
180 LPWSTR sczConfigPath = NULL;
181 IAppDomainSetup *pAppDomainSetup;
182 BSTR bstrAppBase = NULL;
183 BSTR bstrConfigPath = NULL;
184
185 hr = GetAppBase(&sczAppBase);
186 ExitOnFailure(hr, "Failed to get the host base path.");
187
188 hr = PathConcat(sczAppBase, MBA_CONFIG_FILE_NAME, &sczConfigPath);
189 ExitOnFailure(hr, "Failed to get the full path to the application configuration file.");
190
191 // Check that the supported framework is installed.
192 hr = CheckSupportedFrameworks(sczConfigPath);
193 ExitOnFailure(hr, "Failed to find supported framework.");
194
195 // Load the CLR.
196 hr = GetCLRHost(sczConfigPath, &pCLRHost);
197 ExitOnFailure(hr, "Failed to create the CLR host.");
198
199 hr = pCLRHost->Start();
200 ExitOnRootFailure(hr, "Failed to start the CLR host.");
201
202 // Create the setup information for a new AppDomain to set the app base and config.
203 hr = pCLRHost->CreateDomainSetup(&pUnk);
204 ExitOnRootFailure(hr, "Failed to create the AppDomainSetup object.");
205
206 hr = pUnk->QueryInterface(__uuidof(IAppDomainSetup), reinterpret_cast<LPVOID*>(&pAppDomainSetup));
207 ExitOnRootFailure(hr, "Failed to query for the IAppDomainSetup interface.");
208 ReleaseNullObject(pUnk);
209
210 // Set properties on the AppDomainSetup object.
211 bstrAppBase = ::SysAllocString(sczAppBase);
212 ExitOnNull(bstrAppBase, hr, E_OUTOFMEMORY, "Failed to allocate the application base path for the AppDomainSetup.");
213
214 hr = pAppDomainSetup->put_ApplicationBase(bstrAppBase);
215 ExitOnRootFailure(hr, "Failed to set the application base path for the AppDomainSetup.");
216
217 bstrConfigPath = ::SysAllocString(sczConfigPath);
218 ExitOnNull(bstrConfigPath, hr, E_OUTOFMEMORY, "Failed to allocate the application configuration file for the AppDomainSetup.");
219
220 hr = pAppDomainSetup->put_ConfigurationFile(bstrConfigPath);
221 ExitOnRootFailure(hr, "Failed to set the configuration file path for the AppDomainSetup.");
222
223 // Create the AppDomain to load the factory type.
224 hr = pCLRHost->CreateDomainEx(L"MBA", pAppDomainSetup, NULL, &pUnk);
225 ExitOnRootFailure(hr, "Failed to create the MBA AppDomain.");
226
227 hr = pUnk->QueryInterface(__uuidof(_AppDomain), reinterpret_cast<LPVOID*>(ppAppDomain));
228 ExitOnRootFailure(hr, "Failed to query for the _AppDomain interface.");
229
230LExit:
231 ReleaseBSTR(bstrConfigPath);
232 ReleaseBSTR(bstrAppBase);
233 ReleaseStr(sczConfigPath);
234 ReleaseStr(sczAppBase);
235 ReleaseNullObject(pUnk);
236 ReleaseNullObject(pCLRHost);
237
238 return hr;
239}
240
241static HRESULT GetAppBase(
242 __out LPWSTR *psczAppBase
243 )
244{
245 HRESULT hr = S_OK;
246 LPWSTR sczFullPath = NULL;
247
248 hr = PathForCurrentProcess(&sczFullPath, vhInstance);
249 ExitOnFailure(hr, "Failed to get the full host path.");
250
251 hr = PathGetDirectory(sczFullPath, psczAppBase);
252 ExitOnFailure(hr, "Failed to get the directory of the full process path.");
253
254LExit:
255 ReleaseStr(sczFullPath);
256
257 return hr;
258}
259
260// Checks whether at least one of required supported frameworks is installed via the NETFX registry keys.
261static HRESULT CheckSupportedFrameworks(
262 __in LPCWSTR wzConfigPath
263 )
264{
265 HRESULT hr = S_OK;
266 IXMLDOMDocument* pixdManifest = NULL;
267 IXMLDOMNodeList* pNodeList = NULL;
268 IXMLDOMNode* pNode = NULL;
269 DWORD cSupportedFrameworks = 0;
270 LPWSTR sczSupportedFrameworkVersion = NULL;
271 LPWSTR sczFrameworkRegistryKey = NULL;
272 HKEY hkFramework = NULL;
273 DWORD dwFrameworkInstalled = 0;
274 BOOL fUpdatedManifest = FALSE;
275
276 hr = XmlInitialize();
277 ExitOnFailure(hr, "Failed to initialize XML.");
278
279 hr = XmlLoadDocumentFromFile(wzConfigPath, &pixdManifest);
280 ExitOnFailure(hr, "Failed to load bootstrapper config file from path: %ls", wzConfigPath);
281
282 hr = XmlSelectNodes(pixdManifest, L"/configuration/wix.bootstrapper/host/supportedFramework", &pNodeList);
283 ExitOnFailure(hr, "Failed to select all supportedFramework elements.");
284
285 hr = pNodeList->get_length(reinterpret_cast<long*>(&cSupportedFrameworks));
286 ExitOnFailure(hr, "Failed to get the supported framework count.");
287
288 if (cSupportedFrameworks)
289 {
290 while (S_OK == (hr = XmlNextElement(pNodeList, &pNode, NULL)))
291 {
292 hr = XmlGetAttributeEx(pNode, L"version", &sczSupportedFrameworkVersion);
293 ExitOnFailure(hr, "Failed to get supportedFramework/@version.");
294
295 hr = StrAllocFormatted(&sczFrameworkRegistryKey, L"SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\%ls", sczSupportedFrameworkVersion);
296 ExitOnFailure(hr, "Failed to allocate path to supported framework Install registry key.");
297
298 hr = RegOpen(HKEY_LOCAL_MACHINE, sczFrameworkRegistryKey, KEY_READ, &hkFramework);
299 if (SUCCEEDED(hr))
300 {
301 hr = RegReadNumber(hkFramework, L"Install", &dwFrameworkInstalled);
302 if (dwFrameworkInstalled)
303 {
304 hr = S_OK;
305 break;
306 }
307 }
308
309 ReleaseNullObject(pNode);
310 }
311
312 // If we looped through all the supported frameworks but didn't find anything, ensure we return a failure.
313 if (S_FALSE == hr)
314 {
315 hr = E_NOTFOUND;
316 ExitOnRootFailure(hr, "Failed to find a supported framework.");
317 }
318
319 hr = UpdateSupportedRuntime(pixdManifest, pNode, &fUpdatedManifest);
320 ExitOnFailure(hr, "Failed to update supportedRuntime.");
321 }
322 // else no supported frameworks specified, so the startup/supportedRuntime must be enough.
323
324 if (fUpdatedManifest)
325 {
326 hr = XmlSaveDocument(pixdManifest, wzConfigPath);
327 ExitOnFailure(hr, "Failed to save updated manifest over config file: %ls", wzConfigPath);
328 }
329
330LExit:
331 ReleaseRegKey(hkFramework);
332 ReleaseStr(sczFrameworkRegistryKey);
333 ReleaseStr(sczSupportedFrameworkVersion);
334 ReleaseObject(pNode);
335 ReleaseObject(pNodeList);
336 ReleaseObject(pixdManifest);
337
338 XmlUninitialize();
339
340 return hr;
341}
342
343// Fixes the supportedRuntime element if necessary.
344static HRESULT UpdateSupportedRuntime(
345 __in IXMLDOMDocument* pixdManifest,
346 __in IXMLDOMNode* pixnSupportedFramework,
347 __out BOOL* pfUpdatedManifest
348 )
349{
350 HRESULT hr = S_OK;
351 LPWSTR sczSupportedRuntimeVersion = NULL;
352 IXMLDOMNode* pixnStartup = NULL;
353 IXMLDOMNode* pixnSupportedRuntime = NULL;
354
355 *pfUpdatedManifest = FALSE;
356
357 // If the runtime version attribute is not specified, don't update the manifest.
358 hr = XmlGetAttributeEx(pixnSupportedFramework, L"runtimeVersion", &sczSupportedRuntimeVersion);
359 if (E_NOTFOUND == hr)
360 {
361 ExitFunction1(hr = S_OK);
362 }
363 ExitOnFailure(hr, "Failed to get supportedFramework/@runtimeVersion.");
364
365 // Get the startup element. Fail if we can't find it since it'll be necessary to load the
366 // correct runtime.
367 hr = XmlSelectSingleNode(pixdManifest, L"/configuration/startup", &pixnStartup);
368 ExitOnFailure(hr, "Failed to get startup element.");
369
370 if (S_FALSE == hr)
371 {
372 hr = E_NOTFOUND;
373 ExitOnRootFailure(hr, "Failed to find startup element in bootstrapper application config.");
374 }
375
376 // Remove any pre-existing supported runtimes because they'll just get in the way and create our new one.
377 hr = XmlRemoveChildren(pixnStartup, L"supportedRuntime");
378 ExitOnFailure(hr, "Failed to remove pre-existing supportedRuntime elements.");
379
380 hr = XmlCreateChild(pixnStartup, L"supportedRuntime", &pixnSupportedRuntime);
381 ExitOnFailure(hr, "Failed to create supportedRuntime element.");
382
383 hr = XmlSetAttribute(pixnSupportedRuntime, L"version", sczSupportedRuntimeVersion);
384 ExitOnFailure(hr, "Failed to set supportedRuntime/@version to '%ls'.", sczSupportedRuntimeVersion);
385
386 *pfUpdatedManifest = TRUE;
387
388LExit:
389 ReleaseObject(pixnSupportedRuntime);
390 ReleaseObject(pixnStartup);
391 ReleaseStr(sczSupportedRuntimeVersion);
392
393 return hr;
394}
395
396// Gets the CLR host and caches it.
397static HRESULT GetCLRHost(
398 __in LPCWSTR wzConfigPath,
399 __out ICorRuntimeHost **ppCLRHost
400 )
401{
402 HRESULT hr = S_OK;
403 UINT uiMode = 0;
404 HMODULE hModule = NULL;
405 BOOL fFallbackToCorBindToCurrentRuntime = TRUE;
406 CLRCreateInstanceFnPtr pfnCLRCreateInstance = NULL;
407 ICLRMetaHostPolicy* pCLRMetaHostPolicy = NULL;
408 IStream* pCfgStream = NULL;
409 LPWSTR pwzVersion = NULL;
410 DWORD cchVersion = 0;
411 DWORD dwConfigFlags = 0;
412 ICLRRuntimeInfo* pCLRRuntimeInfo = NULL;
413 PFN_CORBINDTOCURRENTRUNTIME pfnCorBindToCurrentRuntime = NULL;
414
415 // Always set the error mode because we will always restore it below.
416 uiMode = ::SetErrorMode(0);
417
418 // Cache the CLR host to be shutdown later. This can occur on a different thread.
419 if (!vpCLRHost)
420 {
421 // Disable message boxes from being displayed on error and blocking execution.
422 ::SetErrorMode(uiMode | SEM_FAILCRITICALERRORS);
423
424 hr = LoadSystemLibrary(L"mscoree.dll", &hModule);
425 ExitOnFailure(hr, "Failed to load mscoree.dll");
426
427 pfnCLRCreateInstance = reinterpret_cast<CLRCreateInstanceFnPtr>(::GetProcAddress(hModule, "CLRCreateInstance"));
428
429 if (pfnCLRCreateInstance)
430 {
431 hr = pfnCLRCreateInstance(CLSID_CLRMetaHostPolicy, IID_ICLRMetaHostPolicy, reinterpret_cast<LPVOID*>(&pCLRMetaHostPolicy));
432 if (E_NOTIMPL != hr)
433 {
434 ExitOnRootFailure(hr, "Failed to create instance of ICLRMetaHostPolicy.");
435
436 fFallbackToCorBindToCurrentRuntime = FALSE;
437 }
438 }
439
440 if (fFallbackToCorBindToCurrentRuntime)
441 {
442 pfnCorBindToCurrentRuntime = reinterpret_cast<PFN_CORBINDTOCURRENTRUNTIME>(::GetProcAddress(hModule, "CorBindToCurrentRuntime"));
443 ExitOnNullWithLastError(pfnCorBindToCurrentRuntime, hr, "Failed to get procedure address for CorBindToCurrentRuntime.");
444
445 hr = pfnCorBindToCurrentRuntime(wzConfigPath, CLSID_CorRuntimeHost, IID_ICorRuntimeHost, reinterpret_cast<LPVOID*>(&vpCLRHost));
446 ExitOnRootFailure(hr, "Failed to create the CLR host using the application configuration file path.");
447 }
448 else
449 {
450
451 hr = SHCreateStreamOnFileEx(wzConfigPath, STGM_READ | STGM_SHARE_DENY_WRITE, 0, FALSE, NULL, &pCfgStream);
452 ExitOnFailure(hr, "Failed to load bootstrapper config file from path: %ls", wzConfigPath);
453
454 hr = pCLRMetaHostPolicy->GetRequestedRuntime(METAHOST_POLICY_HIGHCOMPAT, NULL, pCfgStream, NULL, &cchVersion, NULL, NULL, &dwConfigFlags, IID_ICLRRuntimeInfo, reinterpret_cast<LPVOID*>(&pCLRRuntimeInfo));
455 ExitOnRootFailure(hr, "Failed to get the CLR runtime info using the application configuration file path.");
456
457 // .NET 4 RTM had a bug where it wouldn't set pcchVersion if pwzVersion was NULL.
458 if (!cchVersion)
459 {
460 hr = pCLRRuntimeInfo->GetVersionString(NULL, &cchVersion);
461 if (HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) != hr)
462 {
463 ExitOnFailure(hr, "Failed to get the length of the CLR version string.");
464 }
465 }
466
467 hr = StrAlloc(&pwzVersion, cchVersion);
468 ExitOnFailure(hr, "Failed to allocate the CLR version string.");
469
470 hr = pCLRRuntimeInfo->GetVersionString(pwzVersion, &cchVersion);
471 ExitOnFailure(hr, "Failed to get the CLR version string.");
472
473 if (CSTR_EQUAL == CompareString(LOCALE_NEUTRAL, 0, L"v4.0.30319", -1, pwzVersion, cchVersion))
474 {
475 hr = VerifyNET4RuntimeIsSupported();
476 ExitOnFailure(hr, "Found unsupported .NET 4 Runtime.");
477 }
478
479 if (METAHOST_CONFIG_FLAGS_LEGACY_V2_ACTIVATION_POLICY_TRUE == (METAHOST_CONFIG_FLAGS_LEGACY_V2_ACTIVATION_POLICY_MASK & dwConfigFlags))
480 {
481 hr = pCLRRuntimeInfo->BindAsLegacyV2Runtime();
482 ExitOnRootFailure(hr, "Failed to bind as legacy V2 runtime.");
483 }
484
485 hr = pCLRRuntimeInfo->GetInterface(CLSID_CorRuntimeHost, IID_ICorRuntimeHost, reinterpret_cast<LPVOID*>(&vpCLRHost));
486 ExitOnRootFailure(hr, "Failed to get instance of ICorRuntimeHost.");
487
488 // TODO: use ICLRRuntimeHost instead of ICorRuntimeHost on .NET 4 since the former is faster and the latter is deprecated
489 //hr = pCLRRuntimeInfo->GetInterface(CLSID_CLRRuntimeHost, IID_ICLRRuntimeHost, reinterpret_cast<LPVOID*>(&pCLRRuntimeHost));
490 //ExitOnRootFailure(hr, "Failed to get instance of ICLRRuntimeHost.");
491 }
492 }
493
494 vpCLRHost->AddRef();
495 *ppCLRHost = vpCLRHost;
496
497LExit:
498 ReleaseStr(pwzVersion);
499 ReleaseNullObject(pCLRRuntimeInfo);
500 ReleaseNullObject(pCfgStream);
501 ReleaseNullObject(pCLRMetaHostPolicy);
502
503 // Unload the module so it's not in use when we install .NET.
504 if (FAILED(hr))
505 {
506 ::FreeLibrary(hModule);
507 }
508
509 ::SetErrorMode(uiMode); // restore the previous error mode.
510
511 return hr;
512}
513
514// Creates the bootstrapper app and returns it for the engine.
515static HRESULT CreateManagedBootstrapperApplication(
516 __in _AppDomain* pAppDomain,
517 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
518 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
519 )
520{
521 HRESULT hr = S_OK;
522 IBootstrapperApplicationFactory* pAppFactory = NULL;
523
524 hr = CreateManagedBootstrapperApplicationFactory(pAppDomain, &pAppFactory);
525 ExitOnFailure(hr, "Failed to create the factory to create the bootstrapper application.");
526
527 hr = pAppFactory->Create(pArgs, pResults);
528 ExitOnFailure(hr, "Failed to create the bootstrapper application.");
529
530LExit:
531 ReleaseNullObject(pAppFactory);
532
533 return hr;
534}
535
536// Creates the app factory to create the managed app in the default AppDomain.
537static HRESULT CreateManagedBootstrapperApplicationFactory(
538 __in _AppDomain* pAppDomain,
539 __out IBootstrapperApplicationFactory** ppAppFactory
540 )
541{
542 HRESULT hr = S_OK;
543 BSTR bstrAssemblyName = NULL;
544 BSTR bstrTypeName = NULL;
545 _ObjectHandle* pObj = NULL;
546 VARIANT vtBAFactory;
547
548 ::VariantInit(&vtBAFactory);
549
550 bstrAssemblyName = ::SysAllocString(MBA_ASSEMBLY_FULL_NAME);
551 ExitOnNull(bstrAssemblyName, hr, E_OUTOFMEMORY, "Failed to allocate the full assembly name for the bootstrapper application factory.");
552
553 bstrTypeName = ::SysAllocString(MBA_ENTRY_TYPE);
554 ExitOnNull(bstrTypeName, hr, E_OUTOFMEMORY, "Failed to allocate the full type name for the BA factory.");
555
556 hr = pAppDomain->CreateInstance(bstrAssemblyName, bstrTypeName, &pObj);
557 ExitOnRootFailure(hr, "Failed to create the BA factory object.");
558
559 hr = pObj->Unwrap(&vtBAFactory);
560 ExitOnRootFailure(hr, "Failed to unwrap the BA factory object into the host domain.");
561 ExitOnNull(vtBAFactory.punkVal, hr, E_UNEXPECTED, "The variant did not contain the expected IUnknown pointer.");
562
563 hr = vtBAFactory.punkVal->QueryInterface(__uuidof(IBootstrapperApplicationFactory), reinterpret_cast<LPVOID*>(ppAppFactory));
564 ExitOnRootFailure(hr, "Failed to query for the bootstrapper app factory interface.");
565
566LExit:
567 ReleaseVariant(vtBAFactory);
568 ReleaseNullObject(pObj);
569 ReleaseBSTR(bstrTypeName);
570 ReleaseBSTR(bstrAssemblyName);
571
572 return hr;
573}
574
575static HRESULT CreatePrerequisiteBA(
576 __in HRESULT hrHostInitialization,
577 __in IBootstrapperEngine* pEngine,
578 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
579 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
580 )
581{
582 HRESULT hr = S_OK;
583 LPWSTR sczMbapreqPath = NULL;
584 HMODULE hModule = NULL;
585
586 hr = PathRelativeToModule(&sczMbapreqPath, L"mbapreq.dll", vhInstance);
587 ExitOnFailure(hr, "Failed to get path to pre-requisite BA.");
588
589 hModule = ::LoadLibraryW(sczMbapreqPath);
590 ExitOnNullWithLastError(hModule, hr, "Failed to load pre-requisite BA DLL.");
591
592 PFN_MBAPREQ_BOOTSTRAPPER_APPLICATION_CREATE pfnCreate = reinterpret_cast<PFN_MBAPREQ_BOOTSTRAPPER_APPLICATION_CREATE>(::GetProcAddress(hModule, "MbaPrereqBootstrapperApplicationCreate"));
593 ExitOnNullWithLastError(pfnCreate, hr, "Failed to get MbaPrereqBootstrapperApplicationCreate entry-point from: %ls", sczMbapreqPath);
594
595 hr = pfnCreate(hrHostInitialization, pEngine, pArgs, pResults);
596 ExitOnFailure(hr, "Failed to create prequisite bootstrapper app.");
597
598 vhMbapreqModule = hModule;
599 hModule = NULL;
600
601LExit:
602 if (hModule)
603 {
604 ::FreeLibrary(hModule);
605 }
606 ReleaseStr(sczMbapreqPath);
607
608 return hr;
609}
610
611static HRESULT VerifyNET4RuntimeIsSupported(
612 )
613{
614 HRESULT hr = S_OK;
615 OS_VERSION osv = OS_VERSION_UNKNOWN;
616 DWORD dwServicePack = 0;
617 HKEY hKey = NULL;
618 DWORD er = ERROR_SUCCESS;
619 DWORD dwRelease = 0;
620 DWORD cchRelease = sizeof(dwRelease);
621
622 OsGetVersion(&osv, &dwServicePack);
623 if (OS_VERSION_WIN7 == osv && 0 == dwServicePack)
624 {
625 hr = RegOpen(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full", KEY_QUERY_VALUE, &hKey);
626 if (E_FILENOTFOUND == hr)
627 {
628 ExitFunction1(hr = S_OK);
629 }
630 ExitOnFailure(hr, "Failed to open registry key for .NET 4.");
631
632 er = ::RegQueryValueExW(hKey, L"Release", NULL, NULL, reinterpret_cast<LPBYTE>(&dwRelease), &cchRelease);
633 if (ERROR_FILE_NOT_FOUND == er)
634 {
635 ExitFunction1(hr = S_OK);
636 }
637 ExitOnWin32Error(er, hr, "Failed to get Release value.");
638
639 if (NET452_RELEASE <= dwRelease)
640 {
641 hr = E_MBAHOST_NET452_ON_WIN7RTM;
642 }
643 }
644
645LExit:
646 ReleaseRegKey(hKey);
647
648 return hr;
649}
diff --git a/src/ext/Bal/mbahost/mbahost.def b/src/ext/Bal/mbahost/mbahost.def
new file mode 100644
index 00000000..4488df94
--- /dev/null
+++ b/src/ext/Bal/mbahost/mbahost.def
@@ -0,0 +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.
2
3
4EXPORTS
5 BootstrapperApplicationCreate
6 BootstrapperApplicationDestroy
diff --git a/src/ext/Bal/mbahost/mbahost.vcxproj b/src/ext/Bal/mbahost/mbahost.vcxproj
new file mode 100644
index 00000000..6457b4e0
--- /dev/null
+++ b/src/ext/Bal/mbahost/mbahost.vcxproj
@@ -0,0 +1,106 @@
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 DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 <Import Project="..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" />
6 <Import Project="..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" />
7 <Import Project="..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props" Condition="Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" />
8 <Import Project="..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props" Condition="Exists('..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props')" />
9 <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props')" />
10 <Import Project="..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props')" />
11
12 <ItemGroup Label="ProjectConfigurations">
13 <ProjectConfiguration Include="Debug|ARM64">
14 <Configuration>Debug</Configuration>
15 <Platform>ARM64</Platform>
16 </ProjectConfiguration>
17 <ProjectConfiguration Include="Release|ARM64">
18 <Configuration>Release</Configuration>
19 <Platform>ARM64</Platform>
20 </ProjectConfiguration>
21 <ProjectConfiguration Include="Debug|Win32">
22 <Configuration>Debug</Configuration>
23 <Platform>Win32</Platform>
24 </ProjectConfiguration>
25 <ProjectConfiguration Include="Release|Win32">
26 <Configuration>Release</Configuration>
27 <Platform>Win32</Platform>
28 </ProjectConfiguration>
29 <ProjectConfiguration Include="Debug|x64">
30 <Configuration>Debug</Configuration>
31 <Platform>x64</Platform>
32 </ProjectConfiguration>
33 <ProjectConfiguration Include="Release|x64">
34 <Configuration>Release</Configuration>
35 <Platform>x64</Platform>
36 </ProjectConfiguration>
37 </ItemGroup>
38
39 <PropertyGroup Label="Globals">
40 <ProjectGuid>{12C87C77-3547-44F8-8134-29BC915CB19D}</ProjectGuid>
41 <ConfigurationType>DynamicLibrary</ConfigurationType>
42 <PlatformToolset>v142</PlatformToolset>
43 <CharacterSet>Unicode</CharacterSet>
44 <TargetName>mbahost</TargetName>
45 <ProjectModuleDefinitionFile>mbahost.def</ProjectModuleDefinitionFile>
46 </PropertyGroup>
47
48 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
49 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
50
51 <PropertyGroup>
52 <ProjectAdditionalLinkLibraries>shlwapi.lib</ProjectAdditionalLinkLibraries>
53 </PropertyGroup>
54
55 <ItemGroup>
56 <ClCompile Include="mbahost.cpp" />
57 <ClCompile Include="precomp.cpp">
58 <PrecompiledHeader>Create</PrecompiledHeader>
59 </ClCompile>
60 </ItemGroup>
61 <ItemGroup>
62 <ClInclude Include="precomp.h" />
63 </ItemGroup>
64 <ItemGroup>
65 <None Include="mbahost.def" />
66 </ItemGroup>
67
68 <ItemGroup>
69 <None Include="packages.config" />
70 </ItemGroup>
71
72 <ItemDefinitionGroup>
73 <ClCompile>
74 <AdditionalIncludeDirectories>$(BaseOutputPath)obj;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
75 </ClCompile>
76 </ItemDefinitionGroup>
77
78 <ItemGroup>
79 <ProjectReference Include="..\WixToolset.Mba.Host\WixToolset.Mba.Host.csproj">
80 <Project>{f2ba1935-70fa-4156-b161-fd03850b4faa}</Project>
81 <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
82 <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
83 </ProjectReference>
84 </ItemGroup>
85
86 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
87 <Import Project="..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets" Condition="Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets')" />
88 <Import Project="..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets" Condition="Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets')" />
89 <Import Project="..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets" Condition="Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" />
90 <Import Project="..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets')" />
91 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
92 <PropertyGroup>
93 <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
94 </PropertyGroup>
95 <Error Condition="!Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props'))" />
96 <Error Condition="!Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets'))" />
97 <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props'))" />
98 <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets'))" />
99 <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props'))" />
100 <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets'))" />
101 <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets'))" />
102 <Error Condition="!Exists('..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props'))" />
103 <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props'))" />
104 <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props'))" />
105 </Target>
106</Project> \ No newline at end of file
diff --git a/src/ext/Bal/mbahost/packages.config b/src/ext/Bal/mbahost/packages.config
new file mode 100644
index 00000000..071284ac
--- /dev/null
+++ b/src/ext/Bal/mbahost/packages.config
@@ -0,0 +1,10 @@
1<?xml version="1.0" encoding="utf-8"?>
2<packages>
3 <package id="Microsoft.Build.Tasks.Git" version="1.0.0" targetFramework="native" developmentDependency="true" />
4 <package id="Microsoft.SourceLink.Common" version="1.0.0" targetFramework="native" developmentDependency="true" />
5 <package id="Microsoft.SourceLink.GitHub" version="1.0.0" targetFramework="native" developmentDependency="true" />
6 <package id="Nerdbank.GitVersioning" version="3.3.37" targetFramework="native" developmentDependency="true" />
7 <package id="WixToolset.BalUtil" version="4.0.58" targetFramework="native" />
8 <package id="WixToolset.BootstrapperCore.Native" version="4.0.141" targetFramework="native" />
9 <package id="WixToolset.DUtil" version="4.0.72" targetFramework="native" />
10</packages> \ No newline at end of file
diff --git a/src/ext/Bal/mbahost/precomp.cpp b/src/ext/Bal/mbahost/precomp.cpp
new file mode 100644
index 00000000..37664a1c
--- /dev/null
+++ b/src/ext/Bal/mbahost/precomp.cpp
@@ -0,0 +1,3 @@
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#include "precomp.h"
diff --git a/src/ext/Bal/mbahost/precomp.h b/src/ext/Bal/mbahost/precomp.h
new file mode 100644
index 00000000..d29a23f3
--- /dev/null
+++ b/src/ext/Bal/mbahost/precomp.h
@@ -0,0 +1,25 @@
1#pragma once
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#include <windows.h>
6#include <msiquery.h>
7#include <metahost.h>
8#include <shlwapi.h>
9
10#import <mscorlib.tlb> raw_interfaces_only rename("ReportEvent", "mscorlib_ReportEvent")
11
12#include <dutil.h>
13#include <osutil.h>
14#include <pathutil.h>
15#include <regutil.h>
16#include <strutil.h>
17#include <xmlutil.h>
18
19#include "BootstrapperEngine.h"
20#include "BootstrapperApplication.h"
21#include "IBootstrapperEngine.h"
22#include "IBootstrapperApplication.h"
23#include "IBootstrapperApplicationFactory.h"
24
25#include "balutil.h"
diff --git a/src/ext/Bal/nuget.config b/src/ext/Bal/nuget.config
new file mode 100644
index 00000000..f3277bc4
--- /dev/null
+++ b/src/ext/Bal/nuget.config
@@ -0,0 +1,19 @@
1<?xml version="1.0" encoding="utf-8"?>
2<configuration>
3 <packageSources>
4 <clear />
5 <add key="wixtoolset-burn" value="https://ci.appveyor.com/nuget/wixtoolset-burn" />
6 <add key="wixtoolset-data" value="https://ci.appveyor.com/nuget/wixtoolset-data" />
7 <add key="wixtoolset-extensibility" value="https://ci.appveyor.com/nuget/wixtoolset-extensibility" />
8 <add key="wixtoolset-core" value="https://ci.appveyor.com/nuget/wixtoolset-core" />
9 <add key="wixtoolset-core-native" value="https://ci.appveyor.com/nuget/wixtoolset-core-native" />
10 <add key="wixtoolset-dtf" value="https://ci.appveyor.com/nuget/wixtoolset-dtf" />
11 <add key="wixtoolset-balutil" value="https://ci.appveyor.com/nuget/wixtoolset-balutil" />
12 <add key="wixtoolset-dutil" value="https://ci.appveyor.com/nuget/wixtoolset-dutil" />
13 <add key="wixtoolset-netfx-wixext" value="https://ci.appveyor.com/nuget/wixtoolset-netfx-wixext" />
14 <add key="wixtoolset-wcautil" value="https://ci.appveyor.com/nuget/wixtoolset-wcautil" />
15 <add key="wixtoolset-tools" value="https://ci.appveyor.com/nuget/wixtoolset-tools" />
16 <add key="wixbuildtools" value="https://ci.appveyor.com/nuget/wixbuildtools" />
17 <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
18 </packageSources>
19</configuration> \ No newline at end of file
diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs b/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs
new file mode 100644
index 00000000..2ff57c55
--- /dev/null
+++ b/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs
@@ -0,0 +1,133 @@
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
3namespace WixToolsetTest.Bal
4{
5 using System.IO;
6 using System.Linq;
7 using System.Xml;
8 using WixBuildTools.TestSupport;
9 using WixToolset.Core.TestPackage;
10 using Xunit;
11
12 public class BalExtensionFixture
13 {
14 [Fact]
15 public void CanBuildUsingDisplayInternalUICondition()
16 {
17 using (var fs = new DisposableFileSystem())
18 {
19 var baseFolder = fs.GetFolder();
20 var bundleFile = Path.Combine(baseFolder, "bin", "test.exe");
21 var bundleSourceFolder = TestData.Get(@"TestData\WixStdBa");
22 var intermediateFolder = Path.Combine(baseFolder, "obj");
23 var baFolderPath = Path.Combine(baseFolder, "ba");
24 var extractFolderPath = Path.Combine(baseFolder, "extract");
25
26 var compileResult = WixRunner.Execute(new[]
27 {
28 "build",
29 Path.Combine(bundleSourceFolder, "DisplayInternalUIConditionBundle.wxs"),
30 "-ext", TestData.Get(@"WixToolset.Bal.wixext.dll"),
31 "-intermediateFolder", intermediateFolder,
32 "-bindpath", Path.Combine(bundleSourceFolder, "data"),
33 "-o", bundleFile,
34 });
35 compileResult.AssertSuccess();
36
37 Assert.True(File.Exists(bundleFile));
38
39 var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath);
40 extractResult.AssertSuccess();
41
42 var balPackageInfos = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo");
43 var balPackageInfo = (XmlNode)Assert.Single(balPackageInfos);
44 Assert.Equal("<WixBalPackageInfo PackageId='test.msi' DisplayInternalUICondition='1' />", balPackageInfo.GetTestXml());
45
46 Assert.True(File.Exists(Path.Combine(baFolderPath, "thm.wxl")));
47 }
48 }
49
50 [Fact]
51 public void CanBuildUsingOverridable()
52 {
53 using (var fs = new DisposableFileSystem())
54 {
55 var baseFolder = fs.GetFolder();
56 var bundleFile = Path.Combine(baseFolder, "bin", "test.exe");
57 var bundleSourceFolder = TestData.Get(@"TestData\Overridable");
58 var intermediateFolder = Path.Combine(baseFolder, "obj");
59 var baFolderPath = Path.Combine(baseFolder, "ba");
60 var extractFolderPath = Path.Combine(baseFolder, "extract");
61
62 var compileResult = WixRunner.Execute(new[]
63 {
64 "build",
65 Path.Combine(bundleSourceFolder, "Bundle.wxs"),
66 "-ext", TestData.Get(@"WixToolset.Bal.wixext.dll"),
67 "-intermediateFolder", intermediateFolder,
68 "-o", bundleFile,
69 });
70 compileResult.AssertSuccess();
71
72 Assert.True(File.Exists(bundleFile));
73
74 var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath);
75 extractResult.AssertSuccess();
76
77 var balOverridableVariables = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:WixStdbaOverridableVariable");
78 var balOverridableVariable = (XmlNode)Assert.Single(balOverridableVariables);
79 Assert.Equal("<WixStdbaOverridableVariable Name='Test1' />", balOverridableVariable.GetTestXml());
80 }
81 }
82
83 [Fact]
84 public void CanBuildUsingWixStdBa()
85 {
86 using (var fs = new DisposableFileSystem())
87 {
88 var baseFolder = fs.GetFolder();
89 var bundleFile = Path.Combine(baseFolder, "bin", "test.exe");
90 var bundleSourceFolder = TestData.Get(@"TestData\WixStdBa");
91 var intermediateFolder = Path.Combine(baseFolder, "obj");
92
93 var compileResult = WixRunner.Execute(new[]
94 {
95 "build",
96 Path.Combine(bundleSourceFolder, "Bundle.wxs"),
97 "-ext", TestData.Get(@"WixToolset.Bal.wixext.dll"),
98 "-intermediateFolder", intermediateFolder,
99 "-o", bundleFile,
100 });
101 compileResult.AssertSuccess();
102
103 Assert.True(File.Exists(bundleFile));
104 }
105 }
106
107 [Fact]
108 public void CantBuildUsingMBAWithNoPrereqs()
109 {
110 using (var fs = new DisposableFileSystem())
111 {
112 var baseFolder = fs.GetFolder();
113 var bundleFile = Path.Combine(baseFolder, "bin", "test.exe");
114 var bundleSourceFolder = TestData.Get(@"TestData\MBA");
115 var intermediateFolder = Path.Combine(baseFolder, "obj");
116
117 var compileResult = WixRunner.Execute(new[]
118 {
119 "build",
120 Path.Combine(bundleSourceFolder, "Bundle.wxs"),
121 "-ext", TestData.Get(@"WixToolset.Bal.wixext.dll"),
122 "-intermediateFolder", intermediateFolder,
123 "-o", bundleFile,
124 });
125 Assert.Equal(6802, compileResult.ExitCode);
126 Assert.Equal("There must be at least one PrereqPackage when using the ManagedBootstrapperApplicationHost.\nThis is typically done by using the WixNetFxExtension and referencing one of the NetFxAsPrereq package groups.", compileResult.Messages[0].ToString());
127
128 Assert.False(File.Exists(bundleFile));
129 Assert.False(File.Exists(Path.Combine(intermediateFolder, "test.exe")));
130 }
131 }
132 }
133}
diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/TestData/MBA/Bundle.wxs b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/MBA/Bundle.wxs
new file mode 100644
index 00000000..ba1aefba
--- /dev/null
+++ b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/MBA/Bundle.wxs
@@ -0,0 +1,12 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3 xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
4 <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2">
5 <BootstrapperApplication>
6 <bal:WixManagedBootstrapperApplicationHost />
7 </BootstrapperApplication>
8 <Chain>
9 <ExePackage Permanent="yes" DetectCondition="none" SourceFile="runtimes\win-x86\native\wixnative.exe" />
10 </Chain>
11 </Bundle>
12</Wix>
diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/TestData/Overridable/Bundle.wxs b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/Overridable/Bundle.wxs
new file mode 100644
index 00000000..91380c69
--- /dev/null
+++ b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/Overridable/Bundle.wxs
@@ -0,0 +1,13 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3 xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
4 <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2">
5 <BootstrapperApplication>
6 <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" />
7 </BootstrapperApplication>
8 <Variable Name="Test1" bal:Overridable="yes" />
9 <Chain>
10 <ExePackage Permanent="yes" DetectCondition="none" SourceFile="runtimes\win-x86\native\wixnative.exe" />
11 </Chain>
12 </Bundle>
13</Wix>
diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/TestData/WixStdBa/Bundle.wxs b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/WixStdBa/Bundle.wxs
new file mode 100644
index 00000000..c17b53ff
--- /dev/null
+++ b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/WixStdBa/Bundle.wxs
@@ -0,0 +1,12 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3 xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
4 <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2">
5 <BootstrapperApplication>
6 <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" />
7 </BootstrapperApplication>
8 <Chain>
9 <ExePackage Permanent="yes" DetectCondition="none" SourceFile="runtimes\win-x86\native\wixnative.exe" />
10 </Chain>
11 </Bundle>
12</Wix>
diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/TestData/WixStdBa/Data/test.msi b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/WixStdBa/Data/test.msi
new file mode 100644
index 00000000..94aacd1a
--- /dev/null
+++ b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/WixStdBa/Data/test.msi
Binary files differ
diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/TestData/WixStdBa/DisplayInternalUIConditionBundle.wxs b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/WixStdBa/DisplayInternalUIConditionBundle.wxs
new file mode 100644
index 00000000..f08cfe6a
--- /dev/null
+++ b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/WixStdBa/DisplayInternalUIConditionBundle.wxs
@@ -0,0 +1,12 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3 xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
4 <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2">
5 <BootstrapperApplication>
6 <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" />
7 </BootstrapperApplication>
8 <Chain>
9 <MsiPackage SourceFile="test.msi" bal:DisplayInternalUICondition="1" />
10 </Chain>
11 </Bundle>
12</Wix>
diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj b/src/ext/Bal/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj
new file mode 100644
index 00000000..c9ab4219
--- /dev/null
+++ b/src/ext/Bal/test/WixToolsetTest.Bal/WixToolsetTest.Bal.csproj
@@ -0,0 +1,43 @@
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>netcoreapp3.1</TargetFramework>
7 <IsPackable>false</IsPackable>
8 </PropertyGroup>
9
10 <ItemGroup>
11 <Content Include="TestData\MBA\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" />
12 <Content Include="TestData\Overridable\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" />
13 <Content Include="TestData\WixStdBa\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" />
14 <Content Include="TestData\WixStdBa\Data\test.msi" CopyToOutputDirectory="PreserveNewest" />
15 <Content Include="TestData\WixStdBa\DisplayInternalUIConditionBundle.wxs" CopyToOutputDirectory="PreserveNewest" />
16 </ItemGroup>
17
18 <Target Name="CopyExtensions" AfterTargets="Build">
19 <Copy DestinationFolder="$(OutputPath)" SourceFiles="@(WixExtension)" />
20 </Target>
21
22 <ItemGroup>
23 <ProjectReference Include="..\..\wixext\WixToolset.Bal.wixext.csproj" />
24 </ItemGroup>
25
26 <ItemGroup>
27 <PackageReference Include="WixToolset.Core" Version="4.0.*" />
28 <PackageReference Include="WixToolset.Core.Burn" Version="4.0.*" />
29 <PackageReference Include="WixToolset.Core.WindowsInstaller" Version="4.0.*" />
30 <PackageReference Include="WixToolset.Core.TestPackage" Version="4.0.*" />
31 <PackageReference Include="WixToolset.Data" Version="4.0.*" />
32 </ItemGroup>
33
34 <ItemGroup>
35 <PackageReference Include="WixBuildTools.TestSupport" Version="4.0.*" />
36 </ItemGroup>
37
38 <ItemGroup>
39 <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
40 <PackageReference Include="xunit" Version="2.4.1" />
41 <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="All" />
42 </ItemGroup>
43</Project>
diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/WixToolsetTest.Bal.v3.ncrunchproject b/src/ext/Bal/test/WixToolsetTest.Bal/WixToolsetTest.Bal.v3.ncrunchproject
new file mode 100644
index 00000000..7b5b2139
--- /dev/null
+++ b/src/ext/Bal/test/WixToolsetTest.Bal/WixToolsetTest.Bal.v3.ncrunchproject
@@ -0,0 +1,5 @@
1<ProjectConfiguration>
2 <Settings>
3 <CopyReferencedAssembliesToWorkspace>True</CopyReferencedAssembliesToWorkspace>
4 </Settings>
5</ProjectConfiguration> \ No newline at end of file
diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/DncHostFixture.cs b/src/ext/Bal/test/WixToolsetTest.ManagedHost/DncHostFixture.cs
new file mode 100644
index 00000000..af5f2543
--- /dev/null
+++ b/src/ext/Bal/test/WixToolsetTest.ManagedHost/DncHostFixture.cs
@@ -0,0 +1,209 @@
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
3namespace WixToolsetTest.ManagedHost
4{
5 using System.IO;
6 using WixBuildTools.TestSupport;
7 using WixToolset.Core.TestPackage;
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 var logMessages = result.Output;
25 Assert.Equal("Loading .NET Core FDD bootstrapper application.", logMessages[0]);
26 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[1]);
27 Assert.Equal("EarliestCoreBA", logMessages[2]);
28 Assert.Equal("Shutdown,ReloadBootstrapper,0", logMessages[3]);
29 }
30 }
31
32 [Fact]
33 public void CanLoadSCDEarliestCoreMBA()
34 {
35 using (var fs = new DisposableFileSystem())
36 {
37 var baseFolder = fs.GetFolder();
38 var bundleFile = TestData.Get(bundleBasePath, "EarliestCoreBundleSCD.exe");
39 var testEngine = new TestEngine();
40
41 var result = testEngine.RunShutdownEngine(bundleFile, baseFolder);
42 var logMessages = result.Output;
43 Assert.Equal("Loading .NET Core SCD bootstrapper application.", logMessages[0]);
44 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[1]);
45 Assert.Equal("EarliestCoreBA", logMessages[2]);
46 Assert.Equal("Shutdown,ReloadBootstrapper,0", logMessages[3]);
47 }
48 }
49
50 [Fact]
51 public void CanLoadTrimmedSCDEarliestCoreMBA()
52 {
53 using (var fs = new DisposableFileSystem())
54 {
55 var baseFolder = fs.GetFolder();
56 var bundleFile = TestData.Get(bundleBasePath, "EarliestCoreBundleTrimmedSCD.exe");
57 var testEngine = new TestEngine();
58
59 var result = testEngine.RunShutdownEngine(bundleFile, baseFolder);
60 var logMessages = result.Output;
61 Assert.Equal("Loading .NET Core SCD bootstrapper application.", logMessages[0]);
62 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[1]);
63 Assert.Equal("EarliestCoreBA", logMessages[2]);
64 Assert.Equal("Shutdown,ReloadBootstrapper,0", logMessages[3]);
65 }
66 }
67
68 [Fact]
69 public void CanReloadSCDEarliestCoreMBA()
70 {
71 using (var fs = new DisposableFileSystem())
72 {
73 var baseFolder = fs.GetFolder();
74 var bundleFile = TestData.Get(bundleBasePath, "EarliestCoreBundleSCD.exe");
75 var testEngine = new TestEngine();
76
77 var result = testEngine.RunReloadEngine(bundleFile, baseFolder);
78 var logMessages = result.Output;
79 Assert.Equal("Loading .NET Core SCD bootstrapper application.", logMessages[0]);
80 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[1]);
81 Assert.Equal("EarliestCoreBA", logMessages[2]);
82 Assert.Equal("Shutdown,ReloadBootstrapper,0", logMessages[3]);
83 Assert.Equal("Loading .NET Core SCD bootstrapper application.", logMessages[4]);
84 Assert.Equal("Reloaded 1 time(s)", logMessages[5]); // dnchost doesn't currently support unloading
85 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[6]);
86 Assert.Equal("EarliestCoreBA", logMessages[7]);
87 Assert.Equal("Shutdown,Restart,0", logMessages[8]);
88 }
89 }
90
91 [Fact]
92 public void CanLoadFDDLatestCoreMBA()
93 {
94 using (var fs = new DisposableFileSystem())
95 {
96 var baseFolder = fs.GetFolder();
97 var bundleFile = TestData.Get(bundleBasePath, "LatestCoreBundleFDD.exe");
98 var testEngine = new TestEngine();
99
100 var result = testEngine.RunShutdownEngine(bundleFile, baseFolder);
101 var logMessages = result.Output;
102 Assert.Equal("Loading .NET Core FDD bootstrapper application.", logMessages[0]);
103 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[1]);
104 Assert.Equal("LatestCoreBA", logMessages[2]);
105 Assert.Equal("Shutdown,ReloadBootstrapper,0", logMessages[3]);
106 }
107 }
108
109 [Fact]
110 public void CanReloadFDDLatestCoreMBA()
111 {
112 using (var fs = new DisposableFileSystem())
113 {
114 var baseFolder = fs.GetFolder();
115 var bundleFile = TestData.Get(bundleBasePath, "LatestCoreBundleFDD.exe");
116 var testEngine = new TestEngine();
117
118 var result = testEngine.RunReloadEngine(bundleFile, baseFolder);
119 var logMessages = result.Output;
120 Assert.Equal("Loading .NET Core FDD bootstrapper application.", logMessages[0]);
121 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[1]);
122 Assert.Equal("LatestCoreBA", logMessages[2]);
123 Assert.Equal("Shutdown,ReloadBootstrapper,0", logMessages[3]);
124 Assert.Equal("Loading .NET Core FDD bootstrapper application.", logMessages[4]);
125 Assert.Equal("Reloaded 1 time(s)", logMessages[5]); // dnchost doesn't currently support unloading
126 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[6]);
127 Assert.Equal("LatestCoreBA", logMessages[7]);
128 Assert.Equal("Shutdown,Restart,0", logMessages[8]);
129 }
130 }
131
132 [Fact]
133 public void CanLoadSCDLatestCoreMBA()
134 {
135 using (var fs = new DisposableFileSystem())
136 {
137 var baseFolder = fs.GetFolder();
138 var bundleFile = TestData.Get(bundleBasePath, "LatestCoreBundleSCD.exe");
139 var testEngine = new TestEngine();
140
141 var result = testEngine.RunShutdownEngine(bundleFile, baseFolder);
142 var logMessages = result.Output;
143 Assert.Equal("Loading .NET Core SCD bootstrapper application.", logMessages[0]);
144 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[1]);
145 Assert.Equal("LatestCoreBA", logMessages[2]);
146 Assert.Equal("Shutdown,ReloadBootstrapper,0", logMessages[3]);
147 }
148 }
149
150 [Fact]
151 public void CanLoadTrimmedSCDLatestCoreMBA()
152 {
153 using (var fs = new DisposableFileSystem())
154 {
155 var baseFolder = fs.GetFolder();
156 var bundleFile = TestData.Get(bundleBasePath, "LatestCoreBundleTrimmedSCD.exe");
157 var testEngine = new TestEngine();
158
159 var result = testEngine.RunShutdownEngine(bundleFile, baseFolder);
160 var logMessages = result.Output;
161 Assert.Equal("Loading .NET Core SCD bootstrapper application.", logMessages[0]);
162 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[1]);
163 Assert.Equal("LatestCoreBA", logMessages[2]);
164 Assert.Equal("Shutdown,ReloadBootstrapper,0", logMessages[3]);
165 }
166 }
167
168 [Fact]
169 public void CanReloadSCDLatestCoreMBA()
170 {
171 using (var fs = new DisposableFileSystem())
172 {
173 var baseFolder = fs.GetFolder();
174 var bundleFile = TestData.Get(bundleBasePath, "LatestCoreBundleSCD.exe");
175 var testEngine = new TestEngine();
176
177 var result = testEngine.RunReloadEngine(bundleFile, baseFolder);
178 var logMessages = result.Output;
179 Assert.Equal("Loading .NET Core SCD bootstrapper application.", logMessages[0]);
180 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[1]);
181 Assert.Equal("LatestCoreBA", logMessages[2]);
182 Assert.Equal("Shutdown,ReloadBootstrapper,0", logMessages[3]);
183 Assert.Equal("Loading .NET Core SCD bootstrapper application.", logMessages[4]);
184 Assert.Equal("Reloaded 1 time(s)", logMessages[5]); // dnchost doesn't currently support unloading
185 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[6]);
186 Assert.Equal("LatestCoreBA", logMessages[7]);
187 Assert.Equal("Shutdown,Restart,0", logMessages[8]);
188 }
189 }
190
191 [Fact]
192 public void CanLoadFDDWPFCoreMBA()
193 {
194 using (var fs = new DisposableFileSystem())
195 {
196 var baseFolder = fs.GetFolder();
197 var bundleFile = TestData.Get(bundleBasePath, "WPFCoreBundleFDD.exe");
198 var testEngine = new TestEngine();
199
200 var result = testEngine.RunShutdownEngine(bundleFile, baseFolder);
201 var logMessages = result.Output;
202 Assert.Equal("Loading .NET Core FDD bootstrapper application.", logMessages[0]);
203 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[1]);
204 Assert.Equal("WPFCoreBA", logMessages[2]);
205 Assert.Equal("Shutdown,ReloadBootstrapper,0", logMessages[3]);
206 }
207 }
208 }
209}
diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/MbaHostFixture.cs b/src/ext/Bal/test/WixToolsetTest.ManagedHost/MbaHostFixture.cs
new file mode 100644
index 00000000..dd37ee58
--- /dev/null
+++ b/src/ext/Bal/test/WixToolsetTest.ManagedHost/MbaHostFixture.cs
@@ -0,0 +1,94 @@
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
3namespace WixToolsetTest.ManagedHost
4{
5 using System.IO;
6 using WixBuildTools.TestSupport;
7 using WixToolset.Core.TestPackage;
8 using Xunit;
9
10 public class MbaHostFixture
11 {
12 static readonly string bundleBasePath = TestData.Get("..", "examples");
13
14 [Fact]
15 public void CanLoadFullFramework2MBA()
16 {
17 using (var fs = new DisposableFileSystem())
18 {
19 var baseFolder = fs.GetFolder();
20 var bundleFile = TestData.Get(bundleBasePath, "FullFramework2Bundle.exe");
21 var testEngine = new TestEngine();
22
23 var result = testEngine.RunShutdownEngine(bundleFile, baseFolder);
24 var logMessages = result.Output;
25 Assert.Equal("Loading managed bootstrapper application.", logMessages[0]);
26 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[1]);
27 Assert.Equal("FullFramework2BA", logMessages[2]);
28 Assert.Equal("Shutdown,ReloadBootstrapper,0", logMessages[3]);
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 var logMessages = result.Output;
43 Assert.Equal("Loading managed bootstrapper application.", logMessages[0]);
44 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[1]);
45 Assert.Equal("FullFramework4BA", logMessages[2]);
46 Assert.Equal("Shutdown,ReloadBootstrapper,0", logMessages[3]);
47 }
48 }
49
50 [Fact]
51 public void CanReloadFullFramework2MBA()
52 {
53 using (var fs = new DisposableFileSystem())
54 {
55 var baseFolder = fs.GetFolder();
56 var bundleFile = TestData.Get(bundleBasePath, "FullFramework2Bundle.exe");
57 var testEngine = new TestEngine();
58
59 var result = testEngine.RunReloadEngine(bundleFile, baseFolder);
60 var logMessages = result.Output;
61 Assert.Equal("Loading managed bootstrapper application.", logMessages[0]);
62 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[1]);
63 Assert.Equal("FullFramework2BA", logMessages[2]);
64 Assert.Equal("Shutdown,ReloadBootstrapper,0", logMessages[3]);
65 Assert.Equal("Loading managed bootstrapper application.", logMessages[4]);
66 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[5]);
67 Assert.Equal("FullFramework2BA", logMessages[6]);
68 Assert.Equal("Shutdown,Restart,0", logMessages[7]);
69 }
70 }
71
72 [Fact]
73 public void CanReloadFullFramework4MBA()
74 {
75 using (var fs = new DisposableFileSystem())
76 {
77 var baseFolder = fs.GetFolder();
78 var bundleFile = TestData.Get(bundleBasePath, "FullFramework4Bundle.exe");
79 var testEngine = new TestEngine();
80
81 var result = testEngine.RunReloadEngine(bundleFile, baseFolder);
82 var logMessages = result.Output;
83 Assert.Equal("Loading managed bootstrapper application.", logMessages[0]);
84 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[1]);
85 Assert.Equal("FullFramework4BA", logMessages[2]);
86 Assert.Equal("Shutdown,ReloadBootstrapper,0", logMessages[3]);
87 Assert.Equal("Loading managed bootstrapper application.", logMessages[4]);
88 Assert.Equal("Creating BA thread to run asynchronously.", logMessages[5]);
89 Assert.Equal("FullFramework4BA", logMessages[6]);
90 Assert.Equal("Shutdown,Restart,0", logMessages[7]);
91 }
92 }
93 }
94}
diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/README.md b/src/ext/Bal/test/WixToolsetTest.ManagedHost/README.md
new file mode 100644
index 00000000..d7e73df2
--- /dev/null
+++ b/src/ext/Bal/test/WixToolsetTest.ManagedHost/README.md
@@ -0,0 +1,5 @@
1In order to properly test dnchost and mbahost,
2the managed BAs need to be published and a bundle needs to be built for each scenario.
3Making this happen on every build for the solution takes too long,
4so this project relies on manually running appveyor.cmd to publish everything before the tests can be run.
5appveyor.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
new file mode 100644
index 00000000..44538227
--- /dev/null
+++ b/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngine.cs
@@ -0,0 +1,74 @@
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
3namespace WixToolsetTest.ManagedHost
4{
5 using System.Collections.Generic;
6 using System.Diagnostics;
7 using System.IO;
8 using WixBuildTools.TestSupport;
9 using WixToolset.Core.TestPackage;
10
11 public class TestEngine
12 {
13 private static readonly string TestEngineFile = TestData.Get(@"..\Win32\examples\Example.TestEngine\Example.TestEngine.exe");
14
15 public TestEngineResult RunReloadEngine(string bundleFilePath, string tempFolderPath)
16 {
17 return this.RunTestEngine("reload", bundleFilePath, tempFolderPath);
18 }
19
20 public TestEngineResult RunShutdownEngine(string bundleFilePath, string tempFolderPath)
21 {
22 return this.RunTestEngine("shutdown", bundleFilePath, tempFolderPath);
23 }
24
25 private TestEngineResult RunTestEngine(string engineMode, string bundleFilePath, string tempFolderPath)
26 {
27 var baFolderPath = Path.Combine(tempFolderPath, "ba");
28 var extractFolderPath = Path.Combine(tempFolderPath, "extract");
29 var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFilePath, baFolderPath, extractFolderPath);
30 extractResult.AssertSuccess();
31
32 var args = new string[] {
33 engineMode,
34 '"' + bundleFilePath + '"',
35 '"' + extractResult.GetBAFilePath(baFolderPath) + '"',
36 };
37 return RunProcessCaptureOutput(TestEngineFile, args);
38 }
39
40 private static TestEngineResult RunProcessCaptureOutput(string executablePath, string[] arguments = null, string workingFolder = null)
41 {
42 var startInfo = new ProcessStartInfo(executablePath)
43 {
44 Arguments = string.Join(' ', arguments),
45 CreateNoWindow = true,
46 RedirectStandardError = true,
47 RedirectStandardOutput = true,
48 UseShellExecute = false,
49 WorkingDirectory = workingFolder,
50 };
51
52 var exitCode = 0;
53 var output = new List<string>();
54
55 using (var process = Process.Start(startInfo))
56 {
57 process.OutputDataReceived += (s, e) => { if (e.Data != null) { output.Add(e.Data); } };
58 process.ErrorDataReceived += (s, e) => { if (e.Data != null) { output.Add(e.Data); } };
59
60 process.BeginErrorReadLine();
61 process.BeginOutputReadLine();
62
63 process.WaitForExit();
64 exitCode = process.ExitCode;
65 }
66
67 return new TestEngineResult
68 {
69 ExitCode = exitCode,
70 Output = output,
71 };
72 }
73 }
74}
diff --git a/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngineResult.cs b/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngineResult.cs
new file mode 100644
index 00000000..63f6f7f5
--- /dev/null
+++ b/src/ext/Bal/test/WixToolsetTest.ManagedHost/TestEngineResult.cs
@@ -0,0 +1,12 @@
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
3namespace 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
new file mode 100644
index 00000000..38c8926c
--- /dev/null
+++ b/src/ext/Bal/test/WixToolsetTest.ManagedHost/WixToolsetTest.ManagedHost.csproj
@@ -0,0 +1,25 @@
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>netcoreapp3.1</TargetFramework>
7 </PropertyGroup>
8
9 <ItemGroup>
10 <ProjectReference Include="..\examples\TestEngine\Example.TestEngine.vcxproj" />
11 </ItemGroup>
12
13 <ItemGroup>
14 <PackageReference Include="WixBuildTools.TestSupport" Version="4.0.*" />
15 <PackageReference Include="WixToolset.Core.Burn" Version="4.0.*" />
16 <PackageReference Include="WixToolset.Core.WindowsInstaller" Version="4.0.*" />
17 <PackageReference Include="WixToolset.Core.TestPackage" Version="4.0.*" />
18 </ItemGroup>
19
20 <ItemGroup>
21 <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
22 <PackageReference Include="xunit" Version="2.4.1" />
23 <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="All" />
24 </ItemGroup>
25</Project>
diff --git a/src/ext/Bal/test/examples/Directory.Build.props b/src/ext/Bal/test/examples/Directory.Build.props
new file mode 100644
index 00000000..3d5870a5
--- /dev/null
+++ b/src/ext/Bal/test/examples/Directory.Build.props
@@ -0,0 +1,6 @@
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="..\..\Directory.Build.props" />
5 <Import Project="Wix.Build.props" Condition=" '$(MSBuildProjectExtension)'=='.wixproj' " />
6</Project>
diff --git a/src/ext/Bal/test/examples/Directory.Build.targets b/src/ext/Bal/test/examples/Directory.Build.targets
new file mode 100644
index 00000000..6dcf402b
--- /dev/null
+++ b/src/ext/Bal/test/examples/Directory.Build.targets
@@ -0,0 +1,6 @@
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="..\..\Directory.Build.targets" />
5 <Import Project="Wix.Build.targets" Condition=" '$(MSBuildProjectExtension)'=='.wixproj' " />
6</Project>
diff --git a/src/ext/Bal/test/examples/EarliestCoreBundleFDD/EarliestCoreBundleFDD.wixproj b/src/ext/Bal/test/examples/EarliestCoreBundleFDD/EarliestCoreBundleFDD.wixproj
new file mode 100644
index 00000000..ba75a9ff
--- /dev/null
+++ b/src/ext/Bal/test/examples/EarliestCoreBundleFDD/EarliestCoreBundleFDD.wixproj
@@ -0,0 +1,2 @@
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" />
diff --git a/src/ext/Bal/test/examples/EarliestCoreBundleFDD/FrameworkDependentBundle.wxs b/src/ext/Bal/test/examples/EarliestCoreBundleFDD/FrameworkDependentBundle.wxs
new file mode 100644
index 00000000..d146845c
--- /dev/null
+++ b/src/ext/Bal/test/examples/EarliestCoreBundleFDD/FrameworkDependentBundle.wxs
@@ -0,0 +1,16 @@
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">
3 <BootstrapperApplication>
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" />
6 <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd\Example.EarliestCoreMBA.pdb" Name="Example.EarliestCoreMBA.pdb" />
7 <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd\Example.EarliestCoreMBA.runtimeconfig.json" Name="Example.EarliestCoreMBA.runtimeconfig.json" />
8 <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd\mbanative.dll" Name="mbanative.dll" />
9 <Payload SourceFile="publish\Example.EarliestCoreMBA\fdd\WixToolset.Mba.Core.dll" Name="WixToolset.Mba.Core.dll" />
10 <bal:WixDotNetCoreBootstrapperApplicationHost />
11 </BootstrapperApplication>
12 <Chain>
13 <ExePackage DetectCondition="none" SourceFile="c:\windows\system32\kernel32.dll" bal:PrereqPackage="yes" />
14 </Chain>
15 </Bundle>
16</Wix>
diff --git a/src/ext/Bal/test/examples/EarliestCoreBundleSCD/EarliestCoreBundleSCD.wixproj b/src/ext/Bal/test/examples/EarliestCoreBundleSCD/EarliestCoreBundleSCD.wixproj
new file mode 100644
index 00000000..ebeebff2
--- /dev/null
+++ b/src/ext/Bal/test/examples/EarliestCoreBundleSCD/EarliestCoreBundleSCD.wixproj
@@ -0,0 +1,10 @@
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">
3 <ItemGroup>
4 <BindInputPaths Include="$(OutputPath)publish\Example.EarliestCoreMBA\scd" />
5 <HarvestDirectory Include="$(OutputPath)publish\Example.EarliestCoreMBA\scd">
6 <DirectoryRefId>publish.Example.EarliestCoreMBA.scd</DirectoryRefId>
7 <Transforms>ba.xslt</Transforms>
8 </HarvestDirectory>
9 </ItemGroup>
10</Project>
diff --git a/src/ext/Bal/test/examples/EarliestCoreBundleSCD/SelfContainedBundle.wxs b/src/ext/Bal/test/examples/EarliestCoreBundleSCD/SelfContainedBundle.wxs
new file mode 100644
index 00000000..4d872317
--- /dev/null
+++ b/src/ext/Bal/test/examples/EarliestCoreBundleSCD/SelfContainedBundle.wxs
@@ -0,0 +1,11 @@
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">
3 <BootstrapperApplication>
4 <bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment="yes" />
5 <PayloadGroupRef Id="publish.Example.EarliestCoreMBA.scd" />
6 </BootstrapperApplication>
7 <Chain>
8 <ExePackage DetectCondition="none" SourceFile="c:\windows\system32\kernel32.dll" PerMachine="yes" />
9 </Chain>
10 </Bundle>
11</Wix>
diff --git a/src/ext/Bal/test/examples/EarliestCoreBundleSCD/ba.xslt b/src/ext/Bal/test/examples/EarliestCoreBundleSCD/ba.xslt
new file mode 100644
index 00000000..06b84256
--- /dev/null
+++ b/src/ext/Bal/test/examples/EarliestCoreBundleSCD/ba.xslt
@@ -0,0 +1,20 @@
1<?xml version="1.0" encoding="utf-8"?>
2<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
4 xmlns:wix="http://wixtoolset.org/schemas/v4/wxs"
5>
6 <xsl:output method="xml" indent="yes"/>
7
8 <xsl:template match="@* | node()">
9 <xsl:copy>
10 <xsl:apply-templates select="@* | node()"/>
11 </xsl:copy>
12 </xsl:template>
13
14 <xsl:template match="wix:Payload[@SourceFile='SourceDir\Example.EarliestCoreMBA.dll']" >
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>
diff --git a/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/EarliestCoreBundleTrimmedSCD.wixproj b/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/EarliestCoreBundleTrimmedSCD.wixproj
new file mode 100644
index 00000000..a6b56460
--- /dev/null
+++ b/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/EarliestCoreBundleTrimmedSCD.wixproj
@@ -0,0 +1,10 @@
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">
3 <ItemGroup>
4 <BindInputPaths Include="$(OutputPath)publish\Example.EarliestCoreMBA\trimmedscd" />
5 <HarvestDirectory Include="$(OutputPath)publish\Example.EarliestCoreMBA\trimmedscd">
6 <DirectoryRefId>publish.Example.EarliestCoreMBA.trimmedscd</DirectoryRefId>
7 <Transforms>ba.xslt</Transforms>
8 </HarvestDirectory>
9 </ItemGroup>
10</Project>
diff --git a/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs b/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs
new file mode 100644
index 00000000..ba7dce25
--- /dev/null
+++ b/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs
@@ -0,0 +1,11 @@
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">
3 <BootstrapperApplication>
4 <bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment="yes" />
5 <PayloadGroupRef Id="publish.Example.EarliestCoreMBA.trimmedscd" />
6 </BootstrapperApplication>
7 <Chain>
8 <ExePackage DetectCondition="none" SourceFile="c:\windows\system32\kernel32.dll" PerMachine="yes" />
9 </Chain>
10 </Bundle>
11</Wix>
diff --git a/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/ba.xslt b/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/ba.xslt
new file mode 100644
index 00000000..06b84256
--- /dev/null
+++ b/src/ext/Bal/test/examples/EarliestCoreBundleTrimmedSCD/ba.xslt
@@ -0,0 +1,20 @@
1<?xml version="1.0" encoding="utf-8"?>
2<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
4 xmlns:wix="http://wixtoolset.org/schemas/v4/wxs"
5>
6 <xsl:output method="xml" indent="yes"/>
7
8 <xsl:template match="@* | node()">
9 <xsl:copy>
10 <xsl:apply-templates select="@* | node()"/>
11 </xsl:copy>
12 </xsl:template>
13
14 <xsl:template match="wix:Payload[@SourceFile='SourceDir\Example.EarliestCoreMBA.dll']" >
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>
diff --git a/src/ext/Bal/test/examples/EarliestCoreMBA/EarliestCoreBA.cs b/src/ext/Bal/test/examples/EarliestCoreMBA/EarliestCoreBA.cs
new file mode 100644
index 00000000..c9291a7f
--- /dev/null
+++ b/src/ext/Bal/test/examples/EarliestCoreMBA/EarliestCoreBA.cs
@@ -0,0 +1,34 @@
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
3namespace Example.EarliestCoreMBA
4{
5 using WixToolset.Mba.Core;
6
7 public class EarliestCoreBA : BootstrapperApplication
8 {
9 public EarliestCoreBA(IEngine engine)
10 : base(engine)
11 {
12
13 }
14
15 protected override void Run()
16 {
17 }
18
19 protected override void OnStartup(StartupEventArgs args)
20 {
21 base.OnStartup(args);
22
23 this.engine.Log(LogLevel.Standard, nameof(EarliestCoreBA));
24 }
25
26 protected override void OnShutdown(ShutdownEventArgs args)
27 {
28 base.OnShutdown(args);
29
30 var message = "Shutdown," + args.Action.ToString() + "," + args.HResult.ToString();
31 this.engine.Log(LogLevel.Standard, message);
32 }
33 }
34}
diff --git a/src/ext/Bal/test/examples/EarliestCoreMBA/EarliestCoreBAFactory.cs b/src/ext/Bal/test/examples/EarliestCoreMBA/EarliestCoreBAFactory.cs
new file mode 100644
index 00000000..672e17ee
--- /dev/null
+++ b/src/ext/Bal/test/examples/EarliestCoreMBA/EarliestCoreBAFactory.cs
@@ -0,0 +1,22 @@
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))]
4namespace 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
new file mode 100644
index 00000000..cb66c138
--- /dev/null
+++ b/src/ext/Bal/test/examples/EarliestCoreMBA/Example.EarliestCoreMBA.csproj
@@ -0,0 +1,18 @@
1<Project Sdk="Microsoft.NET.Sdk">
2
3 <PropertyGroup>
4 <TargetFramework>netcoreapp3.1</TargetFramework>
5 <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
6 <EnableDynamicLoading>true</EnableDynamicLoading>
7 <Description>Earliest .NET Core MBA</Description>
8 </PropertyGroup>
9
10 <ItemGroup>
11 <TrimmerRootAssembly Include="System.Runtime.Loader" />
12 </ItemGroup>
13
14 <ItemGroup>
15 <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="all" />
16 <PackageReference Include="WixToolset.Mba.Core" Version="4.0.*" />
17 </ItemGroup>
18</Project> \ No newline at end of file
diff --git a/src/ext/Bal/test/examples/FullFramework2Bundle/Bundle.wxs b/src/ext/Bal/test/examples/FullFramework2Bundle/Bundle.wxs
new file mode 100644
index 00000000..f0af975c
--- /dev/null
+++ b/src/ext/Bal/test/examples/FullFramework2Bundle/Bundle.wxs
@@ -0,0 +1,14 @@
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">
3 <BootstrapperApplication>
4 <Payload SourceFile="Example.FullFramework2MBA\net20\win-x86\Example.FullFramework2MBA.dll" />
5 <Payload SourceFile="Example.FullFramework2MBA\net20\win-x86\mbanative.dll" />
6 <Payload SourceFile="Example.FullFramework2MBA\net20\win-x86\WixToolset.Mba.Core.dll" />
7 <Payload SourceFile="Example.FullFramework2MBA\net20\win-x86\WixToolset.Mba.Host.config" />
8 <bal:WixManagedBootstrapperApplicationHost />
9 </BootstrapperApplication>
10 <Chain>
11 <ExePackage DetectCondition="none" SourceFile="c:\windows\system32\kernel32.dll" bal:PrereqPackage="yes" />
12 </Chain>
13 </Bundle>
14</Wix>
diff --git a/src/ext/Bal/test/examples/FullFramework2Bundle/FullFramework2Bundle.wixproj b/src/ext/Bal/test/examples/FullFramework2Bundle/FullFramework2Bundle.wixproj
new file mode 100644
index 00000000..ba75a9ff
--- /dev/null
+++ b/src/ext/Bal/test/examples/FullFramework2Bundle/FullFramework2Bundle.wixproj
@@ -0,0 +1,2 @@
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" />
diff --git a/src/ext/Bal/test/examples/FullFramework2MBA/Example.FullFramework2MBA.csproj b/src/ext/Bal/test/examples/FullFramework2MBA/Example.FullFramework2MBA.csproj
new file mode 100644
index 00000000..21079ed1
--- /dev/null
+++ b/src/ext/Bal/test/examples/FullFramework2MBA/Example.FullFramework2MBA.csproj
@@ -0,0 +1,20 @@
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>net20</TargetFramework>
7 <AssemblyName>Example.FullFramework2MBA</AssemblyName>
8 <RootNamespace>Example.FullFramework2MBA</RootNamespace>
9 <DebugType>embedded</DebugType>
10 <RuntimeIdentifier>win-x86</RuntimeIdentifier>
11 </PropertyGroup>
12
13 <ItemGroup>
14 <Content Include="WixToolset.Mba.Host.config" CopyToOutputDirectory="PreserveNewest" />
15 </ItemGroup>
16
17 <ItemGroup>
18 <PackageReference Include="WixToolset.Mba.Core" Version="4.0.*" />
19 </ItemGroup>
20</Project> \ No newline at end of file
diff --git a/src/ext/Bal/test/examples/FullFramework2MBA/FullFramework2BA.cs b/src/ext/Bal/test/examples/FullFramework2MBA/FullFramework2BA.cs
new file mode 100644
index 00000000..32cd19c8
--- /dev/null
+++ b/src/ext/Bal/test/examples/FullFramework2MBA/FullFramework2BA.cs
@@ -0,0 +1,34 @@
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
3namespace Example.FullFramework2MBA
4{
5 using WixToolset.Mba.Core;
6
7 public class FullFramework2BA : BootstrapperApplication
8 {
9 public FullFramework2BA(IEngine engine)
10 : base(engine)
11 {
12
13 }
14
15 protected override void Run()
16 {
17 }
18
19 protected override void OnStartup(StartupEventArgs args)
20 {
21 base.OnStartup(args);
22
23 this.engine.Log(LogLevel.Standard, nameof(FullFramework2BA));
24 }
25
26 protected override void OnShutdown(ShutdownEventArgs args)
27 {
28 base.OnShutdown(args);
29
30 var message = "Shutdown," + args.Action.ToString() + "," + args.HResult.ToString();
31 this.engine.Log(LogLevel.Standard, message);
32 }
33 }
34}
diff --git a/src/ext/Bal/test/examples/FullFramework2MBA/FullFramework2BAFactory.cs b/src/ext/Bal/test/examples/FullFramework2MBA/FullFramework2BAFactory.cs
new file mode 100644
index 00000000..647c2040
--- /dev/null
+++ b/src/ext/Bal/test/examples/FullFramework2MBA/FullFramework2BAFactory.cs
@@ -0,0 +1,22 @@
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))]
4namespace 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/WixToolset.Mba.Host.config b/src/ext/Bal/test/examples/FullFramework2MBA/WixToolset.Mba.Host.config
new file mode 100644
index 00000000..be450a4f
--- /dev/null
+++ b/src/ext/Bal/test/examples/FullFramework2MBA/WixToolset.Mba.Host.config
@@ -0,0 +1,20 @@
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="v2.0.50727" />
13 </startup>
14 <wix.bootstrapper>
15
16 <host assemblyName="Example.FullFramework2MBA">
17 <supportedFramework version="v3.5" />
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
new file mode 100644
index 00000000..7b7cbf57
--- /dev/null
+++ b/src/ext/Bal/test/examples/FullFramework4Bundle/Bundle.wxs
@@ -0,0 +1,14 @@
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">
3 <BootstrapperApplication>
4 <Payload SourceFile="Example.FullFramework4MBA\net48\win-x86\Example.FullFramework4MBA.dll" />
5 <Payload SourceFile="Example.FullFramework4MBA\net48\win-x86\mbanative.dll" />
6 <Payload SourceFile="Example.FullFramework4MBA\net48\win-x86\WixToolset.Mba.Core.dll" />
7 <Payload SourceFile="Example.FullFramework4MBA\net48\win-x86\WixToolset.Mba.Host.config" />
8 <bal:WixManagedBootstrapperApplicationHost />
9 </BootstrapperApplication>
10 <Chain>
11 <ExePackage DetectCondition="none" SourceFile="c:\windows\system32\kernel32.dll" bal:PrereqPackage="yes" />
12 </Chain>
13 </Bundle>
14</Wix>
diff --git a/src/ext/Bal/test/examples/FullFramework4Bundle/FullFramework4Bundle.wixproj b/src/ext/Bal/test/examples/FullFramework4Bundle/FullFramework4Bundle.wixproj
new file mode 100644
index 00000000..ba75a9ff
--- /dev/null
+++ b/src/ext/Bal/test/examples/FullFramework4Bundle/FullFramework4Bundle.wixproj
@@ -0,0 +1,2 @@
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" />
diff --git a/src/ext/Bal/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj b/src/ext/Bal/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj
new file mode 100644
index 00000000..a05e7888
--- /dev/null
+++ b/src/ext/Bal/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj
@@ -0,0 +1,19 @@
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>net48</TargetFramework>
7 <Description>Full Framework v4 MBA</Description>
8 <RuntimeIdentifier>win-x86</RuntimeIdentifier>
9 </PropertyGroup>
10
11 <ItemGroup>
12 <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="all" />
13 <PackageReference Include="WixToolset.Mba.Core" Version="4.0.*" PrivateAssets="All" />
14 </ItemGroup>
15
16 <ItemGroup>
17 <Content Include="WixToolset.Mba.Host.config" CopyToOutputDirectory="PreserveNewest" />
18 </ItemGroup>
19</Project> \ No newline at end of file
diff --git a/src/ext/Bal/test/examples/FullFramework4MBA/FullFramework4BA.cs b/src/ext/Bal/test/examples/FullFramework4MBA/FullFramework4BA.cs
new file mode 100644
index 00000000..8ee3bd19
--- /dev/null
+++ b/src/ext/Bal/test/examples/FullFramework4MBA/FullFramework4BA.cs
@@ -0,0 +1,34 @@
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
3namespace Example.FullFramework4MBA
4{
5 using WixToolset.Mba.Core;
6
7 public class FullFramework4BA : BootstrapperApplication
8 {
9 public FullFramework4BA(IEngine engine)
10 : base(engine)
11 {
12
13 }
14
15 protected override void Run()
16 {
17 }
18
19 protected override void OnStartup(StartupEventArgs args)
20 {
21 base.OnStartup(args);
22
23 this.engine.Log(LogLevel.Standard, nameof(FullFramework4BA));
24 }
25
26 protected override void OnShutdown(ShutdownEventArgs args)
27 {
28 base.OnShutdown(args);
29
30 var message = "Shutdown," + args.Action.ToString() + "," + args.HResult.ToString();
31 this.engine.Log(LogLevel.Standard, message);
32 }
33 }
34}
diff --git a/src/ext/Bal/test/examples/FullFramework4MBA/FullFramework4BAFactory.cs b/src/ext/Bal/test/examples/FullFramework4MBA/FullFramework4BAFactory.cs
new file mode 100644
index 00000000..6a571a54
--- /dev/null
+++ b/src/ext/Bal/test/examples/FullFramework4MBA/FullFramework4BAFactory.cs
@@ -0,0 +1,22 @@
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))]
4namespace 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/WixToolset.Mba.Host.config b/src/ext/Bal/test/examples/FullFramework4MBA/WixToolset.Mba.Host.config
new file mode 100644
index 00000000..96678cda
--- /dev/null
+++ b/src/ext/Bal/test/examples/FullFramework4MBA/WixToolset.Mba.Host.config
@@ -0,0 +1,17 @@
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.8" />
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
new file mode 100644
index 00000000..d5b543e8
--- /dev/null
+++ b/src/ext/Bal/test/examples/LatestCoreBundleFDD/FrameworkDependentBundle.wxs
@@ -0,0 +1,16 @@
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">
3 <BootstrapperApplication>
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" />
6 <Payload SourceFile="publish\Example.LatestCoreMBA\fdd\Example.LatestCoreMBA.pdb" Name="Example.LatestCoreMBA.pdb" />
7 <Payload SourceFile="publish\Example.LatestCoreMBA\fdd\Example.LatestCoreMBA.runtimeconfig.json" Name="Example.LatestCoreMBA.runtimeconfig.json" />
8 <Payload SourceFile="publish\Example.LatestCoreMBA\fdd\mbanative.dll" Name="mbanative.dll" />
9 <Payload SourceFile="publish\Example.LatestCoreMBA\fdd\WixToolset.Mba.Core.dll" Name="WixToolset.Mba.Core.dll" />
10 <bal:WixDotNetCoreBootstrapperApplicationHost />
11 </BootstrapperApplication>
12 <Chain>
13 <ExePackage DetectCondition="none" SourceFile="c:\windows\system32\kernel32.dll" bal:PrereqPackage="yes" />
14 </Chain>
15 </Bundle>
16</Wix>
diff --git a/src/ext/Bal/test/examples/LatestCoreBundleFDD/LatestCoreBundleFDD.wixproj b/src/ext/Bal/test/examples/LatestCoreBundleFDD/LatestCoreBundleFDD.wixproj
new file mode 100644
index 00000000..ba75a9ff
--- /dev/null
+++ b/src/ext/Bal/test/examples/LatestCoreBundleFDD/LatestCoreBundleFDD.wixproj
@@ -0,0 +1,2 @@
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" />
diff --git a/src/ext/Bal/test/examples/LatestCoreBundleSCD/LatestCoreBundleSCD.wixproj b/src/ext/Bal/test/examples/LatestCoreBundleSCD/LatestCoreBundleSCD.wixproj
new file mode 100644
index 00000000..30a860ab
--- /dev/null
+++ b/src/ext/Bal/test/examples/LatestCoreBundleSCD/LatestCoreBundleSCD.wixproj
@@ -0,0 +1,10 @@
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">
3 <ItemGroup>
4 <BindInputPaths Include="$(OutputPath)publish\Example.LatestCoreMBA\scd" />
5 <HarvestDirectory Include="$(OutputPath)publish\Example.LatestCoreMBA\scd">
6 <DirectoryRefId>publish.Example.LatestCoreMBA.scd</DirectoryRefId>
7 <Transforms>ba.xslt</Transforms>
8 </HarvestDirectory>
9 </ItemGroup>
10</Project>
diff --git a/src/ext/Bal/test/examples/LatestCoreBundleSCD/SelfContainedBundle.wxs b/src/ext/Bal/test/examples/LatestCoreBundleSCD/SelfContainedBundle.wxs
new file mode 100644
index 00000000..bedf0326
--- /dev/null
+++ b/src/ext/Bal/test/examples/LatestCoreBundleSCD/SelfContainedBundle.wxs
@@ -0,0 +1,11 @@
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">
3 <BootstrapperApplication>
4 <bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment="yes" />
5 <PayloadGroupRef Id="publish.Example.LatestCoreMBA.scd" />
6 </BootstrapperApplication>
7 <Chain>
8 <ExePackage DetectCondition="none" SourceFile="c:\windows\system32\kernel32.dll" PerMachine="yes" />
9 </Chain>
10 </Bundle>
11</Wix>
diff --git a/src/ext/Bal/test/examples/LatestCoreBundleSCD/ba.xslt b/src/ext/Bal/test/examples/LatestCoreBundleSCD/ba.xslt
new file mode 100644
index 00000000..acc7474c
--- /dev/null
+++ b/src/ext/Bal/test/examples/LatestCoreBundleSCD/ba.xslt
@@ -0,0 +1,20 @@
1<?xml version="1.0" encoding="utf-8"?>
2<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
4 xmlns:wix="http://wixtoolset.org/schemas/v4/wxs"
5>
6 <xsl:output method="xml" indent="yes"/>
7
8 <xsl:template match="@* | node()">
9 <xsl:copy>
10 <xsl:apply-templates select="@* | node()"/>
11 </xsl:copy>
12 </xsl:template>
13
14 <xsl:template match="wix:Payload[@SourceFile='SourceDir\Example.LatestCoreMBA.dll']" >
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>
diff --git a/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/LatestCoreBundleTrimmedSCD.wixproj b/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/LatestCoreBundleTrimmedSCD.wixproj
new file mode 100644
index 00000000..5ce89b64
--- /dev/null
+++ b/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/LatestCoreBundleTrimmedSCD.wixproj
@@ -0,0 +1,10 @@
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">
3 <ItemGroup>
4 <BindInputPaths Include="$(OutputPath)publish\Example.LatestCoreMBA\trimmedscd" />
5 <HarvestDirectory Include="$(OutputPath)publish\Example.LatestCoreMBA\trimmedscd">
6 <DirectoryRefId>publish.Example.LatestCoreMBA.trimmedscd</DirectoryRefId>
7 <Transforms>ba.xslt</Transforms>
8 </HarvestDirectory>
9 </ItemGroup>
10</Project>
diff --git a/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs b/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs
new file mode 100644
index 00000000..6059f8c1
--- /dev/null
+++ b/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/TrimmedSelfContainedBundle.wxs
@@ -0,0 +1,11 @@
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">
3 <BootstrapperApplication>
4 <bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment="yes" />
5 <PayloadGroupRef Id="publish.Example.LatestCoreMBA.trimmedscd" />
6 </BootstrapperApplication>
7 <Chain>
8 <ExePackage DetectCondition="none" SourceFile="c:\windows\system32\kernel32.dll" PerMachine="yes" />
9 </Chain>
10 </Bundle>
11</Wix>
diff --git a/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/ba.xslt b/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/ba.xslt
new file mode 100644
index 00000000..acc7474c
--- /dev/null
+++ b/src/ext/Bal/test/examples/LatestCoreBundleTrimmedSCD/ba.xslt
@@ -0,0 +1,20 @@
1<?xml version="1.0" encoding="utf-8"?>
2<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
4 xmlns:wix="http://wixtoolset.org/schemas/v4/wxs"
5>
6 <xsl:output method="xml" indent="yes"/>
7
8 <xsl:template match="@* | node()">
9 <xsl:copy>
10 <xsl:apply-templates select="@* | node()"/>
11 </xsl:copy>
12 </xsl:template>
13
14 <xsl:template match="wix:Payload[@SourceFile='SourceDir\Example.LatestCoreMBA.dll']" >
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>
diff --git a/src/ext/Bal/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj b/src/ext/Bal/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj
new file mode 100644
index 00000000..9f3f02d9
--- /dev/null
+++ b/src/ext/Bal/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj
@@ -0,0 +1,21 @@
1<Project Sdk="Microsoft.NET.Sdk">
2
3 <PropertyGroup>
4 <TargetFramework>net5.0</TargetFramework>
5 <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
6 <EnableDynamicLoading>true</EnableDynamicLoading>
7 <Description>Latest .NET Core MBA</Description>
8 </PropertyGroup>
9
10 <ItemGroup>
11 <TrimmerRootAssembly Include="System.Diagnostics.Tools" />
12 <TrimmerRootAssembly Include="System.Runtime" />
13 <TrimmerRootAssembly Include="System.Runtime.InteropServices" />
14 <TrimmerRootAssembly Include="System.Runtime.Loader" />
15 </ItemGroup>
16
17 <ItemGroup>
18 <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="all" />
19 <PackageReference Include="WixToolset.Mba.Core" Version="4.0.*" />
20 </ItemGroup>
21</Project> \ No newline at end of file
diff --git a/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBA.cs b/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBA.cs
new file mode 100644
index 00000000..50386a87
--- /dev/null
+++ b/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBA.cs
@@ -0,0 +1,33 @@
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
3namespace Example.LatestCoreMBA
4{
5 using WixToolset.Mba.Core;
6
7 public class LatestCoreBA : BootstrapperApplication
8 {
9 public LatestCoreBA(IEngine engine)
10 : base(engine)
11 {
12 }
13
14 protected override void Run()
15 {
16 }
17
18 protected override void OnStartup(StartupEventArgs args)
19 {
20 base.OnStartup(args);
21
22 this.engine.Log(LogLevel.Standard, nameof(LatestCoreBA));
23 }
24
25 protected override void OnShutdown(ShutdownEventArgs args)
26 {
27 base.OnShutdown(args);
28
29 var message = "Shutdown," + args.Action.ToString() + "," + args.HResult.ToString();
30 this.engine.Log(LogLevel.Standard, message);
31 }
32 }
33}
diff --git a/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs b/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs
new file mode 100644
index 00000000..fff3b5c5
--- /dev/null
+++ b/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs
@@ -0,0 +1,22 @@
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))]
4namespace 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/TestEngine/Example.TestEngine.vcxproj b/src/ext/Bal/test/examples/TestEngine/Example.TestEngine.vcxproj
new file mode 100644
index 00000000..99eb917e
--- /dev/null
+++ b/src/ext/Bal/test/examples/TestEngine/Example.TestEngine.vcxproj
@@ -0,0 +1,83 @@
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 DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
4 <Import Project="..\..\..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props" Condition="Exists('..\..\..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props')" />
5 <Import Project="..\..\..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props')" />
6 <Import Project="..\..\..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props" Condition="Exists('..\..\..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props')" />
7 <ItemGroup Label="ProjectConfigurations">
8 <ProjectConfiguration Include="Debug|ARM64">
9 <Configuration>Debug</Configuration>
10 <Platform>ARM64</Platform>
11 </ProjectConfiguration>
12 <ProjectConfiguration Include="Release|ARM64">
13 <Configuration>Release</Configuration>
14 <Platform>ARM64</Platform>
15 </ProjectConfiguration>
16 <ProjectConfiguration Include="Debug|Win32">
17 <Configuration>Debug</Configuration>
18 <Platform>Win32</Platform>
19 </ProjectConfiguration>
20 <ProjectConfiguration Include="Release|Win32">
21 <Configuration>Release</Configuration>
22 <Platform>Win32</Platform>
23 </ProjectConfiguration>
24 <ProjectConfiguration Include="Debug|x64">
25 <Configuration>Debug</Configuration>
26 <Platform>x64</Platform>
27 </ProjectConfiguration>
28 <ProjectConfiguration Include="Release|x64">
29 <Configuration>Release</Configuration>
30 <Platform>x64</Platform>
31 </ProjectConfiguration>
32 </ItemGroup>
33 <PropertyGroup Label="Globals">
34 <ProjectGuid>{3D44B67D-A475-49BA-8310-E39F6C117CC9}</ProjectGuid>
35 <ConfigurationType>Application</ConfigurationType>
36 <ProjectSubSystem>Console</ProjectSubSystem>
37 <TargetName>Example.TestEngine</TargetName>
38 <PlatformToolset>v142</PlatformToolset>
39 <CharacterSet>Unicode</CharacterSet>
40 <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
41 </PropertyGroup>
42 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
43 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
44 <ImportGroup Label="ExtensionSettings">
45 </ImportGroup>
46 <ImportGroup Label="Shared">
47 <Import Project="..\..\..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets')" />
48 </ImportGroup>
49 <PropertyGroup>
50 <ProjectAdditionalLinkLibraries>
51 </ProjectAdditionalLinkLibraries>
52 </PropertyGroup>
53 <ItemGroup>
54 <ClCompile Include="precomp.cpp">
55 <PrecompiledHeader>Create</PrecompiledHeader>
56 </ClCompile>
57 <ClCompile Include="ReloadEngine.cpp" />
58 <ClCompile Include="ShutdownEngine.cpp" />
59 <ClCompile Include="ExampleTestEngine.cpp" />
60 <ClCompile Include="TestEngine.cpp" />
61 <ClCompile Include="WaitForQuitEngine.cpp" />
62 </ItemGroup>
63 <ItemGroup>
64 <ClInclude Include="precomp.h" />
65 <ClInclude Include="ReloadEngine.h" />
66 <ClInclude Include="ShutdownEngine.h" />
67 <ClInclude Include="TestEngine.h" />
68 <ClInclude Include="WaitForQuitEngine.h" />
69 </ItemGroup>
70 <ItemGroup>
71 <None Include="packages.config" />
72 </ItemGroup>
73 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
74 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
75 <PropertyGroup>
76 <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
77 </PropertyGroup>
78 <Error Condition="!Exists('..\..\..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets'))" />
79 <Error Condition="!Exists('..\..\..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props'))" />
80 <Error Condition="!Exists('..\..\..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props'))" />
81 <Error Condition="!Exists('..\..\..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props'))" />
82 </Target>
83</Project> \ No newline at end of file
diff --git a/src/ext/Bal/test/examples/TestEngine/ExampleTestEngine.cpp b/src/ext/Bal/test/examples/TestEngine/ExampleTestEngine.cpp
new file mode 100644
index 00000000..fc1938fe
--- /dev/null
+++ b/src/ext/Bal/test/examples/TestEngine/ExampleTestEngine.cpp
@@ -0,0 +1,53 @@
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#include "precomp.h"
4
5int __cdecl wmain(int argc, LPWSTR argv[])
6{
7 HRESULT hr = S_OK;
8 BOOL fComInitialized = FALSE;
9 BOOL fShowUsage = FALSE;
10
11 // initialize COM
12 hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
13 ExitOnFailure(hr, "Failed to initialize COM.");
14 fComInitialized = TRUE;
15
16 ConsoleInitialize();
17
18 if (argc != 4)
19 {
20 fShowUsage = TRUE;
21 }
22 else if (CSTR_EQUAL == ::CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, argv[1], -1, L"reload", -1))
23 {
24 hr = RunReloadEngine(argv[2], argv[3]);
25 }
26 else if (CSTR_EQUAL == ::CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, argv[1], -1, L"shutdown", -1))
27 {
28 hr = RunShutdownEngine(argv[2], argv[3]);
29 }
30 else if (CSTR_EQUAL == ::CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, argv[1], -1, L"waitforquit", -1))
31 {
32 hr = RunWaitForQuitEngine(argv[2], argv[3]);
33 }
34 else
35 {
36 fShowUsage = TRUE;
37 }
38
39 if (fShowUsage)
40 {
41 ConsoleWriteError(hr = E_INVALIDARG, CONSOLE_COLOR_RED, "Usage: Example.TestEngine.exe {reload|shutdown|waitforquit} Bundle.exe BA.dll");
42 }
43
44 ConsoleUninitialize();
45
46LExit:
47 if (fComInitialized)
48 {
49 ::CoUninitialize();
50 }
51
52 return hr;
53}
diff --git a/src/ext/Bal/test/examples/TestEngine/ReloadEngine.cpp b/src/ext/Bal/test/examples/TestEngine/ReloadEngine.cpp
new file mode 100644
index 00000000..46fd9afa
--- /dev/null
+++ b/src/ext/Bal/test/examples/TestEngine/ReloadEngine.cpp
@@ -0,0 +1,55 @@
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#include "precomp.h"
4
5HRESULT RunReloadEngine(
6 __in LPCWSTR wzBundleFilePath,
7 __in LPCWSTR wzBAFilePath
8 )
9{
10 HRESULT hr = S_OK;
11 TestEngine* pTestEngine = NULL;
12
13 pTestEngine = new TestEngine();
14 ConsoleExitOnNull(pTestEngine, hr, E_OUTOFMEMORY, CONSOLE_COLOR_RED, "Failed to create new test engine.");
15
16 hr = pTestEngine->Initialize(wzBundleFilePath);
17 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to initialize engine.");
18
19 hr = pTestEngine->LoadBA(wzBAFilePath);
20 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to load BA.");
21
22 hr = pTestEngine->SendStartupEvent();
23 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnStartup.");
24
25 hr = pTestEngine->SimulateQuit(0);
26 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to simulate quit.");
27
28 hr = pTestEngine->RunApplication();
29 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to run engine.");
30
31 hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RELOAD_BOOTSTRAPPER);
32 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown.");
33
34 pTestEngine->UnloadBA();
35
36 hr = pTestEngine->LoadBA(wzBAFilePath);
37 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to load BA.");
38
39 hr = pTestEngine->SendStartupEvent();
40 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnStartup.");
41
42 hr = pTestEngine->SimulateQuit(0);
43 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to simulate quit.");
44
45 hr = pTestEngine->RunApplication();
46 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to run engine.");
47
48 hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RESTART);
49 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown.");
50
51 pTestEngine->UnloadBA();
52
53LExit:
54 return hr;
55}
diff --git a/src/ext/Bal/test/examples/TestEngine/ReloadEngine.h b/src/ext/Bal/test/examples/TestEngine/ReloadEngine.h
new file mode 100644
index 00000000..0e8456af
--- /dev/null
+++ b/src/ext/Bal/test/examples/TestEngine/ReloadEngine.h
@@ -0,0 +1,8 @@
1#pragma once
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
5HRESULT RunReloadEngine(
6 __in LPCWSTR wzBundleFilePath,
7 __in LPCWSTR wzBAFilePath
8 );
diff --git a/src/ext/Bal/test/examples/TestEngine/ShutdownEngine.cpp b/src/ext/Bal/test/examples/TestEngine/ShutdownEngine.cpp
new file mode 100644
index 00000000..3b876e4e
--- /dev/null
+++ b/src/ext/Bal/test/examples/TestEngine/ShutdownEngine.cpp
@@ -0,0 +1,38 @@
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#include "precomp.h"
4
5HRESULT RunShutdownEngine(
6 __in LPCWSTR wzBundleFilePath,
7 __in LPCWSTR wzBAFilePath
8 )
9{
10 HRESULT hr = S_OK;
11 TestEngine* pTestEngine = NULL;
12
13 pTestEngine = new TestEngine();
14 ConsoleExitOnNull(pTestEngine, hr, E_OUTOFMEMORY, CONSOLE_COLOR_RED, "Failed to create new test engine.");
15
16 hr = pTestEngine->Initialize(wzBundleFilePath);
17 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to initialize engine.");
18
19 hr = pTestEngine->LoadBA(wzBAFilePath);
20 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to load BA.");
21
22 hr = pTestEngine->SendStartupEvent();
23 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnStartup.");
24
25 hr = pTestEngine->SimulateQuit(0);
26 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to simulate quit.");
27
28 hr = pTestEngine->RunApplication();
29 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to run engine.");
30
31 hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RELOAD_BOOTSTRAPPER);
32 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown.");
33
34 pTestEngine->UnloadBA();
35
36LExit:
37 return hr;
38}
diff --git a/src/ext/Bal/test/examples/TestEngine/ShutdownEngine.h b/src/ext/Bal/test/examples/TestEngine/ShutdownEngine.h
new file mode 100644
index 00000000..0cfa147a
--- /dev/null
+++ b/src/ext/Bal/test/examples/TestEngine/ShutdownEngine.h
@@ -0,0 +1,8 @@
1#pragma once
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
5HRESULT RunShutdownEngine(
6 __in LPCWSTR wzBundleFilePath,
7 __in LPCWSTR wzBAFilePath
8 );
diff --git a/src/ext/Bal/test/examples/TestEngine/TestEngine.cpp b/src/ext/Bal/test/examples/TestEngine/TestEngine.cpp
new file mode 100644
index 00000000..4c7ec1c3
--- /dev/null
+++ b/src/ext/Bal/test/examples/TestEngine/TestEngine.cpp
@@ -0,0 +1,256 @@
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#include "precomp.h"
4
5HRESULT TestEngine::Initialize(
6 __in LPCWSTR wzBundleFilePath
7 )
8{
9 HRESULT hr = S_OK;
10 MSG msg = { };
11
12 LogInitialize(::GetModuleHandleW(NULL));
13
14 hr = LogOpen(NULL, PathFile(wzBundleFilePath), NULL, L"txt", FALSE, FALSE, NULL);
15 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to open log.");
16
17 ::PeekMessageW(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE);
18
19LExit:
20 return hr;
21}
22
23HRESULT TestEngine::LoadBA(
24 __in LPCWSTR wzBAFilePath
25 )
26{
27 HRESULT hr = S_OK;
28 BOOTSTRAPPER_COMMAND command = { };
29 BOOTSTRAPPER_CREATE_ARGS args = { };
30 PFN_BOOTSTRAPPER_APPLICATION_CREATE pfnCreate = NULL;
31
32 if (m_pCreateResults || m_hBAModule)
33 {
34 ExitFunction1(hr = E_INVALIDSTATE);
35 }
36
37 m_pCreateResults = static_cast<BOOTSTRAPPER_CREATE_RESULTS*>(MemAlloc(sizeof(BOOTSTRAPPER_CREATE_RESULTS), TRUE));
38
39 command.cbSize = sizeof(BOOTSTRAPPER_COMMAND);
40
41 hr = PathGetDirectory(wzBAFilePath, &command.wzBootstrapperWorkingFolder);
42 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to allocate wzBootstrapperWorkingFolder");
43
44 hr = PathConcat(command.wzBootstrapperWorkingFolder, L"BootstrapperApplicationData.xml", &command.wzBootstrapperApplicationDataPath);
45 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to allocate wzBootstrapperApplicationDataPath");
46
47 args.cbSize = sizeof(BOOTSTRAPPER_CREATE_ARGS);
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);
56 ConsoleExitOnNullWithLastError(m_hBAModule, hr, CONSOLE_COLOR_RED, "Failed to load BA dll.");
57
58 pfnCreate = (PFN_BOOTSTRAPPER_APPLICATION_CREATE)::GetProcAddress(m_hBAModule, "BootstrapperApplicationCreate");
59 ConsoleExitOnNull(pfnCreate, hr, E_OUTOFMEMORY, CONSOLE_COLOR_RED, "Failed to get address for BootstrapperApplicationCreate.");
60
61 hr = pfnCreate(&args, m_pCreateResults);
62 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure on BootstrapperApplicationCreate.");
63
64LExit:
65 ReleaseStr(command.wzBootstrapperApplicationDataPath);
66 ReleaseStr(command.wzBootstrapperWorkingFolder);
67
68 return hr;
69}
70
71HRESULT TestEngine::Log(
72 __in BOOTSTRAPPER_LOG_LEVEL level,
73 __in LPCWSTR wzMessage
74 )
75{
76 switch (level)
77 {
78 case BOOTSTRAPPER_LOG_LEVEL_NONE:
79 case BOOTSTRAPPER_LOG_LEVEL_DEBUG:
80 return S_OK;
81 default:
82 LogStringLine(REPORT_STANDARD, "%ls", wzMessage);
83 return ConsoleWriteLine(CONSOLE_COLOR_NORMAL, "%ls", wzMessage);
84 }
85}
86
87HRESULT TestEngine::RunApplication()
88{
89 HRESULT hr = S_OK;
90 MSG msg = { };
91 BOOL fRet = FALSE;
92
93 // Enter the message pump.
94 while (0 != (fRet = ::GetMessageW(&msg, NULL, 0, 0)))
95 {
96 if (-1 == fRet)
97 {
98 ConsoleExitOnFailure(hr = E_UNEXPECTED, CONSOLE_COLOR_RED, "Unexpected return value from message pump.");
99 }
100 else
101 {
102 ProcessBAMessage(&msg);
103 }
104 }
105
106LExit:
107 return hr;
108}
109
110HRESULT TestEngine::SendShutdownEvent(
111 __in BOOTSTRAPPER_SHUTDOWN_ACTION defaultAction
112 )
113{
114 HRESULT hr = S_OK;
115 BA_ONSHUTDOWN_ARGS shutdownArgs = { };
116 BA_ONSHUTDOWN_RESULTS shutdownResults = { };
117 shutdownArgs.cbSize = sizeof(BA_ONSHUTDOWN_ARGS);
118 shutdownResults.action = defaultAction;
119 shutdownResults.cbSize = sizeof(BA_ONSHUTDOWN_RESULTS);
120 hr = m_pCreateResults->pfnBootstrapperApplicationProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONSHUTDOWN, &shutdownArgs, &shutdownResults, m_pCreateResults->pvBootstrapperApplicationProcContext);
121 return hr;
122}
123
124HRESULT TestEngine::SendStartupEvent()
125{
126 HRESULT hr = S_OK;
127 BA_ONSTARTUP_ARGS startupArgs = { };
128 BA_ONSTARTUP_RESULTS startupResults = { };
129 startupArgs.cbSize = sizeof(BA_ONSTARTUP_ARGS);
130 startupResults.cbSize = sizeof(BA_ONSTARTUP_RESULTS);
131 hr = m_pCreateResults->pfnBootstrapperApplicationProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONSTARTUP, &startupArgs, &startupResults, m_pCreateResults->pvBootstrapperApplicationProcContext);
132 return hr;
133}
134
135HRESULT TestEngine::SimulateQuit(
136 __in DWORD dwExitCode
137 )
138{
139 BAENGINE_QUIT_ARGS args = { };
140 BAENGINE_QUIT_RESULTS results = { };
141
142 args.cbSize = sizeof(BAENGINE_QUIT_ARGS);
143 args.dwExitCode = dwExitCode;
144
145 results.cbSize = sizeof(BAENGINE_QUIT_RESULTS);
146
147 return BAEngineQuit(&args, &results);
148}
149
150void TestEngine::UnloadBA()
151{
152 PFN_BOOTSTRAPPER_APPLICATION_DESTROY pfnDestroy = NULL;
153 BOOL fDisableUnloading = m_pCreateResults && m_pCreateResults->fDisableUnloading;
154
155 ReleaseNullMem(m_pCreateResults);
156
157 pfnDestroy = (PFN_BOOTSTRAPPER_APPLICATION_DESTROY)::GetProcAddress(m_hBAModule, "BootstrapperApplicationDestroy");
158
159 if (pfnDestroy)
160 {
161 pfnDestroy();
162 }
163
164 if (m_hBAModule)
165 {
166 if (!fDisableUnloading)
167 {
168 ::FreeLibrary(m_hBAModule);
169 }
170
171 m_hBAModule = NULL;
172 }
173}
174
175HRESULT TestEngine::BAEngineLog(
176 __in BAENGINE_LOG_ARGS* pArgs,
177 __in BAENGINE_LOG_RESULTS* /*pResults*/
178 )
179{
180 return Log(pArgs->level, pArgs->wzMessage);
181}
182
183HRESULT TestEngine::BAEngineQuit(
184 __in BAENGINE_QUIT_ARGS* pArgs,
185 __in BAENGINE_QUIT_RESULTS* /*pResults*/
186 )
187{
188 HRESULT hr = S_OK;
189
190 if (!::PostThreadMessageW(m_dwThreadId, WM_TESTENG_QUIT, static_cast<WPARAM>(pArgs->dwExitCode), 0))
191 {
192 ConsoleExitWithLastError(hr, CONSOLE_COLOR_RED, "Failed to post shutdown message.");
193 }
194
195LExit:
196 return hr;
197}
198
199HRESULT WINAPI TestEngine::EngineProc(
200 __in BOOTSTRAPPER_ENGINE_MESSAGE message,
201 __in const LPVOID pvArgs,
202 __inout LPVOID pvResults,
203 __in_opt LPVOID pvContext
204 )
205{
206 HRESULT hr = S_OK;
207 TestEngine* pContext = (TestEngine*)pvContext;
208
209 if (!pContext || !pvArgs || !pvResults)
210 {
211 ExitFunction1(hr = E_INVALIDARG);
212 }
213
214 switch (message)
215 {
216 case BOOTSTRAPPER_ENGINE_MESSAGE_LOG:
217 hr = pContext->BAEngineLog(reinterpret_cast<BAENGINE_LOG_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_LOG_RESULTS*>(pvResults));
218 break;
219 case BOOTSTRAPPER_ENGINE_MESSAGE_QUIT:
220 hr = pContext->BAEngineQuit(reinterpret_cast<BAENGINE_QUIT_ARGS*>(pvArgs), reinterpret_cast<BAENGINE_QUIT_RESULTS*>(pvResults));
221 default:
222 hr = E_NOTIMPL;
223 break;
224 }
225
226LExit:
227 return hr;
228}
229
230HRESULT TestEngine::ProcessBAMessage(
231 __in const MSG* pmsg
232 )
233{
234 HRESULT hr = S_OK;
235
236 switch (pmsg->message)
237 {
238 case WM_TESTENG_QUIT:
239 ::PostQuitMessage(static_cast<int>(pmsg->wParam)); // go bye-bye.
240 break;
241 }
242
243 return hr;
244}
245
246TestEngine::TestEngine()
247{
248 m_hBAModule = NULL;
249 m_pCreateResults = NULL;
250 m_dwThreadId = ::GetCurrentThreadId();
251}
252
253TestEngine::~TestEngine()
254{
255 ReleaseMem(m_pCreateResults);
256}
diff --git a/src/ext/Bal/test/examples/TestEngine/TestEngine.h b/src/ext/Bal/test/examples/TestEngine/TestEngine.h
new file mode 100644
index 00000000..44e813bd
--- /dev/null
+++ b/src/ext/Bal/test/examples/TestEngine/TestEngine.h
@@ -0,0 +1,80 @@
1#pragma once
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
5enum WM_TESTENG
6{
7 WM_TESTENG_FIRST = WM_APP + 0xFFF, // this enum value must always be first.
8
9 WM_TESTENG_DETECT,
10 WM_TESTENG_PLAN,
11 WM_TESTENG_ELEVATE,
12 WM_TESTENG_APPLY,
13 WM_TESTENG_LAUNCH_APPROVED_EXE,
14 WM_TESTENG_QUIT,
15
16 WM_TESTENG_LAST, // this enum value must always be last.
17};
18
19class TestEngine
20{
21public:
22 HRESULT Initialize(
23 __in LPCWSTR wzBundleFilePath
24 );
25
26 HRESULT LoadBA(
27 __in LPCWSTR wzBAFilePath
28 );
29
30 HRESULT Log(
31 __in BOOTSTRAPPER_LOG_LEVEL level,
32 __in LPCWSTR wzMessage
33 );
34
35 HRESULT RunApplication();
36
37 HRESULT SendShutdownEvent(
38 __in BOOTSTRAPPER_SHUTDOWN_ACTION defaultAction
39 );
40
41 HRESULT SendStartupEvent();
42
43 HRESULT SimulateQuit(
44 __in DWORD dwExitCode
45 );
46
47 void UnloadBA();
48
49private:
50 HRESULT BAEngineLog(
51 __in BAENGINE_LOG_ARGS* pArgs,
52 __in BAENGINE_LOG_RESULTS* pResults
53 );
54
55 HRESULT BAEngineQuit(
56 __in BAENGINE_QUIT_ARGS* pArgs,
57 __in BAENGINE_QUIT_RESULTS* pResults
58 );
59
60 static HRESULT WINAPI EngineProc(
61 __in BOOTSTRAPPER_ENGINE_MESSAGE message,
62 __in const LPVOID pvArgs,
63 __inout LPVOID pvResults,
64 __in_opt LPVOID pvContext
65 );
66
67 HRESULT ProcessBAMessage(
68 __in const MSG* pmsg
69 );
70
71public:
72 TestEngine();
73
74 ~TestEngine();
75
76private:
77 HMODULE m_hBAModule;
78 BOOTSTRAPPER_CREATE_RESULTS* m_pCreateResults;
79 DWORD m_dwThreadId;
80}; \ No newline at end of file
diff --git a/src/ext/Bal/test/examples/TestEngine/WaitForQuitEngine.cpp b/src/ext/Bal/test/examples/TestEngine/WaitForQuitEngine.cpp
new file mode 100644
index 00000000..2f80ba75
--- /dev/null
+++ b/src/ext/Bal/test/examples/TestEngine/WaitForQuitEngine.cpp
@@ -0,0 +1,35 @@
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#include "precomp.h"
4
5HRESULT RunWaitForQuitEngine(
6 __in LPCWSTR wzBundleFilePath,
7 __in LPCWSTR wzBAFilePath
8 )
9{
10 HRESULT hr = S_OK;
11 TestEngine* pTestEngine = NULL;
12
13 pTestEngine = new TestEngine();
14 ConsoleExitOnNull(pTestEngine, hr, E_OUTOFMEMORY, CONSOLE_COLOR_RED, "Failed to create new test engine.");
15
16 hr = pTestEngine->Initialize(wzBundleFilePath);
17 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to initialize engine.");
18
19 hr = pTestEngine->LoadBA(wzBAFilePath);
20 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to load BA.");
21
22 hr = pTestEngine->SendStartupEvent();
23 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnStartup.");
24
25 hr = pTestEngine->RunApplication();
26 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "Failed to run engine.");
27
28 hr = pTestEngine->SendShutdownEvent(BOOTSTRAPPER_SHUTDOWN_ACTION_RELOAD_BOOTSTRAPPER);
29 ConsoleExitOnFailure(hr, CONSOLE_COLOR_RED, "BA returned failure for OnShutdown.");
30
31 pTestEngine->UnloadBA();
32
33LExit:
34 return hr;
35}
diff --git a/src/ext/Bal/test/examples/TestEngine/WaitForQuitEngine.h b/src/ext/Bal/test/examples/TestEngine/WaitForQuitEngine.h
new file mode 100644
index 00000000..99e3f63c
--- /dev/null
+++ b/src/ext/Bal/test/examples/TestEngine/WaitForQuitEngine.h
@@ -0,0 +1,8 @@
1#pragma once
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
5HRESULT RunWaitForQuitEngine(
6 __in LPCWSTR wzBundleFilePath,
7 __in LPCWSTR wzBAFilePath
8 );
diff --git a/src/ext/Bal/test/examples/TestEngine/packages.config b/src/ext/Bal/test/examples/TestEngine/packages.config
new file mode 100644
index 00000000..548ddb48
--- /dev/null
+++ b/src/ext/Bal/test/examples/TestEngine/packages.config
@@ -0,0 +1,7 @@
1<?xml version="1.0" encoding="utf-8"?>
2<packages>
3 <package id="Nerdbank.GitVersioning" version="3.3.37" targetFramework="native" developmentDependency="true" />
4 <package id="WixToolset.BootstrapperCore.Native" version="4.0.141" targetFramework="native" />
5 <package id="WixToolset.BalUtil" version="4.0.58" targetFramework="native" />
6 <package id="WixToolset.DUtil" version="4.0.72" targetFramework="native" />
7</packages> \ No newline at end of file
diff --git a/src/ext/Bal/test/examples/TestEngine/precomp.cpp b/src/ext/Bal/test/examples/TestEngine/precomp.cpp
new file mode 100644
index 00000000..37664a1c
--- /dev/null
+++ b/src/ext/Bal/test/examples/TestEngine/precomp.cpp
@@ -0,0 +1,3 @@
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#include "precomp.h"
diff --git a/src/ext/Bal/test/examples/TestEngine/precomp.h b/src/ext/Bal/test/examples/TestEngine/precomp.h
new file mode 100644
index 00000000..f943f420
--- /dev/null
+++ b/src/ext/Bal/test/examples/TestEngine/precomp.h
@@ -0,0 +1,20 @@
1#pragma once
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#include <windows.h>
5#include <MsiQuery.h>
6
7#include "dutil.h"
8#include "conutil.h"
9#include "logutil.h"
10#include "memutil.h"
11#include "pathutil.h"
12#include "strutil.h"
13
14#include "BootstrapperEngine.h"
15#include "BootstrapperApplication.h"
16
17#include "TestEngine.h"
18#include "ReloadEngine.h"
19#include "ShutdownEngine.h"
20#include "WaitForQuitEngine.h"
diff --git a/src/ext/Bal/test/examples/WPFCoreBundleFDD/FrameworkDependentBundle.wxs b/src/ext/Bal/test/examples/WPFCoreBundleFDD/FrameworkDependentBundle.wxs
new file mode 100644
index 00000000..68d742b0
--- /dev/null
+++ b/src/ext/Bal/test/examples/WPFCoreBundleFDD/FrameworkDependentBundle.wxs
@@ -0,0 +1,16 @@
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">
3 <BootstrapperApplication>
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" />
6 <Payload SourceFile="publish\Example.WPFCoreMBA\fdd\Example.WPFCoreMBA.pdb" Name="Example.WPFCoreMBA.pdb" />
7 <Payload SourceFile="publish\Example.WPFCoreMBA\fdd\Example.WPFCoreMBA.runtimeconfig.json" Name="Example.WPFCoreMBA.runtimeconfig.json" />
8 <Payload SourceFile="publish\Example.WPFCoreMBA\fdd\mbanative.dll" Name="mbanative.dll" />
9 <Payload SourceFile="publish\Example.WPFCoreMBA\fdd\WixToolset.Mba.Core.dll" Name="WixToolset.Mba.Core.dll" />
10 <bal:WixDotNetCoreBootstrapperApplicationHost />
11 </BootstrapperApplication>
12 <Chain>
13 <ExePackage DetectCondition="none" SourceFile="c:\windows\system32\kernel32.dll" bal:PrereqPackage="yes" />
14 </Chain>
15 </Bundle>
16</Wix>
diff --git a/src/ext/Bal/test/examples/WPFCoreBundleFDD/WPFCoreBundleFDD.wixproj b/src/ext/Bal/test/examples/WPFCoreBundleFDD/WPFCoreBundleFDD.wixproj
new file mode 100644
index 00000000..ba75a9ff
--- /dev/null
+++ b/src/ext/Bal/test/examples/WPFCoreBundleFDD/WPFCoreBundleFDD.wixproj
@@ -0,0 +1,2 @@
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" />
diff --git a/src/ext/Bal/test/examples/WPFCoreMBA/AssemblyInfo.cs b/src/ext/Bal/test/examples/WPFCoreMBA/AssemblyInfo.cs
new file mode 100644
index 00000000..03a5c7fa
--- /dev/null
+++ b/src/ext/Bal/test/examples/WPFCoreMBA/AssemblyInfo.cs
@@ -0,0 +1,12 @@
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
3using System.Windows;
4
5[assembly:ThemeInfo(
6 ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
7 //(used if a resource is not found in the page,
8 // or application resource dictionaries)
9 ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
10 //(used if a resource is not found in the page,
11 // app, or any theme specific resource dictionaries)
12)]
diff --git a/src/ext/Bal/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj b/src/ext/Bal/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj
new file mode 100644
index 00000000..296e5be9
--- /dev/null
+++ b/src/ext/Bal/test/examples/WPFCoreMBA/Example.WPFCoreMBA.csproj
@@ -0,0 +1,16 @@
1<Project Sdk="Microsoft.NET.Sdk">
2
3 <PropertyGroup>
4 <TargetFramework>net5.0-windows</TargetFramework>
5 <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
6 <EnableDynamicLoading>true</EnableDynamicLoading>
7 <Description>WPF .NET Core MBA</Description>
8 <UseWPF>true</UseWPF>
9 </PropertyGroup>
10
11
12 <ItemGroup>
13 <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="all" />
14 <PackageReference Include="WixToolset.Mba.Core" Version="4.0.*" />
15 </ItemGroup>
16</Project> \ No newline at end of file
diff --git a/src/ext/Bal/test/examples/WPFCoreMBA/MainWindow.xaml b/src/ext/Bal/test/examples/WPFCoreMBA/MainWindow.xaml
new file mode 100644
index 00000000..40a27a06
--- /dev/null
+++ b/src/ext/Bal/test/examples/WPFCoreMBA/MainWindow.xaml
@@ -0,0 +1,16 @@
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<Window x:Class="Example.WPFCoreMBA.MainWindow"
6 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
7 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
8 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
9 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
10 xmlns:local="clr-namespace:Example.WPFCoreMBA"
11 mc:Ignorable="d"
12 Title="MainWindow" Height="450" Width="800">
13 <Grid>
14
15 </Grid>
16</Window>
diff --git a/src/ext/Bal/test/examples/WPFCoreMBA/MainWindow.xaml.cs b/src/ext/Bal/test/examples/WPFCoreMBA/MainWindow.xaml.cs
new file mode 100644
index 00000000..4f61b807
--- /dev/null
+++ b/src/ext/Bal/test/examples/WPFCoreMBA/MainWindow.xaml.cs
@@ -0,0 +1,17 @@
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
3namespace Example.WPFCoreMBA
4{
5 using System.Windows;
6
7 /// <summary>
8 /// Interaction logic for MainWindow.xaml
9 /// </summary>
10 public partial class MainWindow : Window
11 {
12 public MainWindow()
13 {
14 this.InitializeComponent();
15 }
16 }
17}
diff --git a/src/ext/Bal/test/examples/WPFCoreMBA/WPFCoreBA.cs b/src/ext/Bal/test/examples/WPFCoreMBA/WPFCoreBA.cs
new file mode 100644
index 00000000..d50be813
--- /dev/null
+++ b/src/ext/Bal/test/examples/WPFCoreMBA/WPFCoreBA.cs
@@ -0,0 +1,42 @@
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
3namespace Example.WPFCoreMBA
4{
5 using System.Windows.Threading;
6 using WixToolset.Mba.Core;
7
8 public class WPFCoreBA : BootstrapperApplication
9 {
10 public WPFCoreBA(IEngine engine)
11 : base(engine)
12 {
13 }
14
15 public Dispatcher BADispatcher { get; private set; }
16
17 protected override void Run()
18 {
19 this.BADispatcher = Dispatcher.CurrentDispatcher;
20 var window = new MainWindow();
21 window.Closed += (s, e) => this.BADispatcher.InvokeShutdown();
22 //window.Show();
23 //Dispatcher.Run();
24 //this.engine.Quit(0);
25 }
26
27 protected override void OnStartup(StartupEventArgs args)
28 {
29 base.OnStartup(args);
30
31 this.engine.Log(LogLevel.Standard, nameof(WPFCoreBA));
32 }
33
34 protected override void OnShutdown(ShutdownEventArgs args)
35 {
36 base.OnShutdown(args);
37
38 var message = "Shutdown," + args.Action.ToString() + "," + args.HResult.ToString();
39 this.engine.Log(LogLevel.Standard, message);
40 }
41 }
42}
diff --git a/src/ext/Bal/test/examples/WPFCoreMBA/WPFCoreBAFactory.cs b/src/ext/Bal/test/examples/WPFCoreMBA/WPFCoreBAFactory.cs
new file mode 100644
index 00000000..a3ccdf9f
--- /dev/null
+++ b/src/ext/Bal/test/examples/WPFCoreMBA/WPFCoreBAFactory.cs
@@ -0,0 +1,22 @@
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))]
4namespace 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/Wix.Build.props b/src/ext/Bal/test/examples/Wix.Build.props
new file mode 100644
index 00000000..aad94bb6
--- /dev/null
+++ b/src/ext/Bal/test/examples/Wix.Build.props
@@ -0,0 +1,10 @@
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 <PropertyGroup>
5 <OutputType>Bundle</OutputType>
6 <TargetExt>.exe</TargetExt>
7 <HarvestDirectoryAdditionalOptions>-generate payloadgroup</HarvestDirectoryAdditionalOptions>
8 <OutputPath>$(OutputPath)examples\</OutputPath>
9 </PropertyGroup>
10</Project>
diff --git a/src/ext/Bal/test/examples/Wix.Build.targets b/src/ext/Bal/test/examples/Wix.Build.targets
new file mode 100644
index 00000000..7e6fe9f2
--- /dev/null
+++ b/src/ext/Bal/test/examples/Wix.Build.targets
@@ -0,0 +1,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. -->
3<Project>
4 <ItemGroup>
5 <BindInputPaths Include="$(OutputPath)" />
6 <WixExtension Include="$(OutputPath)..\netstandard2.0\WixToolset.Bal.wixext.dll" />
7 </ItemGroup>
8</Project>
diff --git a/src/ext/Bal/test/examples/examples.proj b/src/ext/Bal/test/examples/examples.proj
new file mode 100644
index 00000000..08cb7511
--- /dev/null
+++ b/src/ext/Bal/test/examples/examples.proj
@@ -0,0 +1,50 @@
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<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
6 <Import Project="..\..\Directory.Build.props" />
7
8 <PropertyGroup>
9 <EarliestCoreMBAProjectPath>EarliestCoreMBA\Example.EarliestCoreMBA.csproj</EarliestCoreMBAProjectPath>
10 <FullFramework2MBAProjectPath>FullFramework2MBA\Example.FullFramework2MBA.csproj</FullFramework2MBAProjectPath>
11 <FullFramework4MBAProjectPath>FullFramework4MBA\Example.FullFramework4MBA.csproj</FullFramework4MBAProjectPath>
12 <LatestCoreMBAProjectPath>LatestCoreMBA\Example.LatestCoreMBA.csproj</LatestCoreMBAProjectPath>
13 <WPFCoreMBAProjectPath>WPFCoreMBA\Example.WPFCoreMBA.csproj</WPFCoreMBAProjectPath>
14 <MBAPublishPath>$(OutputPath)examples\publish\</MBAPublishPath>
15 </PropertyGroup>
16
17 <ItemGroup>
18 <CoreMBAProject Include="$(EarliestCoreMBAProjectPath)">
19 <PublishPath>$(MBAPublishPath)Example.EarliestCoreMBA</PublishPath>
20 </CoreMBAProject>
21 <CoreMBAProject Include="$(LatestCoreMBAProjectPath)">
22 <PublishPath>$(MBAPublishPath)Example.LatestCoreMBA</PublishPath>
23 </CoreMBAProject>
24 <CoreMBAProject Include="$(WPFCoreMBAProjectPath)">
25 <PublishPath>$(MBAPublishPath)Example.WPFCoreMBA</PublishPath>
26 <SkipSCD>true</SkipSCD>
27 <SkipTrimmedSCD>true</SkipTrimmedSCD>
28 </CoreMBAProject>
29
30 <FullMBAProject Include="$(FullFramework2MBAProjectPath)" />
31 <FullMBAProject Include="$(FullFramework4MBAProjectPath)" />
32
33 <ExampleBundleProject Include="**\*.wixproj" />
34 </ItemGroup>
35
36 <Target Name="PublishCoreExamples">
37 <Exec Command='dotnet publish -o "%(CoreMBAProject.PublishPath)\fdd" -r win-x86 -c $(Configuration) --self-contained false "%(CoreMBAProject.Identity)"'
38 Condition="'%(CoreMBAProject.SkipFDD)'==''" />
39 <Exec Command='dotnet publish -o "%(CoreMBAProject.PublishPath)\scd" -r win-x86 -c $(Configuration) --self-contained true "%(CoreMBAProject.Identity)"'
40 Condition="'%(CoreMBAProject.SkipSCD)'==''" />
41 <Exec Command='dotnet publish -o "%(CoreMBAProject.PublishPath)\trimmedscd" -r win-x86 -c $(Configuration) --self-contained true -p:PublishTrimmed=true "%(CoreMBAProject.Identity)"'
42 Condition="'%(CoreMBAProject.SkipTrimmedSCD)'==''" />
43 </Target>
44
45 <Target Name="Build" DependsOnTargets="PublishCoreExamples">
46 <MSBuild Projects="%(ExampleBundleProject.Identity)" />
47 </Target>
48
49 <Import Project="..\..\Directory.Build.targets" />
50</Project> \ No newline at end of file
diff --git a/src/ext/Bal/wix.snk b/src/ext/Bal/wix.snk
new file mode 100644
index 00000000..3908a66a
--- /dev/null
+++ b/src/ext/Bal/wix.snk
Binary files differ
diff --git a/src/ext/Bal/wixext/BalBurnBackendExtension.cs b/src/ext/Bal/wixext/BalBurnBackendExtension.cs
new file mode 100644
index 00000000..e8dc7a3e
--- /dev/null
+++ b/src/ext/Bal/wixext/BalBurnBackendExtension.cs
@@ -0,0 +1,171 @@
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
3namespace WixToolset.Bal
4{
5 using System;
6 using System.Collections.Generic;
7 using System.Linq;
8 using WixToolset.Bal.Symbols;
9 using WixToolset.Data;
10 using WixToolset.Data.Burn;
11 using WixToolset.Data.Symbols;
12 using WixToolset.Extensibility;
13
14 public class BalBurnBackendExtension : BaseBurnBackendBinderExtension
15 {
16 private static readonly IntermediateSymbolDefinition[] BurnSymbolDefinitions =
17 {
18 BalSymbolDefinitions.WixBalBAFactoryAssembly,
19 BalSymbolDefinitions.WixBalBAFunctions,
20 BalSymbolDefinitions.WixBalCondition,
21 BalSymbolDefinitions.WixBalPackageInfo,
22 BalSymbolDefinitions.WixDncOptions,
23 BalSymbolDefinitions.WixMbaPrereqInformation,
24 BalSymbolDefinitions.WixStdbaOptions,
25 BalSymbolDefinitions.WixStdbaOverridableVariable,
26 };
27
28 protected override IReadOnlyCollection<IntermediateSymbolDefinition> SymbolDefinitions => BurnSymbolDefinitions;
29
30 public override void SymbolsFinalized(IntermediateSection section)
31 {
32 base.SymbolsFinalized(section);
33
34 var baSymbol = section.Symbols.OfType<WixBootstrapperApplicationDllSymbol>().SingleOrDefault();
35 var baId = baSymbol?.Id?.Id;
36 if (null == baId)
37 {
38 return;
39 }
40
41 var isStdBA = baId.StartsWith("WixStandardBootstrapperApplication");
42 var isMBA = baId.StartsWith("WixManagedBootstrapperApplicationHost");
43 var isDNC = baId.StartsWith("WixDotNetCoreBootstrapperApplicationHost");
44 var isSCD = isDNC && this.VerifySCD(section);
45
46 if (isDNC)
47 {
48 this.FinalizeBAFactorySymbol(section);
49 }
50
51 if (isStdBA || isMBA || isDNC)
52 {
53 this.VerifyBAFunctions(section);
54 }
55
56 if (isMBA || (isDNC && !isSCD))
57 {
58 this.VerifyPrereqPackages(section, isDNC);
59 }
60 }
61
62 private void FinalizeBAFactorySymbol(IntermediateSection section)
63 {
64 var factorySymbol = section.Symbols.OfType<WixBalBAFactoryAssemblySymbol>().SingleOrDefault();
65 if (null == factorySymbol)
66 {
67 return;
68 }
69
70 var factoryPayloadSymbol = section.Symbols.OfType<WixBundlePayloadSymbol>()
71 .Where(p => p.Id.Id == factorySymbol.PayloadId)
72 .SingleOrDefault();
73 if (null == factoryPayloadSymbol)
74 {
75 return;
76 }
77
78 factorySymbol.FilePath = factoryPayloadSymbol.Name;
79 }
80
81 private void VerifyBAFunctions(IntermediateSection section)
82 {
83 WixBalBAFunctionsSymbol baFunctionsSymbol = null;
84 foreach (var symbol in section.Symbols.OfType<WixBalBAFunctionsSymbol>())
85 {
86 if (null == baFunctionsSymbol)
87 {
88 baFunctionsSymbol = symbol;
89 }
90 else
91 {
92 this.Messaging.Write(BalErrors.MultipleBAFunctions(symbol.SourceLineNumbers));
93 }
94 }
95
96 var payloadPropertiesSymbols = section.Symbols.OfType<WixBundlePayloadSymbol>().ToList();
97 if (null == baFunctionsSymbol)
98 {
99 foreach (var payloadPropertiesSymbol in payloadPropertiesSymbols)
100 {
101 if (string.Equals(payloadPropertiesSymbol.Name, "bafunctions.dll", StringComparison.OrdinalIgnoreCase) &&
102 BurnConstants.BurnUXContainerName == payloadPropertiesSymbol.ContainerRef)
103 {
104 this.Messaging.Write(BalWarnings.UnmarkedBAFunctionsDLL(payloadPropertiesSymbol.SourceLineNumbers));
105 }
106 }
107 }
108 else
109 {
110 var payloadId = baFunctionsSymbol.Id;
111 var bundlePayloadSymbol = payloadPropertiesSymbols.Single(x => payloadId == x.Id);
112 if (BurnConstants.BurnUXContainerName != bundlePayloadSymbol.ContainerRef)
113 {
114 this.Messaging.Write(BalErrors.BAFunctionsPayloadRequiredInUXContainer(baFunctionsSymbol.SourceLineNumbers));
115 }
116 }
117 }
118
119 private void VerifyPrereqPackages(IntermediateSection section, bool isDNC)
120 {
121 var prereqInfoSymbols = section.Symbols.OfType<WixMbaPrereqInformationSymbol>().ToList();
122 if (prereqInfoSymbols.Count == 0)
123 {
124 var message = isDNC ? BalErrors.MissingDNCPrereq() : BalErrors.MissingMBAPrereq();
125 this.Messaging.Write(message);
126 return;
127 }
128
129 var foundLicenseFile = false;
130 var foundLicenseUrl = false;
131
132 foreach (var prereqInfoSymbol in prereqInfoSymbols)
133 {
134 if (null != prereqInfoSymbol.LicenseFile)
135 {
136 if (foundLicenseFile || foundLicenseUrl)
137 {
138 this.Messaging.Write(BalErrors.MultiplePrereqLicenses(prereqInfoSymbol.SourceLineNumbers));
139 return;
140 }
141
142 foundLicenseFile = true;
143 }
144
145 if (null != prereqInfoSymbol.LicenseUrl)
146 {
147 if (foundLicenseFile || foundLicenseUrl)
148 {
149 this.Messaging.Write(BalErrors.MultiplePrereqLicenses(prereqInfoSymbol.SourceLineNumbers));
150 return;
151 }
152
153 foundLicenseUrl = true;
154 }
155 }
156 }
157
158 private bool VerifySCD(IntermediateSection section)
159 {
160 var isSCD = false;
161
162 var dncOptions = section.Symbols.OfType<WixDncOptionsSymbol>().SingleOrDefault();
163 if (dncOptions != null)
164 {
165 isSCD = dncOptions.SelfContainedDeployment != 0;
166 }
167
168 return isSCD;
169 }
170 }
171}
diff --git a/src/ext/Bal/wixext/BalCompiler.cs b/src/ext/Bal/wixext/BalCompiler.cs
new file mode 100644
index 00000000..267345e7
--- /dev/null
+++ b/src/ext/Bal/wixext/BalCompiler.cs
@@ -0,0 +1,923 @@
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
3namespace WixToolset.Bal
4{
5 using System;
6 using System.Collections.Generic;
7 using System.Xml.Linq;
8 using WixToolset.Bal.Symbols;
9 using WixToolset.Data;
10 using WixToolset.Data.Symbols;
11 using WixToolset.Extensibility;
12 using WixToolset.Extensibility.Data;
13
14 /// <summary>
15 /// The compiler for the WiX Toolset Bal Extension.
16 /// </summary>
17 public sealed class BalCompiler : BaseCompilerExtension
18 {
19 private readonly Dictionary<string, WixMbaPrereqInformationSymbol> prereqInfoSymbolsByPackageId;
20
21 private enum WixDotNetCoreBootstrapperApplicationHostTheme
22 {
23 Unknown,
24 None,
25 Standard,
26 }
27
28 private enum WixManagedBootstrapperApplicationHostTheme
29 {
30 Unknown,
31 None,
32 Standard,
33 }
34
35 private enum WixStandardBootstrapperApplicationTheme
36 {
37 Unknown,
38 HyperlinkLargeLicense,
39 HyperlinkLicense,
40 HyperlinkSidebarLicense,
41 None,
42 RtfLargeLicense,
43 RtfLicense,
44 }
45
46 /// <summary>
47 /// Instantiate a new BalCompiler.
48 /// </summary>
49 public BalCompiler()
50 {
51 this.prereqInfoSymbolsByPackageId = new Dictionary<string, WixMbaPrereqInformationSymbol>();
52 }
53
54 public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/bal";
55
56 /// <summary>
57 /// Processes an element for the Compiler.
58 /// </summary>
59 /// <param name="intermediate"></param>
60 /// <param name="section"></param>
61 /// <param name="parentElement">Parent element of element to process.</param>
62 /// <param name="element">Element to process.</param>
63 /// <param name="context">Extra information about the context in which this element is being parsed.</param>
64 public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context)
65 {
66 switch (parentElement.Name.LocalName)
67 {
68 case "Bundle":
69 case "Fragment":
70 switch (element.Name.LocalName)
71 {
72 case "Condition":
73 this.ParseConditionElement(intermediate, section, element);
74 break;
75 case "ManagedBootstrapperApplicationPrereqInformation":
76 this.ParseMbaPrereqInfoElement(intermediate, section, element);
77 break;
78 default:
79 this.ParseHelper.UnexpectedElement(parentElement, element);
80 break;
81 }
82 break;
83 case "BootstrapperApplication":
84 switch (element.Name.LocalName)
85 {
86 case "WixStandardBootstrapperApplication":
87 this.ParseWixStandardBootstrapperApplicationElement(intermediate, section, element);
88 break;
89 case "WixManagedBootstrapperApplicationHost":
90 this.ParseWixManagedBootstrapperApplicationHostElement(intermediate, section, element);
91 break;
92 case "WixDotNetCoreBootstrapperApplicationHost":
93 this.ParseWixDotNetCoreBootstrapperApplicationHostElement(intermediate, section, element);
94 break;
95 default:
96 this.ParseHelper.UnexpectedElement(parentElement, element);
97 break;
98 }
99 break;
100 default:
101 this.ParseHelper.UnexpectedElement(parentElement, element);
102 break;
103 }
104 }
105
106 /// <summary>
107 /// Processes an attribute for the Compiler.
108 /// </summary>
109 /// <param name="sourceLineNumbers">Source line number for the parent element.</param>
110 /// <param name="parentElement">Parent element of element to process.</param>
111 /// <param name="attribute">Attribute to process.</param>
112 /// <param name="context">Extra information about the context in which this element is being parsed.</param>
113 public override void ParseAttribute(Intermediate intermediate, IntermediateSection section, XElement parentElement, XAttribute attribute, IDictionary<string, string> context)
114 {
115 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(parentElement);
116 WixMbaPrereqInformationSymbol prereqInfo;
117
118 switch (parentElement.Name.LocalName)
119 {
120 case "ExePackage":
121 case "MsiPackage":
122 case "MspPackage":
123 case "MsuPackage":
124 string packageId;
125 if (!context.TryGetValue("PackageId", out packageId) || String.IsNullOrEmpty(packageId))
126 {
127 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, parentElement.Name.LocalName, "Id", attribute.Name.LocalName));
128 }
129 else
130 {
131 switch (attribute.Name.LocalName)
132 {
133 case "DisplayInternalUICondition":
134 switch (parentElement.Name.LocalName)
135 {
136 case "MsiPackage":
137 case "MspPackage":
138 var displayInternalUICondition = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attribute);
139 section.AddSymbol(new WixBalPackageInfoSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, packageId))
140 {
141 PackageId = packageId,
142 DisplayInternalUICondition = displayInternalUICondition,
143 });
144 break;
145 default:
146 this.ParseHelper.UnexpectedAttribute(parentElement, attribute);
147 break;
148 }
149 break;
150 case "PrereqLicenseFile":
151
152 if (!this.prereqInfoSymbolsByPackageId.TryGetValue(packageId, out prereqInfo))
153 {
154 // at the time the extension attribute is parsed, the compiler might not yet have
155 // parsed the PrereqPackage attribute, so we need to get it directly from the parent element.
156 var prereqPackage = parentElement.Attribute(this.Namespace + "PrereqPackage");
157
158 if (null != prereqPackage && YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, prereqPackage))
159 {
160 prereqInfo = section.AddSymbol(new WixMbaPrereqInformationSymbol(sourceLineNumbers)
161 {
162 PackageId = packageId,
163 });
164
165 this.prereqInfoSymbolsByPackageId.Add(packageId, prereqInfo);
166 }
167 else
168 {
169 this.Messaging.Write(BalErrors.AttributeRequiresPrereqPackage(sourceLineNumbers, parentElement.Name.LocalName, "PrereqLicenseFile"));
170 break;
171 }
172 }
173
174 if (null != prereqInfo.LicenseUrl)
175 {
176 this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, parentElement.Name.LocalName, "PrereqLicenseFile", "PrereqLicenseUrl"));
177 }
178 else
179 {
180 prereqInfo.LicenseFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attribute);
181 }
182 break;
183 case "PrereqLicenseUrl":
184
185 if (!this.prereqInfoSymbolsByPackageId.TryGetValue(packageId, out prereqInfo))
186 {
187 // at the time the extension attribute is parsed, the compiler might not yet have
188 // parsed the PrereqPackage attribute, so we need to get it directly from the parent element.
189 var prereqPackage = parentElement.Attribute(this.Namespace + "PrereqPackage");
190
191 if (null != prereqPackage && YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, prereqPackage))
192 {
193 prereqInfo = section.AddSymbol(new WixMbaPrereqInformationSymbol(sourceLineNumbers)
194 {
195 PackageId = packageId,
196 });
197
198 this.prereqInfoSymbolsByPackageId.Add(packageId, prereqInfo);
199 }
200 else
201 {
202 this.Messaging.Write(BalErrors.AttributeRequiresPrereqPackage(sourceLineNumbers, parentElement.Name.LocalName, "PrereqLicenseUrl"));
203 break;
204 }
205 }
206
207 if (null != prereqInfo.LicenseFile)
208 {
209 this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, parentElement.Name.LocalName, "PrereqLicenseUrl", "PrereqLicenseFile"));
210 }
211 else
212 {
213 prereqInfo.LicenseUrl = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attribute);
214 }
215 break;
216 case "PrereqPackage":
217 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attribute))
218 {
219 if (!this.prereqInfoSymbolsByPackageId.TryGetValue(packageId, out prereqInfo))
220 {
221 prereqInfo = section.AddSymbol(new WixMbaPrereqInformationSymbol(sourceLineNumbers)
222 {
223 PackageId = packageId,
224 });
225
226 this.prereqInfoSymbolsByPackageId.Add(packageId, prereqInfo);
227 }
228 }
229 break;
230 default:
231 this.ParseHelper.UnexpectedAttribute(parentElement, attribute);
232 break;
233 }
234 }
235 break;
236 case "Payload":
237 string payloadId;
238 if (!context.TryGetValue("Id", out payloadId) || String.IsNullOrEmpty(payloadId))
239 {
240 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, parentElement.Name.LocalName, "Id", attribute.Name.LocalName));
241 }
242 else
243 {
244 switch (attribute.Name.LocalName)
245 {
246 case "BAFactoryAssembly":
247 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attribute))
248 {
249 // There can only be one.
250 var id = new Identifier(AccessModifier.Global, "TheBAFactoryAssembly");
251 section.AddSymbol(new WixBalBAFactoryAssemblySymbol(sourceLineNumbers, id)
252 {
253 PayloadId = payloadId,
254 });
255 }
256 break;
257 case "BAFunctions":
258 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attribute))
259 {
260 section.AddSymbol(new WixBalBAFunctionsSymbol(sourceLineNumbers)
261 {
262 PayloadId = payloadId,
263 });
264 }
265 break;
266 default:
267 this.ParseHelper.UnexpectedAttribute(parentElement, attribute);
268 break;
269 }
270 }
271 break;
272 case "Variable":
273 // at the time the extension attribute is parsed, the compiler might not yet have
274 // parsed the Name attribute, so we need to get it directly from the parent element.
275 var variableName = parentElement.Attribute("Name");
276 if (null == variableName)
277 {
278 this.Messaging.Write(ErrorMessages.ExpectedParentWithAttribute(sourceLineNumbers, "Variable", "Overridable", "Name"));
279 }
280 else
281 {
282 switch (attribute.Name.LocalName)
283 {
284 case "Overridable":
285 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attribute))
286 {
287 section.AddSymbol(new WixStdbaOverridableVariableSymbol(sourceLineNumbers)
288 {
289 Name = variableName.Value,
290 });
291 }
292 break;
293 default:
294 this.ParseHelper.UnexpectedAttribute(parentElement, attribute);
295 break;
296 }
297 }
298 break;
299 }
300 }
301
302 /// <summary>
303 /// Parses a Condition element for Bundles.
304 /// </summary>
305 /// <param name="node">The element to parse.</param>
306 private void ParseConditionElement(Intermediate intermediate, IntermediateSection section, XElement node)
307 {
308 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
309 string condition = null;
310 string message = null;
311
312 foreach (var attrib in node.Attributes())
313 {
314 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
315 {
316 switch (attrib.Name.LocalName)
317 {
318 case "Message":
319 message = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
320 break;
321 case "Condition":
322 condition = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
323 break;
324 default:
325 this.ParseHelper.UnexpectedAttribute(node, attrib);
326 break;
327 }
328 }
329 else
330 {
331 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
332 }
333 }
334
335 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node);
336
337 // Error check the values.
338 if (String.IsNullOrEmpty(condition))
339 {
340 this.Messaging.Write(ErrorMessages.ConditionExpected(sourceLineNumbers, node.Name.LocalName));
341 }
342
343 if (null == message)
344 {
345 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Message"));
346 }
347
348 if (!this.Messaging.EncounteredError)
349 {
350 section.AddSymbol(new WixBalConditionSymbol(sourceLineNumbers)
351 {
352 Condition = condition,
353 Message = message,
354 });
355 }
356 }
357
358 /// <summary>
359 /// Parses a Condition element for Bundles.
360 /// </summary>
361 /// <param name="node">The element to parse.</param>
362 private void ParseMbaPrereqInfoElement(Intermediate intermediate, IntermediateSection section, XElement node)
363 {
364 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
365 string packageId = null;
366 string licenseFile = null;
367 string licenseUrl = null;
368
369 foreach (var attrib in node.Attributes())
370 {
371 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
372 {
373 switch (attrib.Name.LocalName)
374 {
375 case "LicenseFile":
376 licenseFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
377 break;
378 case "LicenseUrl":
379 licenseUrl = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
380 break;
381 case "PackageId":
382 packageId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
383 break;
384 default:
385 this.ParseHelper.UnexpectedAttribute(node, attrib);
386 break;
387 }
388 }
389 else
390 {
391 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
392 }
393 }
394
395 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node);
396
397 if (null == packageId)
398 {
399 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "PackageId"));
400 }
401
402 if (null == licenseFile && null == licenseUrl ||
403 null != licenseFile && null != licenseUrl)
404 {
405 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "LicenseFile", "LicenseUrl", true));
406 }
407
408 if (!this.Messaging.EncounteredError)
409 {
410 section.AddSymbol(new WixMbaPrereqInformationSymbol(sourceLineNumbers)
411 {
412 PackageId = packageId,
413 LicenseFile = licenseFile,
414 LicenseUrl = licenseUrl,
415 });
416 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.WixBundlePackage, packageId);
417 }
418 }
419
420 /// <summary>
421 /// Parses a WixStandardBootstrapperApplication element for Bundles.
422 /// </summary>
423 /// <param name="node">The element to parse.</param>
424 private void ParseWixStandardBootstrapperApplicationElement(Intermediate intermediate, IntermediateSection section, XElement node)
425 {
426 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
427 string launchTarget = null;
428 string launchTargetElevatedId = null;
429 string launchArguments = null;
430 var launchHidden = YesNoType.NotSet;
431 string launchWorkingDir = null;
432 string licenseFile = null;
433 string licenseUrl = null;
434 string logoFile = null;
435 string logoSideFile = null;
436 WixStandardBootstrapperApplicationTheme? theme = null;
437 string themeFile = null;
438 string localizationFile = null;
439 var suppressOptionsUI = YesNoType.NotSet;
440 var suppressDowngradeFailure = YesNoType.NotSet;
441 var suppressRepair = YesNoType.NotSet;
442 var showVersion = YesNoType.NotSet;
443 var supportCacheOnly = YesNoType.NotSet;
444
445 foreach (var attrib in node.Attributes())
446 {
447 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
448 {
449 switch (attrib.Name.LocalName)
450 {
451 case "LaunchTarget":
452 launchTarget = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
453 break;
454 case "LaunchTargetElevatedId":
455 launchTargetElevatedId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
456 break;
457 case "LaunchArguments":
458 launchArguments = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
459 break;
460 case "LaunchHidden":
461 launchHidden = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
462 break;
463 case "LaunchWorkingFolder":
464 launchWorkingDir = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
465 break;
466 case "LicenseFile":
467 licenseFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
468 break;
469 case "LicenseUrl":
470 licenseUrl = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty);
471 break;
472 case "LogoFile":
473 logoFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
474 break;
475 case "LogoSideFile":
476 logoSideFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
477 break;
478 case "ThemeFile":
479 themeFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
480 break;
481 case "LocalizationFile":
482 localizationFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
483 break;
484 case "SuppressOptionsUI":
485 suppressOptionsUI = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
486 break;
487 case "SuppressDowngradeFailure":
488 suppressDowngradeFailure = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
489 break;
490 case "SuppressRepair":
491 suppressRepair = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
492 break;
493 case "ShowVersion":
494 showVersion = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
495 break;
496 case "SupportCacheOnly":
497 supportCacheOnly = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
498 break;
499 case "Theme":
500 var themeValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
501 switch (themeValue)
502 {
503 case "hyperlinkLargeLicense":
504 theme = WixStandardBootstrapperApplicationTheme.HyperlinkLargeLicense;
505 break;
506 case "hyperlinkLicense":
507 theme = WixStandardBootstrapperApplicationTheme.HyperlinkLicense;
508 break;
509 case "hyperlinkSidebarLicense":
510 theme = WixStandardBootstrapperApplicationTheme.HyperlinkSidebarLicense;
511 break;
512 case "none":
513 theme = WixStandardBootstrapperApplicationTheme.None;
514 break;
515 case "rtfLargeLicense":
516 theme = WixStandardBootstrapperApplicationTheme.RtfLargeLicense;
517 break;
518 case "rtfLicense":
519 theme = WixStandardBootstrapperApplicationTheme.RtfLicense;
520 break;
521 default:
522 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Theme", themeValue, "hyperlinkLargeLicense", "hyperlinkLicense", "hyperlinkSidebarLicense", "none", "rtfLargeLicense", "rtfLicense"));
523 theme = WixStandardBootstrapperApplicationTheme.Unknown; // set a value to prevent expected attribute error below.
524 break;
525 }
526 break;
527 default:
528 this.ParseHelper.UnexpectedAttribute(node, attrib);
529 break;
530 }
531 }
532 else
533 {
534 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
535 }
536 }
537
538 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node);
539
540 if (!theme.HasValue)
541 {
542 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Theme"));
543 }
544
545 if (theme != WixStandardBootstrapperApplicationTheme.None && String.IsNullOrEmpty(licenseFile) && null == licenseUrl)
546 {
547 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "LicenseFile", "LicenseUrl", true));
548 }
549
550 if (!this.Messaging.EncounteredError)
551 {
552 if (!String.IsNullOrEmpty(launchTarget))
553 {
554 section.AddSymbol(new WixBundleVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "LaunchTarget"))
555 {
556 Value = launchTarget,
557 Type = WixBundleVariableType.Formatted,
558 });
559 }
560
561 if (!String.IsNullOrEmpty(launchTargetElevatedId))
562 {
563 section.AddSymbol(new WixBundleVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "LaunchTargetElevatedId"))
564 {
565 Value = launchTargetElevatedId,
566 Type = WixBundleVariableType.Formatted,
567 });
568 }
569
570 if (!String.IsNullOrEmpty(launchArguments))
571 {
572 section.AddSymbol(new WixBundleVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "LaunchArguments"))
573 {
574 Value = launchArguments,
575 Type = WixBundleVariableType.Formatted,
576 });
577 }
578
579 if (YesNoType.Yes == launchHidden)
580 {
581 section.AddSymbol(new WixBundleVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "LaunchHidden"))
582 {
583 Value = "yes",
584 Type = WixBundleVariableType.Formatted,
585 });
586 }
587
588
589 if (!String.IsNullOrEmpty(launchWorkingDir))
590 {
591 section.AddSymbol(new WixBundleVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "LaunchWorkingFolder"))
592 {
593 Value = launchWorkingDir,
594 Type = WixBundleVariableType.Formatted,
595 });
596 }
597
598 if (!String.IsNullOrEmpty(licenseFile))
599 {
600 section.AddSymbol(new WixVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixStdbaLicenseRtf"))
601 {
602 Value = licenseFile,
603 });
604 }
605
606 if (null != licenseUrl)
607 {
608 section.AddSymbol(new WixVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixStdbaLicenseUrl"))
609 {
610 Value = licenseUrl,
611 });
612 }
613
614 if (!String.IsNullOrEmpty(logoFile))
615 {
616 section.AddSymbol(new WixVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixStdbaLogo"))
617 {
618 Value = logoFile,
619 });
620 }
621
622 if (!String.IsNullOrEmpty(logoSideFile))
623 {
624 section.AddSymbol(new WixVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixStdbaLogoSide"))
625 {
626 Value = logoSideFile,
627 });
628 }
629
630 if (!String.IsNullOrEmpty(themeFile))
631 {
632 section.AddSymbol(new WixVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixStdbaThemeXml"))
633 {
634 Value = themeFile,
635 });
636 }
637
638 if (!String.IsNullOrEmpty(localizationFile))
639 {
640 section.AddSymbol(new WixVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixStdbaThemeWxl"))
641 {
642 Value = localizationFile,
643 });
644 }
645
646 if (YesNoType.Yes == suppressOptionsUI || YesNoType.Yes == suppressDowngradeFailure || YesNoType.Yes == suppressRepair || YesNoType.Yes == showVersion || YesNoType.Yes == supportCacheOnly)
647 {
648 var symbol = section.AddSymbol(new WixStdbaOptionsSymbol(sourceLineNumbers));
649 if (YesNoType.Yes == suppressOptionsUI)
650 {
651 symbol.SuppressOptionsUI = 1;
652 }
653
654 if (YesNoType.Yes == suppressDowngradeFailure)
655 {
656 symbol.SuppressDowngradeFailure = 1;
657 }
658
659 if (YesNoType.Yes == suppressRepair)
660 {
661 symbol.SuppressRepair = 1;
662 }
663
664 if (YesNoType.Yes == showVersion)
665 {
666 symbol.ShowVersion = 1;
667 }
668
669 if (YesNoType.Yes == supportCacheOnly)
670 {
671 symbol.SupportCacheOnly = 1;
672 }
673 }
674
675 var baId = "WixStandardBootstrapperApplication";
676 switch (theme)
677 {
678 case WixStandardBootstrapperApplicationTheme.HyperlinkLargeLicense:
679 baId = "WixStandardBootstrapperApplication.HyperlinkLargeLicense";
680 break;
681 case WixStandardBootstrapperApplicationTheme.HyperlinkLicense:
682 baId = "WixStandardBootstrapperApplication.HyperlinkLicense";
683 break;
684 case WixStandardBootstrapperApplicationTheme.HyperlinkSidebarLicense:
685 baId = "WixStandardBootstrapperApplication.HyperlinkSidebarLicense";
686 break;
687 case WixStandardBootstrapperApplicationTheme.RtfLargeLicense:
688 baId = "WixStandardBootstrapperApplication.RtfLargeLicense";
689 break;
690 case WixStandardBootstrapperApplicationTheme.RtfLicense:
691 baId = "WixStandardBootstrapperApplication.RtfLicense";
692 break;
693 }
694
695 this.CreateBARef(section, sourceLineNumbers, node, baId);
696 }
697 }
698
699 /// <summary>
700 /// Parses a WixManagedBootstrapperApplicationHost element for Bundles.
701 /// </summary>
702 /// <param name="node">The element to parse.</param>
703 private void ParseWixManagedBootstrapperApplicationHostElement(Intermediate intermediate, IntermediateSection section, XElement node)
704 {
705 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
706 string logoFile = null;
707 string themeFile = null;
708 string localizationFile = null;
709 WixManagedBootstrapperApplicationHostTheme? theme = null;
710
711 foreach (var attrib in node.Attributes())
712 {
713 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
714 {
715 switch (attrib.Name.LocalName)
716 {
717 case "LogoFile":
718 logoFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
719 break;
720 case "ThemeFile":
721 themeFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
722 break;
723 case "LocalizationFile":
724 localizationFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
725 break;
726 case "Theme":
727 var themeValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
728 switch (themeValue)
729 {
730 case "none":
731 theme = WixManagedBootstrapperApplicationHostTheme.None;
732 break;
733 case "standard":
734 theme = WixManagedBootstrapperApplicationHostTheme.Standard;
735 break;
736 default:
737 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Theme", themeValue, "none", "standard"));
738 theme = WixManagedBootstrapperApplicationHostTheme.Unknown;
739 break;
740 }
741 break;
742 default:
743 this.ParseHelper.UnexpectedAttribute(node, attrib);
744 break;
745 }
746 }
747 else
748 {
749 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
750 }
751 }
752
753 if (!theme.HasValue)
754 {
755 theme = WixManagedBootstrapperApplicationHostTheme.Standard;
756 }
757
758 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node);
759
760 if (!this.Messaging.EncounteredError)
761 {
762 if (!String.IsNullOrEmpty(logoFile))
763 {
764 section.AddSymbol(new WixVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "PreqbaLogo"))
765 {
766 Value = logoFile,
767 });
768 }
769
770 if (!String.IsNullOrEmpty(themeFile))
771 {
772 section.AddSymbol(new WixVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "PreqbaThemeXml"))
773 {
774 Value = themeFile,
775 });
776 }
777
778 if (!String.IsNullOrEmpty(localizationFile))
779 {
780 section.AddSymbol(new WixVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "PreqbaThemeWxl"))
781 {
782 Value = localizationFile,
783 });
784 }
785
786 var baId = "WixManagedBootstrapperApplicationHost";
787 switch (theme)
788 {
789 case WixManagedBootstrapperApplicationHostTheme.Standard:
790 baId = "WixManagedBootstrapperApplicationHost.Standard";
791 break;
792 }
793
794 this.CreateBARef(section, sourceLineNumbers, node, baId);
795 }
796 }
797
798 /// <summary>
799 /// Parses a WixDotNetCoreBootstrapperApplication element for Bundles.
800 /// </summary>
801 /// <param name="node">The element to parse.</param>
802 private void ParseWixDotNetCoreBootstrapperApplicationHostElement(Intermediate intermediate, IntermediateSection section, XElement node)
803 {
804 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
805 string logoFile = null;
806 string themeFile = null;
807 string localizationFile = null;
808 var selfContainedDeployment = YesNoType.NotSet;
809 WixDotNetCoreBootstrapperApplicationHostTheme? theme = null;
810
811 foreach (var attrib in node.Attributes())
812 {
813 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
814 {
815 switch (attrib.Name.LocalName)
816 {
817 case "LogoFile":
818 logoFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
819 break;
820 case "ThemeFile":
821 themeFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
822 break;
823 case "LocalizationFile":
824 localizationFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
825 break;
826 case "SelfContainedDeployment":
827 selfContainedDeployment = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
828 break;
829 case "Theme":
830 var themeValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
831 switch (themeValue)
832 {
833 case "none":
834 theme = WixDotNetCoreBootstrapperApplicationHostTheme.None;
835 break;
836 case "standard":
837 theme = WixDotNetCoreBootstrapperApplicationHostTheme.Standard;
838 break;
839 default:
840 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Theme", themeValue, "none", "standard"));
841 theme = WixDotNetCoreBootstrapperApplicationHostTheme.Unknown;
842 break;
843 }
844 break;
845 default:
846 this.ParseHelper.UnexpectedAttribute(node, attrib);
847 break;
848 }
849 }
850 else
851 {
852 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
853 }
854 }
855
856 if (!theme.HasValue)
857 {
858 theme = WixDotNetCoreBootstrapperApplicationHostTheme.Standard;
859 }
860
861 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node);
862
863 if (!this.Messaging.EncounteredError)
864 {
865 if (!String.IsNullOrEmpty(logoFile))
866 {
867 section.AddSymbol(new WixVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "DncPreqbaLogo"))
868 {
869 Value = logoFile,
870 });
871 }
872
873 if (!String.IsNullOrEmpty(themeFile))
874 {
875 section.AddSymbol(new WixVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "DncPreqbaThemeXml"))
876 {
877 Value = themeFile,
878 });
879 }
880
881 if (!String.IsNullOrEmpty(localizationFile))
882 {
883 section.AddSymbol(new WixVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "DncPreqbaThemeWxl"))
884 {
885 Value = localizationFile,
886 });
887 }
888
889 if (YesNoType.Yes == selfContainedDeployment)
890 {
891 section.AddSymbol(new WixDncOptionsSymbol(sourceLineNumbers)
892 {
893 SelfContainedDeployment = 1,
894 });
895 }
896
897 var baId = "WixDotNetCoreBootstrapperApplicationHost";
898 switch (theme)
899 {
900 case WixDotNetCoreBootstrapperApplicationHostTheme.Standard:
901 baId = "WixDotNetCoreBootstrapperApplicationHost.Standard";
902 break;
903 }
904
905 this.CreateBARef(section, sourceLineNumbers, node, baId);
906 }
907 }
908
909 private void CreateBARef(IntermediateSection section, SourceLineNumber sourceLineNumbers, XElement node, string name)
910 {
911 var id = this.ParseHelper.CreateIdentifierValueFromPlatform(name, this.Context.Platform, BurnPlatforms.X86 | BurnPlatforms.X64 | BurnPlatforms.ARM64);
912 if (id == null)
913 {
914 this.Messaging.Write(ErrorMessages.UnsupportedPlatformForElement(sourceLineNumbers, this.Context.Platform.ToString(), node.Name.LocalName));
915 }
916
917 if (!this.Messaging.EncounteredError)
918 {
919 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.WixBootstrapperApplication, id);
920 }
921 }
922 }
923}
diff --git a/src/ext/Bal/wixext/BalErrors.cs b/src/ext/Bal/wixext/BalErrors.cs
new file mode 100644
index 00000000..bc0186c1
--- /dev/null
+++ b/src/ext/Bal/wixext/BalErrors.cs
@@ -0,0 +1,61 @@
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
3namespace WixToolset.Bal
4{
5 using System;
6 using System.Resources;
7 using WixToolset.Data;
8
9 public static class BalErrors
10 {
11 public static Message AttributeRequiresPrereqPackage(SourceLineNumber sourceLineNumbers, string elementName, string attributeName)
12 {
13 return Message(sourceLineNumbers, Ids.AttributeRequiresPrereqPackage, "When the {0}/@{1} attribute is specified, the {0}/@PrereqPackage attribute must be set to \"yes\".", elementName, attributeName);
14 }
15
16 public static Message BAFunctionsPayloadRequiredInUXContainer(SourceLineNumber sourceLineNumbers)
17 {
18 return Message(sourceLineNumbers, Ids.BAFunctionsPayloadRequiredInUXContainer, "The BAFunctions DLL Payload element must be located inside the BootstrapperApplication container.");
19 }
20
21 public static Message MissingDNCPrereq()
22 {
23 return Message(null, Ids.MissingDNCPrereq, "There must be at least one PrereqPackage when using the DotNetCoreBootstrapperApplicationHost with SelfContainedDeployment set to \"no\".");
24 }
25
26 public static Message MissingMBAPrereq()
27 {
28 return Message(null, Ids.MissingMBAPrereq, "There must be at least one PrereqPackage when using the ManagedBootstrapperApplicationHost.\nThis is typically done by using the WixNetFxExtension and referencing one of the NetFxAsPrereq package groups.");
29 }
30
31 public static Message MultipleBAFunctions(SourceLineNumber sourceLineNumbers)
32 {
33 return Message(sourceLineNumbers, Ids.MultipleBAFunctions, "WixStandardBootstrapperApplication doesn't support multiple BAFunctions DLLs.");
34 }
35
36 public static Message MultiplePrereqLicenses(SourceLineNumber sourceLineNumbers)
37 {
38 return Message(sourceLineNumbers, Ids.MultiplePrereqLicenses, "There may only be one package in the bundle that has either the PrereqLicenseFile attribute or the PrereqLicenseUrl attribute.");
39 }
40
41 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
42 {
43 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args);
44 }
45
46 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args)
47 {
48 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args);
49 }
50
51 public enum Ids
52 {
53 AttributeRequiresPrereqPackage = 6801,
54 MissingMBAPrereq = 6802,
55 MultiplePrereqLicenses = 6803,
56 MultipleBAFunctions = 6804,
57 BAFunctionsPayloadRequiredInUXContainer = 6805,
58 MissingDNCPrereq = 6806,
59 }
60 }
61}
diff --git a/src/ext/Bal/wixext/BalExtensionData.cs b/src/ext/Bal/wixext/BalExtensionData.cs
new file mode 100644
index 00000000..55daf005
--- /dev/null
+++ b/src/ext/Bal/wixext/BalExtensionData.cs
@@ -0,0 +1,30 @@
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
3namespace WixToolset.Bal
4{
5 using WixToolset.Data;
6 using WixToolset.Extensibility;
7
8 /// <summary>
9 /// The WiX Toolset Bal Extension.
10 /// </summary>
11 public sealed class BalExtensionData : BaseExtensionData
12 {
13 /// <summary>
14 /// Gets the default culture.
15 /// </summary>
16 /// <value>The default culture.</value>
17 public override string DefaultCulture => "en-US";
18
19 public override bool TryGetSymbolDefinitionByName(string name, out IntermediateSymbolDefinition symbolDefinition)
20 {
21 symbolDefinition = BalSymbolDefinitions.ByName(name);
22 return symbolDefinition != null;
23 }
24
25 public override Intermediate GetLibrary(ISymbolDefinitionCreator symbolDefinitions)
26 {
27 return Intermediate.Load(typeof(BalExtensionData).Assembly, "WixToolset.Bal.bal.wixlib", symbolDefinitions);
28 }
29 }
30}
diff --git a/src/ext/Bal/wixext/BalExtensionFactory.cs b/src/ext/Bal/wixext/BalExtensionFactory.cs
new file mode 100644
index 00000000..0bfb6c5f
--- /dev/null
+++ b/src/ext/Bal/wixext/BalExtensionFactory.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
3namespace WixToolset.Bal
4{
5 using System;
6 using System.Collections.Generic;
7 using WixToolset.Extensibility;
8
9 public class BalExtensionFactory : BaseExtensionFactory
10 {
11 protected override IReadOnlyCollection<Type> ExtensionTypes => new[]
12 {
13 typeof(BalCompiler),
14 typeof(BalExtensionData),
15 typeof(BalBurnBackendExtension),
16 };
17 }
18}
diff --git a/src/ext/Bal/wixext/BalWarnings.cs b/src/ext/Bal/wixext/BalWarnings.cs
new file mode 100644
index 00000000..18b25062
--- /dev/null
+++ b/src/ext/Bal/wixext/BalWarnings.cs
@@ -0,0 +1,31 @@
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
3namespace WixToolset.Bal
4{
5 using System;
6 using System.Resources;
7 using WixToolset.Data;
8
9 public static class BalWarnings
10 {
11 public static Message UnmarkedBAFunctionsDLL(SourceLineNumber sourceLineNumbers)
12 {
13 return Message(sourceLineNumbers, Ids.UnmarkedBAFunctionsDLL, "WixStandardBootstrapperApplication doesn't automatically load BAFunctions.dll. Use the bal:BAFunctions attribute to indicate that it should be loaded.");
14 }
15
16 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
17 {
18 return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args);
19 }
20
21 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args)
22 {
23 return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, resourceManager, resourceName, args);
24 }
25
26 public enum Ids
27 {
28 UnmarkedBAFunctionsDLL = 6501,
29 }
30 }
31}
diff --git a/src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs b/src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs
new file mode 100644
index 00000000..90865621
--- /dev/null
+++ b/src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs
@@ -0,0 +1,80 @@
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
3namespace WixToolset.Bal
4{
5 using System;
6 using WixToolset.Data;
7 using WixToolset.Data.Burn;
8
9 public enum BalSymbolDefinitionType
10 {
11 WixBalBAFactoryAssembly,
12 WixBalBAFunctions,
13 WixBalCondition,
14 WixBalPackageInfo,
15 WixDncOptions,
16 WixMbaPrereqInformation,
17 WixStdbaOptions,
18 WixStdbaOverridableVariable,
19 }
20
21 public static partial class BalSymbolDefinitions
22 {
23 public static readonly Version Version = new Version("4.0.0");
24
25 public static IntermediateSymbolDefinition ByName(string name)
26 {
27 if (!Enum.TryParse(name, out BalSymbolDefinitionType type))
28 {
29 return null;
30 }
31
32 return ByType(type);
33 }
34
35 public static IntermediateSymbolDefinition ByType(BalSymbolDefinitionType type)
36 {
37 switch (type)
38 {
39 case BalSymbolDefinitionType.WixBalBAFactoryAssembly:
40 return BalSymbolDefinitions.WixBalBAFactoryAssembly;
41
42 case BalSymbolDefinitionType.WixBalBAFunctions:
43 return BalSymbolDefinitions.WixBalBAFunctions;
44
45 case BalSymbolDefinitionType.WixBalCondition:
46 return BalSymbolDefinitions.WixBalCondition;
47
48 case BalSymbolDefinitionType.WixBalPackageInfo:
49 return BalSymbolDefinitions.WixBalPackageInfo;
50
51 case BalSymbolDefinitionType.WixDncOptions:
52 return BalSymbolDefinitions.WixDncOptions;
53
54 case BalSymbolDefinitionType.WixMbaPrereqInformation:
55 return BalSymbolDefinitions.WixMbaPrereqInformation;
56
57 case BalSymbolDefinitionType.WixStdbaOptions:
58 return BalSymbolDefinitions.WixStdbaOptions;
59
60 case BalSymbolDefinitionType.WixStdbaOverridableVariable:
61 return BalSymbolDefinitions.WixStdbaOverridableVariable;
62
63 default:
64 throw new ArgumentOutOfRangeException(nameof(type));
65 }
66 }
67
68 static BalSymbolDefinitions()
69 {
70 WixBalBAFactoryAssembly.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag);
71 WixBalBAFunctions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag);
72 WixBalCondition.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag);
73 WixBalPackageInfo.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag);
74 WixDncOptions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag);
75 WixMbaPrereqInformation.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag);
76 WixStdbaOptions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag);
77 WixStdbaOverridableVariable.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag);
78 }
79 }
80}
diff --git a/src/ext/Bal/wixext/Symbols/WixBalBAFactoryAssemblySymbol.cs b/src/ext/Bal/wixext/Symbols/WixBalBAFactoryAssemblySymbol.cs
new file mode 100644
index 00000000..52042e4c
--- /dev/null
+++ b/src/ext/Bal/wixext/Symbols/WixBalBAFactoryAssemblySymbol.cs
@@ -0,0 +1,55 @@
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
3namespace WixToolset.Bal
4{
5 using WixToolset.Data;
6 using WixToolset.Bal.Symbols;
7
8 public static partial class BalSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition WixBalBAFactoryAssembly = new IntermediateSymbolDefinition(
11 BalSymbolDefinitionType.WixBalBAFactoryAssembly.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixBalBAFactorySymbolFields.PayloadId), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixBalBAFactorySymbolFields.FilePath), IntermediateFieldType.String),
16 },
17 typeof(WixBalBAFactoryAssemblySymbol));
18 }
19}
20
21namespace WixToolset.Bal.Symbols
22{
23 using WixToolset.Data;
24
25 public enum WixBalBAFactorySymbolFields
26 {
27 PayloadId,
28 FilePath,
29 }
30
31 public class WixBalBAFactoryAssemblySymbol : IntermediateSymbol
32 {
33 public WixBalBAFactoryAssemblySymbol() : base(BalSymbolDefinitions.WixBalBAFactoryAssembly, null, null)
34 {
35 }
36
37 public WixBalBAFactoryAssemblySymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalSymbolDefinitions.WixBalBAFactoryAssembly, sourceLineNumber, id)
38 {
39 }
40
41 public IntermediateField this[WixBalBAFactorySymbolFields index] => this.Fields[(int)index];
42
43 public string PayloadId
44 {
45 get => this.Fields[(int)WixBalBAFactorySymbolFields.PayloadId].AsString();
46 set => this.Set((int)WixBalBAFactorySymbolFields.PayloadId, value);
47 }
48
49 public string FilePath
50 {
51 get => this.Fields[(int)WixBalBAFactorySymbolFields.FilePath].AsString();
52 set => this.Set((int)WixBalBAFactorySymbolFields.FilePath, value);
53 }
54 }
55} \ No newline at end of file
diff --git a/src/ext/Bal/wixext/Symbols/WixBalBAFunctionsSymbol.cs b/src/ext/Bal/wixext/Symbols/WixBalBAFunctionsSymbol.cs
new file mode 100644
index 00000000..19c7602d
--- /dev/null
+++ b/src/ext/Bal/wixext/Symbols/WixBalBAFunctionsSymbol.cs
@@ -0,0 +1,47 @@
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
3namespace WixToolset.Bal
4{
5 using WixToolset.Data;
6 using WixToolset.Bal.Symbols;
7
8 public static partial class BalSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition WixBalBAFunctions = new IntermediateSymbolDefinition(
11 BalSymbolDefinitionType.WixBalBAFunctions.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixBalBAFunctionsSymbolFields.PayloadId), IntermediateFieldType.String),
15 },
16 typeof(WixBalBAFunctionsSymbol));
17 }
18}
19
20namespace WixToolset.Bal.Symbols
21{
22 using WixToolset.Data;
23
24 public enum WixBalBAFunctionsSymbolFields
25 {
26 PayloadId,
27 }
28
29 public class WixBalBAFunctionsSymbol : IntermediateSymbol
30 {
31 public WixBalBAFunctionsSymbol() : base(BalSymbolDefinitions.WixBalBAFunctions, null, null)
32 {
33 }
34
35 public WixBalBAFunctionsSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalSymbolDefinitions.WixBalBAFunctions, sourceLineNumber, id)
36 {
37 }
38
39 public IntermediateField this[WixBalBAFunctionsSymbolFields index] => this.Fields[(int)index];
40
41 public string PayloadId
42 {
43 get => this.Fields[(int)WixBalBAFunctionsSymbolFields.PayloadId].AsString();
44 set => this.Set((int)WixBalBAFunctionsSymbolFields.PayloadId, value);
45 }
46 }
47} \ No newline at end of file
diff --git a/src/ext/Bal/wixext/Symbols/WixBalConditionSymbol.cs b/src/ext/Bal/wixext/Symbols/WixBalConditionSymbol.cs
new file mode 100644
index 00000000..c2527fbc
--- /dev/null
+++ b/src/ext/Bal/wixext/Symbols/WixBalConditionSymbol.cs
@@ -0,0 +1,55 @@
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
3namespace WixToolset.Bal
4{
5 using WixToolset.Data;
6 using WixToolset.Bal.Symbols;
7
8 public static partial class BalSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition WixBalCondition = new IntermediateSymbolDefinition(
11 BalSymbolDefinitionType.WixBalCondition.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixBalConditionSymbolFields.Condition), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixBalConditionSymbolFields.Message), IntermediateFieldType.String),
16 },
17 typeof(WixBalConditionSymbol));
18 }
19}
20
21namespace WixToolset.Bal.Symbols
22{
23 using WixToolset.Data;
24
25 public enum WixBalConditionSymbolFields
26 {
27 Condition,
28 Message,
29 }
30
31 public class WixBalConditionSymbol : IntermediateSymbol
32 {
33 public WixBalConditionSymbol() : base(BalSymbolDefinitions.WixBalCondition, null, null)
34 {
35 }
36
37 public WixBalConditionSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalSymbolDefinitions.WixBalCondition, sourceLineNumber, id)
38 {
39 }
40
41 public IntermediateField this[WixBalConditionSymbolFields index] => this.Fields[(int)index];
42
43 public string Condition
44 {
45 get => this.Fields[(int)WixBalConditionSymbolFields.Condition].AsString();
46 set => this.Set((int)WixBalConditionSymbolFields.Condition, value);
47 }
48
49 public string Message
50 {
51 get => this.Fields[(int)WixBalConditionSymbolFields.Message].AsString();
52 set => this.Set((int)WixBalConditionSymbolFields.Message, value);
53 }
54 }
55} \ No newline at end of file
diff --git a/src/ext/Bal/wixext/Symbols/WixBalPackageInfoSymbol.cs b/src/ext/Bal/wixext/Symbols/WixBalPackageInfoSymbol.cs
new file mode 100644
index 00000000..b09cb191
--- /dev/null
+++ b/src/ext/Bal/wixext/Symbols/WixBalPackageInfoSymbol.cs
@@ -0,0 +1,55 @@
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
3namespace WixToolset.Bal
4{
5 using WixToolset.Data;
6 using WixToolset.Bal.Symbols;
7
8 public static partial class BalSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition WixBalPackageInfo = new IntermediateSymbolDefinition(
11 BalSymbolDefinitionType.WixBalPackageInfo.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixBalPackageInfoSymbolFields.PackageId), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixBalPackageInfoSymbolFields.DisplayInternalUICondition), IntermediateFieldType.String),
16 },
17 typeof(WixBalPackageInfoSymbol));
18 }
19}
20
21namespace WixToolset.Bal.Symbols
22{
23 using WixToolset.Data;
24
25 public enum WixBalPackageInfoSymbolFields
26 {
27 PackageId,
28 DisplayInternalUICondition,
29 }
30
31 public class WixBalPackageInfoSymbol : IntermediateSymbol
32 {
33 public WixBalPackageInfoSymbol() : base(BalSymbolDefinitions.WixBalPackageInfo, null, null)
34 {
35 }
36
37 public WixBalPackageInfoSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalSymbolDefinitions.WixBalPackageInfo, sourceLineNumber, id)
38 {
39 }
40
41 public IntermediateField this[WixBalPackageInfoSymbolFields index] => this.Fields[(int)index];
42
43 public string PackageId
44 {
45 get => this.Fields[(int)WixBalPackageInfoSymbolFields.PackageId].AsString();
46 set => this.Set((int)WixBalPackageInfoSymbolFields.PackageId, value);
47 }
48
49 public string DisplayInternalUICondition
50 {
51 get => this.Fields[(int)WixBalPackageInfoSymbolFields.DisplayInternalUICondition].AsString();
52 set => this.Set((int)WixBalPackageInfoSymbolFields.DisplayInternalUICondition, value);
53 }
54 }
55}
diff --git a/src/ext/Bal/wixext/Symbols/WixDncOptionsSymbol.cs b/src/ext/Bal/wixext/Symbols/WixDncOptionsSymbol.cs
new file mode 100644
index 00000000..b9a41c21
--- /dev/null
+++ b/src/ext/Bal/wixext/Symbols/WixDncOptionsSymbol.cs
@@ -0,0 +1,47 @@
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
3namespace WixToolset.Bal
4{
5 using WixToolset.Data;
6 using WixToolset.Bal.Symbols;
7
8 public static partial class BalSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition WixDncOptions = new IntermediateSymbolDefinition(
11 BalSymbolDefinitionType.WixDncOptions.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixDncOptionsSymbolFields.SelfContainedDeployment), IntermediateFieldType.Number),
15 },
16 typeof(WixDncOptionsSymbol));
17 }
18}
19
20namespace WixToolset.Bal.Symbols
21{
22 using WixToolset.Data;
23
24 public enum WixDncOptionsSymbolFields
25 {
26 SelfContainedDeployment,
27 }
28
29 public class WixDncOptionsSymbol : IntermediateSymbol
30 {
31 public WixDncOptionsSymbol() : base(BalSymbolDefinitions.WixDncOptions, null, null)
32 {
33 }
34
35 public WixDncOptionsSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalSymbolDefinitions.WixDncOptions, sourceLineNumber, id)
36 {
37 }
38
39 public IntermediateField this[WixDncOptionsSymbolFields index] => this.Fields[(int)index];
40
41 public int SelfContainedDeployment
42 {
43 get => this.Fields[(int)WixDncOptionsSymbolFields.SelfContainedDeployment].AsNumber();
44 set => this.Set((int)WixDncOptionsSymbolFields.SelfContainedDeployment, value);
45 }
46 }
47} \ No newline at end of file
diff --git a/src/ext/Bal/wixext/Symbols/WixMbaPrereqInformationSymbol.cs b/src/ext/Bal/wixext/Symbols/WixMbaPrereqInformationSymbol.cs
new file mode 100644
index 00000000..e4d78da0
--- /dev/null
+++ b/src/ext/Bal/wixext/Symbols/WixMbaPrereqInformationSymbol.cs
@@ -0,0 +1,63 @@
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
3namespace WixToolset.Bal
4{
5 using WixToolset.Data;
6 using WixToolset.Bal.Symbols;
7
8 public static partial class BalSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition WixMbaPrereqInformation = new IntermediateSymbolDefinition(
11 BalSymbolDefinitionType.WixMbaPrereqInformation.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixMbaPrereqInformationSymbolFields.PackageId), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixMbaPrereqInformationSymbolFields.LicenseFile), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(WixMbaPrereqInformationSymbolFields.LicenseUrl), IntermediateFieldType.String),
17 },
18 typeof(WixMbaPrereqInformationSymbol));
19 }
20}
21
22namespace WixToolset.Bal.Symbols
23{
24 using WixToolset.Data;
25
26 public enum WixMbaPrereqInformationSymbolFields
27 {
28 PackageId,
29 LicenseFile,
30 LicenseUrl,
31 }
32
33 public class WixMbaPrereqInformationSymbol : IntermediateSymbol
34 {
35 public WixMbaPrereqInformationSymbol() : base(BalSymbolDefinitions.WixMbaPrereqInformation, null, null)
36 {
37 }
38
39 public WixMbaPrereqInformationSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalSymbolDefinitions.WixMbaPrereqInformation, sourceLineNumber, id)
40 {
41 }
42
43 public IntermediateField this[WixMbaPrereqInformationSymbolFields index] => this.Fields[(int)index];
44
45 public string PackageId
46 {
47 get => this.Fields[(int)WixMbaPrereqInformationSymbolFields.PackageId].AsString();
48 set => this.Set((int)WixMbaPrereqInformationSymbolFields.PackageId, value);
49 }
50
51 public string LicenseFile
52 {
53 get => this.Fields[(int)WixMbaPrereqInformationSymbolFields.LicenseFile].AsString();
54 set => this.Set((int)WixMbaPrereqInformationSymbolFields.LicenseFile, value);
55 }
56
57 public string LicenseUrl
58 {
59 get => this.Fields[(int)WixMbaPrereqInformationSymbolFields.LicenseUrl].AsString();
60 set => this.Set((int)WixMbaPrereqInformationSymbolFields.LicenseUrl, value);
61 }
62 }
63} \ No newline at end of file
diff --git a/src/ext/Bal/wixext/Symbols/WixStdbaOptionsSymbol.cs b/src/ext/Bal/wixext/Symbols/WixStdbaOptionsSymbol.cs
new file mode 100644
index 00000000..cb2694da
--- /dev/null
+++ b/src/ext/Bal/wixext/Symbols/WixStdbaOptionsSymbol.cs
@@ -0,0 +1,79 @@
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
3namespace WixToolset.Bal
4{
5 using WixToolset.Data;
6 using WixToolset.Bal.Symbols;
7
8 public static partial class BalSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition WixStdbaOptions = new IntermediateSymbolDefinition(
11 BalSymbolDefinitionType.WixStdbaOptions.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixStdbaOptionsSymbolFields.SuppressOptionsUI), IntermediateFieldType.Number),
15 new IntermediateFieldDefinition(nameof(WixStdbaOptionsSymbolFields.SuppressDowngradeFailure), IntermediateFieldType.Number),
16 new IntermediateFieldDefinition(nameof(WixStdbaOptionsSymbolFields.SuppressRepair), IntermediateFieldType.Number),
17 new IntermediateFieldDefinition(nameof(WixStdbaOptionsSymbolFields.ShowVersion), IntermediateFieldType.Number),
18 new IntermediateFieldDefinition(nameof(WixStdbaOptionsSymbolFields.SupportCacheOnly), IntermediateFieldType.Number),
19 },
20 typeof(WixStdbaOptionsSymbol));
21 }
22}
23
24namespace WixToolset.Bal.Symbols
25{
26 using WixToolset.Data;
27
28 public enum WixStdbaOptionsSymbolFields
29 {
30 SuppressOptionsUI,
31 SuppressDowngradeFailure,
32 SuppressRepair,
33 ShowVersion,
34 SupportCacheOnly,
35 }
36
37 public class WixStdbaOptionsSymbol : IntermediateSymbol
38 {
39 public WixStdbaOptionsSymbol() : base(BalSymbolDefinitions.WixStdbaOptions, null, null)
40 {
41 }
42
43 public WixStdbaOptionsSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalSymbolDefinitions.WixStdbaOptions, sourceLineNumber, id)
44 {
45 }
46
47 public IntermediateField this[WixStdbaOptionsSymbolFields index] => this.Fields[(int)index];
48
49 public int SuppressOptionsUI
50 {
51 get => this.Fields[(int)WixStdbaOptionsSymbolFields.SuppressOptionsUI].AsNumber();
52 set => this.Set((int)WixStdbaOptionsSymbolFields.SuppressOptionsUI, value);
53 }
54
55 public int SuppressDowngradeFailure
56 {
57 get => this.Fields[(int)WixStdbaOptionsSymbolFields.SuppressDowngradeFailure].AsNumber();
58 set => this.Set((int)WixStdbaOptionsSymbolFields.SuppressDowngradeFailure, value);
59 }
60
61 public int SuppressRepair
62 {
63 get => this.Fields[(int)WixStdbaOptionsSymbolFields.SuppressRepair].AsNumber();
64 set => this.Set((int)WixStdbaOptionsSymbolFields.SuppressRepair, value);
65 }
66
67 public int ShowVersion
68 {
69 get => this.Fields[(int)WixStdbaOptionsSymbolFields.ShowVersion].AsNumber();
70 set => this.Set((int)WixStdbaOptionsSymbolFields.ShowVersion, value);
71 }
72
73 public int SupportCacheOnly
74 {
75 get => this.Fields[(int)WixStdbaOptionsSymbolFields.SupportCacheOnly].AsNumber();
76 set => this.Set((int)WixStdbaOptionsSymbolFields.SupportCacheOnly, value);
77 }
78 }
79} \ No newline at end of file
diff --git a/src/ext/Bal/wixext/Symbols/WixStdbaOverridableVariableSymbol.cs b/src/ext/Bal/wixext/Symbols/WixStdbaOverridableVariableSymbol.cs
new file mode 100644
index 00000000..1d84d1aa
--- /dev/null
+++ b/src/ext/Bal/wixext/Symbols/WixStdbaOverridableVariableSymbol.cs
@@ -0,0 +1,47 @@
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
3namespace WixToolset.Bal
4{
5 using WixToolset.Data;
6 using WixToolset.Bal.Symbols;
7
8 public static partial class BalSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition WixStdbaOverridableVariable = new IntermediateSymbolDefinition(
11 BalSymbolDefinitionType.WixStdbaOverridableVariable.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixStdbaOverridableVariableSymbolFields.Name), IntermediateFieldType.String),
15 },
16 typeof(WixStdbaOverridableVariableSymbol));
17 }
18}
19
20namespace WixToolset.Bal.Symbols
21{
22 using WixToolset.Data;
23
24 public enum WixStdbaOverridableVariableSymbolFields
25 {
26 Name,
27 }
28
29 public class WixStdbaOverridableVariableSymbol : IntermediateSymbol
30 {
31 public WixStdbaOverridableVariableSymbol() : base(BalSymbolDefinitions.WixStdbaOverridableVariable, null, null)
32 {
33 }
34
35 public WixStdbaOverridableVariableSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalSymbolDefinitions.WixStdbaOverridableVariable, sourceLineNumber, id)
36 {
37 }
38
39 public IntermediateField this[WixStdbaOverridableVariableSymbolFields index] => this.Fields[(int)index];
40
41 public string Name
42 {
43 get => this.Fields[(int)WixStdbaOverridableVariableSymbolFields.Name].AsString();
44 set => this.Set((int)WixStdbaOverridableVariableSymbolFields.Name, value);
45 }
46 }
47} \ No newline at end of file
diff --git a/src/ext/Bal/wixext/WixToolset.Bal.wixext.csproj b/src/ext/Bal/wixext/WixToolset.Bal.wixext.csproj
new file mode 100644
index 00000000..00451403
--- /dev/null
+++ b/src/ext/Bal/wixext/WixToolset.Bal.wixext.csproj
@@ -0,0 +1,39 @@
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>netstandard2.0</TargetFramework>
7 <RootNamespace>WixToolset.Bal</RootNamespace>
8 <Description>WiX Toolset Bal Extension</Description>
9 <Title>WiX Toolset Bal Extension</Title>
10 <DebugType>embedded</DebugType>
11 <NuspecFile>$(MSBuildThisFileName).nuspec</NuspecFile>
12 <IncludeSymbols>true</IncludeSymbols>
13 <NuspecProperties>Id=$(MSBuildThisFileName);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description);Title=$(Title)</NuspecProperties>
14 </PropertyGroup>
15 <ItemGroup>
16 <Content Include="$(MSBuildThisFileName).targets" />
17 <EmbeddedResource Include="$(OutputPath)..\bal.wixlib" />
18 </ItemGroup>
19 <ItemGroup>
20 <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="all" />
21 <PackageReference Include="WixToolset.Data" Version="4.0.*" PrivateAssets="all" />
22 <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" PrivateAssets="all" />
23 </ItemGroup>
24
25 <ItemGroup>
26 <ProjectReference Include="..\wixlib\bal.wixproj" ReferenceOutputAssembly="false" Condition=" '$(NCrunch)'=='' " />
27 </ItemGroup>
28
29 <ItemGroup>
30 <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="all" />
31 </ItemGroup>
32
33 <Target Name="SetNuspecProperties" DependsOnTargets="InitializeSourceControlInformation" AfterTargets="GetBuildVersion">
34 <PropertyGroup>
35 <NuspecBasePath>$(OutputPath)..\</NuspecBasePath>
36 <NuspecProperties>$(NuspecProperties);Version=$(BuildVersionSimple);RepositoryCommit=$(SourceRevisionId);RepositoryType=$(RepositoryType);RepositoryUrl=$(PrivateRepositoryUrl);ProjectFolder=$(MSBuildThisFileDirectory)</NuspecProperties>
37 </PropertyGroup>
38 </Target>
39</Project>
diff --git a/src/ext/Bal/wixext/WixToolset.Bal.wixext.nuspec b/src/ext/Bal/wixext/WixToolset.Bal.wixext.nuspec
new file mode 100644
index 00000000..d9e704ae
--- /dev/null
+++ b/src/ext/Bal/wixext/WixToolset.Bal.wixext.nuspec
@@ -0,0 +1,26 @@
1<?xml version="1.0"?>
2<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3 <metadata minClientVersion="4.0">
4 <id>$id$</id>
5 <version>$version$</version>
6 <authors>$authors$</authors>
7 <owners>$authors$</owners>
8 <license type="expression">MS-RL</license>
9 <projectUrl>https://github.com/wixtoolset/Bal.wixext</projectUrl>
10 <requireLicenseAcceptance>false</requireLicenseAcceptance>
11 <title>$title$</title>
12 <description>$description$</description>
13 <copyright>$copyright$</copyright>
14 <repository type="$repositorytype$" url="$repositoryurl$" commit="$repositorycommit$" />
15 </metadata>
16
17 <files>
18 <file src="$projectFolder$$id$.targets" target="build" />
19
20 <file src="netstandard2.0\$id$.dll" target="tools" />
21
22 <file src="x86\*.pdb" target="pdbs\x86" />
23 <file src="x64\*.pdb" target="pdbs\x64" />
24 <file src="ARM64\*.pdb" target="pdbs\ARM64" />
25 </files>
26</package>
diff --git a/src/ext/Bal/wixext/WixToolset.Bal.wixext.targets b/src/ext/Bal/wixext/WixToolset.Bal.wixext.targets
new file mode 100644
index 00000000..70c5a19c
--- /dev/null
+++ b/src/ext/Bal/wixext/WixToolset.Bal.wixext.targets
@@ -0,0 +1,11 @@
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 xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
5 <PropertyGroup>
6 <WixToolsetBalWixextPath Condition=" '$(WixToolsetBalWixextPath)' == '' ">$(MSBuildThisFileDirectory)..\tools\WixToolset.Bal.wixext.dll</WixToolsetBalWixextPath>
7 </PropertyGroup>
8 <ItemGroup>
9 <WixExtension Include="$(WixToolsetBalWixextPath)" />
10 </ItemGroup>
11</Project>
diff --git a/src/ext/Bal/wixlib/BalExtension_arm64.wxs b/src/ext/Bal/wixlib/BalExtension_arm64.wxs
new file mode 100644
index 00000000..1b9e11d2
--- /dev/null
+++ b/src/ext/Bal/wixlib/BalExtension_arm64.wxs
@@ -0,0 +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. -->
2
3
4<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
5 <?define platform=arm64 ?>
6 <?include BalExtension_platform.wxi ?>
7</Wix>
diff --git a/src/ext/Bal/wixlib/BalExtension_platform.wxi b/src/ext/Bal/wixlib/BalExtension_platform.wxi
new file mode 100644
index 00000000..33122fb2
--- /dev/null
+++ b/src/ext/Bal/wixlib/BalExtension_platform.wxi
@@ -0,0 +1,69 @@
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
4<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
5 <?include caDecor.wxi ?>
6 <Fragment>
7 <BootstrapperApplication Id="WixDotNetCoreBootstrapperApplicationHost$(var.Suffix)">
8 <BootstrapperApplicationDll Id="WixDotNetCoreBootstrapperApplicationHost" SourceFile="!(bindpath.$(var.platform))\dnchost.dll" />
9 <Payload SourceFile="!(bindpath.$(var.platform))\wixstdba.dll" Name="dncpreq.dll" />
10 <PayloadGroupRef Id="WixDotNetCoreBootstrapperApplicationHostManagedPayloads" />
11 </BootstrapperApplication>
12 </Fragment>
13 <Fragment>
14 <BootstrapperApplication Id="WixDotNetCoreBootstrapperApplicationHost.Standard$(var.Suffix)">
15 <PayloadGroupRef Id="DncPreqStandardPayloads" />
16 </BootstrapperApplication>
17 <BootstrapperApplicationRef Id="WixDotNetCoreBootstrapperApplicationHost$(var.Suffix)" />
18 </Fragment>
19
20 <Fragment>
21 <BootstrapperApplication Id="WixManagedBootstrapperApplicationHost$(var.Suffix)">
22 <BootstrapperApplicationDll Id="WixManagedBootstrapperApplicationHost" SourceFile="!(bindpath.$(var.platform))\mbahost.dll" />
23 <Payload SourceFile="!(bindpath.$(var.platform))\wixstdba.dll" Name="mbapreq.dll" />
24 <PayloadGroupRef Id="WixManagedBootstrapperApplicationHostManagedPayloads" />
25 </BootstrapperApplication>
26 </Fragment>
27 <Fragment>
28 <BootstrapperApplication Id="WixManagedBootstrapperApplicationHost.Standard$(var.Suffix)">
29 <PayloadGroupRef Id="MbaPreqStandardPayloads" />
30 </BootstrapperApplication>
31 <BootstrapperApplicationRef Id="WixManagedBootstrapperApplicationHost$(var.Suffix)" />
32 </Fragment>
33
34 <Fragment>
35 <BootstrapperApplication Id="WixStandardBootstrapperApplication$(var.Suffix)">
36 <BootstrapperApplicationDll Id="WixStandardBootstrapperApplication" SourceFile="!(bindpath.$(var.platform))\wixstdba.dll" />
37 </BootstrapperApplication>
38 </Fragment>
39 <Fragment>
40 <BootstrapperApplication Id="WixStandardBootstrapperApplication.RtfLicense$(var.Suffix)">
41 <PayloadGroupRef Id="WixStdbaRtfLicensePayloads" />
42 </BootstrapperApplication>
43 <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication$(var.Suffix)" />
44 </Fragment>
45 <Fragment>
46 <BootstrapperApplication Id="WixStandardBootstrapperApplication.RtfLargeLicense$(var.Suffix)">
47 <PayloadGroupRef Id="WixStdbaRtfLargeLicensePayloads" />
48 </BootstrapperApplication>
49 <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication$(var.Suffix)" />
50 </Fragment>
51 <Fragment>
52 <BootstrapperApplication Id="WixStandardBootstrapperApplication.HyperlinkLicense$(var.Suffix)">
53 <PayloadGroupRef Id="WixStdbaHyperlinkLicensePayloads" />
54 </BootstrapperApplication>
55 <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication$(var.Suffix)" />
56 </Fragment>
57 <Fragment>
58 <BootstrapperApplication Id="WixStandardBootstrapperApplication.HyperlinkLargeLicense$(var.Suffix)">
59 <PayloadGroupRef Id="WixStdbaHyperlinkLargeLicensePayloads" />
60 </BootstrapperApplication>
61 <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication$(var.Suffix)" />
62 </Fragment>
63 <Fragment>
64 <BootstrapperApplication Id="WixStandardBootstrapperApplication.HyperlinkSidebarLicense$(var.Suffix)">
65 <PayloadGroupRef Id="WixStdbaHyperlinkSidebarLicensePayloads" />
66 </BootstrapperApplication>
67 <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication$(var.Suffix)" />
68 </Fragment>
69</Include>
diff --git a/src/ext/Bal/wixlib/BalExtension_x64.wxs b/src/ext/Bal/wixlib/BalExtension_x64.wxs
new file mode 100644
index 00000000..69a597ae
--- /dev/null
+++ b/src/ext/Bal/wixlib/BalExtension_x64.wxs
@@ -0,0 +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. -->
2
3
4<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
5 <?define platform=x64 ?>
6 <?include BalExtension_platform.wxi ?>
7</Wix>
diff --git a/src/ext/Bal/wixlib/BalExtension_x86.wxs b/src/ext/Bal/wixlib/BalExtension_x86.wxs
new file mode 100644
index 00000000..3cdd4015
--- /dev/null
+++ b/src/ext/Bal/wixlib/BalExtension_x86.wxs
@@ -0,0 +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. -->
2
3
4<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
5 <?define platform=x86 ?>
6 <?include BalExtension_platform.wxi ?>
7</Wix>
diff --git a/src/ext/Bal/wixlib/Dnc.wxs b/src/ext/Bal/wixlib/Dnc.wxs
new file mode 100644
index 00000000..d777c473
--- /dev/null
+++ b/src/ext/Bal/wixlib/Dnc.wxs
@@ -0,0 +1,20 @@
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
4<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
5 <!--
6 Dnc.wxs - .NET Core BA resources.
7 -->
8 <Fragment>
9 <PayloadGroup Id="WixDotNetCoreBootstrapperApplicationHostManagedPayloads">
10 <Payload SourceFile="WixToolset.Dnc.Host.dll" />
11 </PayloadGroup>
12 </Fragment>
13 <Fragment>
14 <PayloadGroup Id="DncPreqStandardPayloads">
15 <Payload Name="mbapreq.thm" SourceFile="!(wix.DncPreqbaThemeXml=SourceDir\dncpreq.thm)" />
16 <Payload Name="mbapreq.png" SourceFile="!(wix.DncPreqbaLogo=SourceDir\mbapreq.png)" />
17 <Payload Name="mbapreq.wxl" SourceFile="!(wix.DncPreqbaThemeWxl=SourceDir\dncpreq.wxl)" />
18 </PayloadGroup>
19 </Fragment>
20</Wix>
diff --git a/src/ext/Bal/wixlib/Mba.wxs b/src/ext/Bal/wixlib/Mba.wxs
new file mode 100644
index 00000000..2d407c88
--- /dev/null
+++ b/src/ext/Bal/wixlib/Mba.wxs
@@ -0,0 +1,43 @@
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
4<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
5 <!--
6 Mba.wxs - Managed BA resources.
7 -->
8 <Fragment>
9 <PayloadGroup Id="WixManagedBootstrapperApplicationHostManagedPayloads">
10 <Payload SourceFile="WixToolset.Mba.Host.dll" />
11 </PayloadGroup>
12 </Fragment>
13 <Fragment>
14 <PayloadGroup Id="MbaPreqStandardPayloads">
15 <Payload Name="mbapreq.thm" SourceFile="!(wix.PreqbaThemeXml=SourceDir\mbapreq.thm)" />
16 <Payload Name="mbapreq.png" SourceFile="!(wix.PreqbaLogo=SourceDir\mbapreq.png)" />
17 <Payload Name="mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl=SourceDir\mbapreq.wxl)" />
18 <Payload Name="1028\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1028=SourceDir\1028\mbapreq.wxl)" />
19 <Payload Name="1029\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1029=SourceDir\1029\mbapreq.wxl)" />
20 <Payload Name="1030\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1030=SourceDir\1030\mbapreq.wxl)" />
21 <Payload Name="1031\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1031=SourceDir\1031\mbapreq.wxl)" />
22 <Payload Name="1032\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1032=SourceDir\1032\mbapreq.wxl)" />
23 <Payload Name="1035\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1035=SourceDir\1035\mbapreq.wxl)" />
24 <Payload Name="1036\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1036=SourceDir\1036\mbapreq.wxl)" />
25 <Payload Name="1038\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1038=SourceDir\1038\mbapreq.wxl)" />
26 <Payload Name="1040\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1040=SourceDir\1040\mbapreq.wxl)" />
27 <Payload Name="1041\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1041=SourceDir\1041\mbapreq.wxl)" />
28 <Payload Name="1042\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1042=SourceDir\1042\mbapreq.wxl)" />
29 <Payload Name="1043\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1043=SourceDir\1043\mbapreq.wxl)" />
30 <Payload Name="1044\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1044=SourceDir\1044\mbapreq.wxl)" />
31 <Payload Name="1045\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1045=SourceDir\1045\mbapreq.wxl)" />
32 <Payload Name="1046\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1046=SourceDir\1046\mbapreq.wxl)" />
33 <Payload Name="1049\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1049=SourceDir\1049\mbapreq.wxl)" />
34 <Payload Name="1051\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1051=SourceDir\1051\mbapreq.wxl)" />
35 <Payload Name="1053\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1053=SourceDir\1053\mbapreq.wxl)" />
36 <Payload Name="1055\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1055=SourceDir\1055\mbapreq.wxl)" />
37 <Payload Name="1060\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl1060=SourceDir\1060\mbapreq.wxl)" />
38 <Payload Name="2052\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl2052=SourceDir\2052\mbapreq.wxl)" />
39 <Payload Name="2070\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl2070=SourceDir\2070\mbapreq.wxl)" />
40 <Payload Name="3082\mbapreq.wxl" SourceFile="!(wix.PreqbaThemeWxl3082=SourceDir\3082\mbapreq.wxl)" />
41 </PayloadGroup>
42 </Fragment>
43</Wix>
diff --git a/src/ext/Bal/wixlib/bal.wixproj b/src/ext/Bal/wixlib/bal.wixproj
new file mode 100644
index 00000000..fdcc7475
--- /dev/null
+++ b/src/ext/Bal/wixlib/bal.wixproj
@@ -0,0 +1,36 @@
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" ToolsVersion="4.0">
3 <PropertyGroup>
4 <OutputType>Library</OutputType>
5 <BindFiles>true</BindFiles>
6 <Cultures>en-us</Cultures>
7 </PropertyGroup>
8 <ItemGroup>
9 <BindInputPaths Include="..\wixstdba\Resources\" />
10 <BindInputPaths Include="$(OutputPath)netcoreapp3.1" />
11 <BindInputPaths Include="$(OutputPath)net20" />
12 <BindInputPaths Include="$(OutputPath)x86" BindName="x86" />
13 <BindInputPaths Include="$(OutputPath)x64" BindName="x64" />
14 <BindInputPaths Include="$(OutputPath)arm64" BindName="arm64" />
15 </ItemGroup>
16 <ItemGroup>
17 <ProjectReference Include="..\dnchost\dnchost.vcxproj" Properties="Platform=ARM64" />
18 <ProjectReference Include="..\mbahost\mbahost.vcxproj" Properties="Platform=ARM64" />
19 <ProjectReference Include="..\wixstdba\wixstdba.vcxproj" Properties="Platform=ARM64" />
20 <ProjectReference Include="..\dnchost\dnchost.vcxproj" Properties="Platform=x86" />
21 <ProjectReference Include="..\mbahost\mbahost.vcxproj" Properties="Platform=x86" />
22 <ProjectReference Include="..\wixstdba\wixstdba.vcxproj" Properties="Platform=x86" />
23 <ProjectReference Include="..\dnchost\dnchost.vcxproj" Properties="Platform=x64" />
24 <ProjectReference Include="..\mbahost\mbahost.vcxproj" Properties="Platform=x64" />
25 <ProjectReference Include="..\wixstdba\wixstdba.vcxproj" Properties="Platform=x64" />
26 </ItemGroup>
27 <ItemGroup>
28 <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="All" />
29 </ItemGroup>
30 <!-- Workaround for bug in ProjectReferenceDefineConstants, they're not needed for this project anyway -->
31 <Target Name="ClearProjectReferenceDefineConstants" AfterTargets="CalculateDefineConstants">
32 <PropertyGroup>
33 <ProjectReferenceDefineConstants></ProjectReferenceDefineConstants>
34 </PropertyGroup>
35 </Target>
36</Project> \ No newline at end of file
diff --git a/src/ext/Bal/wixlib/caDecor.wxi b/src/ext/Bal/wixlib/caDecor.wxi
new file mode 100644
index 00000000..b1711518
--- /dev/null
+++ b/src/ext/Bal/wixlib/caDecor.wxi
@@ -0,0 +1,39 @@
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
4<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
5 <?ifdef Prefix ?>
6 <?undef Prefix ?>
7 <?endif?>
8
9 <?define Prefix="Wix4" ?>
10
11 <?ifndef platform ?>
12 <?define platform="x86" ?>
13 <?endif?>
14
15 <?if $(var.platform)="" ?>
16 <?undef platform ?>
17 <?define platform="x86" ?>
18 <?endif?>
19
20 <?ifdef Suffix ?>
21 <?undef Suffix ?>
22 <?endif?>
23
24 <?if $(var.platform)~="x86" ?>
25 <?define Suffix="_X86" ?>
26 <?endif?>
27
28 <?if $(var.platform)~="x64" ?>
29 <?define Suffix="_X64" ?>
30 <?endif?>
31
32 <?if $(var.platform)~="arm" ?>
33 <?define Suffix="_A32" ?>
34 <?endif?>
35
36 <?if $(var.platform)~="arm64" ?>
37 <?define Suffix="_A64" ?>
38 <?endif?>
39</Include>
diff --git a/src/ext/Bal/wixlib/wixstdba.wxs b/src/ext/Bal/wixlib/wixstdba.wxs
new file mode 100644
index 00000000..8181b9b4
--- /dev/null
+++ b/src/ext/Bal/wixlib/wixstdba.wxs
@@ -0,0 +1,92 @@
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
4<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
5 <!-- RTF License Payload Group -->
6 <Fragment>
7 <PayloadGroup Id="WixStdbaRtfLicensePayloads">
8 <Payload Name="thm.xml" Compressed="yes" SourceFile="!(wix.WixStdbaThemeXml=RtfTheme.xml)" />
9 <Payload Name="thm.wxl" Compressed="yes" SourceFile="!(wix.WixStdbaThemeWxl=RtfTheme.wxl)" />
10 <Payload Name="logo.png" Compressed="yes" SourceFile="!(wix.WixStdbaLogo=logo.png)" />
11
12 <Payload Name="!(wix.WixStdbaLicenseRtfName=license.rtf)" Compressed="yes" SourceFile="!(wix.WixStdbaLicenseRtf=LoremIpsumLicense.rtf)" />
13 </PayloadGroup>
14
15 <BundleCustomDataRef Id="WixStdbaInformation">
16 <BundleElement>
17 <BundleAttribute Id="LicenseFile" Value="!(wix.WixStdbaLicenseRtfName=license.rtf)" />
18 </BundleElement>
19 </BundleCustomDataRef>
20 </Fragment>
21
22 <!-- RTF Large License Payload Group -->
23 <Fragment>
24 <PayloadGroup Id="WixStdbaRtfLargeLicensePayloads">
25 <Payload Name="thm.xml" Compressed="yes" SourceFile="!(wix.WixStdbaThemeXml=RtfLargeTheme.xml)" />
26 <Payload Name="thm.wxl" Compressed="yes" SourceFile="!(wix.WixStdbaThemeWxl=RtfTheme.wxl)" />
27 <Payload Name="logo.png" Compressed="yes" SourceFile="!(wix.WixStdbaLogo=logo.png)" />
28
29 <Payload Name="!(wix.WixStdbaLicenseRtfName=license.rtf)" Compressed="yes" SourceFile="!(wix.WixStdbaLicenseRtf=LoremIpsumLicense.rtf)" />
30 </PayloadGroup>
31
32 <BundleCustomDataRef Id="WixStdbaInformation">
33 <BundleElement>
34 <BundleAttribute Id="LicenseFile" Value="!(wix.WixStdbaLicenseRtfName=license.rtf)" />
35 </BundleElement>
36 </BundleCustomDataRef>
37 </Fragment>
38
39 <!-- Hyperlink License Payload Group -->
40 <Fragment>
41 <PayloadGroup Id="WixStdbaHyperlinkLicensePayloads">
42 <Payload Name="thm.xml" Compressed="yes" SourceFile="!(wix.WixStdbaThemeXml=HyperlinkTheme.xml)" />
43 <Payload Name="thm.wxl" Compressed="yes" SourceFile="!(wix.WixStdbaThemeWxl=HyperlinkTheme.wxl)" />
44 <Payload Name="logo.png" Compressed="yes" SourceFile="!(wix.WixStdbaLogo=logo.png)" />
45 </PayloadGroup>
46
47 <BundleCustomDataRef Id="WixStdbaInformation">
48 <BundleElement>
49 <BundleAttribute Id="LicenseUrl" Value="!(wix.WixStdbaLicenseUrl)" />
50 </BundleElement>
51 </BundleCustomDataRef>
52 </Fragment>
53
54 <!-- Hyperlink Large License Payload Group -->
55 <Fragment>
56 <PayloadGroup Id="WixStdbaHyperlinkLargeLicensePayloads">
57 <Payload Name="thm.xml" Compressed="yes" SourceFile="!(wix.WixStdbaThemeXml=HyperlinkLargeTheme.xml)" />
58 <Payload Name="thm.wxl" Compressed="yes" SourceFile="!(wix.WixStdbaThemeWxl=HyperlinkTheme.wxl)" />
59 <Payload Name="logo.png" Compressed="yes" SourceFile="!(wix.WixStdbaLogo=logo.png)" />
60 </PayloadGroup>
61
62 <BundleCustomDataRef Id="WixStdbaInformation">
63 <BundleElement>
64 <BundleAttribute Id="LicenseUrl" Value="!(wix.WixStdbaLicenseUrl)" />
65 </BundleElement>
66 </BundleCustomDataRef>
67 </Fragment>
68
69 <!-- HyperlinkSidebar License Payload Group -->
70 <Fragment>
71 <PayloadGroup Id="WixStdbaHyperlinkSidebarLicensePayloads">
72 <Payload Name="thm.xml" Compressed="yes" SourceFile="!(wix.WixStdbaThemeXml=HyperlinkSidebarTheme.xml)" />
73 <Payload Name="thm.wxl" Compressed="yes" SourceFile="!(wix.WixStdbaThemeWxl=HyperlinkTheme.wxl)" />
74 <Payload Name="logo.png" Compressed="yes" SourceFile="!(wix.WixStdbaLogo=logo.png)" />
75 <Payload Name="logoside.png" Compressed="yes" SourceFile="!(wix.WixStdbaLogoSide=logoside.png)" />
76 </PayloadGroup>
77
78 <BundleCustomDataRef Id="WixStdbaInformation">
79 <BundleElement>
80 <BundleAttribute Id="LicenseUrl" Value="!(wix.WixStdbaLicenseUrl)" />
81 </BundleElement>
82 </BundleCustomDataRef>
83 </Fragment>
84
85 <!-- BootstrapperApplicationData tables definition -->
86 <Fragment>
87 <BundleCustomData Id="WixStdbaInformation">
88 <BundleAttributeDefinition Id="LicenseFile" />
89 <BundleAttributeDefinition Id="LicenseUrl" />
90 </BundleCustomData>
91 </Fragment>
92</Wix>
diff --git a/src/ext/Bal/wixstdba/Resources/1028/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1028/mbapreq.wxl
new file mode 100644
index 00000000..abd35ac7
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1028/mbapreq.wxl
@@ -0,0 +1,27 @@
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<WixLocalization Culture="zh-tw" Language="1028" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">[WixBundleName] 安裝程式</String>
7 <String Id="Title">[WixBundleName] 安裝程式需要 Microsoft .NET Framework</String>
8 <String Id="ConfirmCancelMessage">您確定要取消嗎?</String>
9 <String Id="HelpHeader">安裝程式說明</String>
10 <String Id="HelpText">/passive | /quiet - 顯示最基本的 UI 但不顯示提示,或者不顯示 UI 也
11 不顯示提示。預設會顯示 UI 和所有提示。
12
13/norestart - 隱藏任何重新啟動嘗試。根據預設,UI 會在重新啟動之前提示。
14/log log.txt - 記錄至特定檔案。預設會在 %TEMP% 建立記錄檔。</String>
15 <String Id="HelpCloseButton">關閉(&amp;C)</String>
16 <String Id="InstallLicenseTerms">請按一下 「接受並安裝」5D; 按鈕,接受 Microsoft .NET Framework &lt;a href="#"&gt;授權合約&lt;/a&gt;。</String>
17 <String Id="InstallAcceptAndInstallButton">接受並安裝(&amp;A)</String>
18 <String Id="InstallDeclineButton">拒絕(&amp;D)</String>
19 <String Id="ProgressHeader">安裝進度</String>
20 <String Id="ProgressLabel">正在處理:</String>
21 <String Id="ProgressCancelButton">取消(&amp;)</String>
22 <String Id="FailureHeader">安裝失敗</String>
23 <String Id="FailureLogLinkText">一或多個問題導致安裝失敗。請修正這些問題,然後再重試安裝。如需詳細資訊,請查看&lt;a href="#"&gt;記錄檔&lt;/a&gt;。</String>
24 <String Id="FailureRestartText">必須重新啟動電腦,才能完成軟體的復原。</String>
25 <String Id="FailureRestartButton">重新啟動(&amp;R)</String>
26 <String Id="FailureCloseButton">關閉(&amp;C)</String>
27</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1029/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1029/mbapreq.wxl
new file mode 100644
index 00000000..e28b4f74
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1029/mbapreq.wxl
@@ -0,0 +1,30 @@
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<WixLocalization Culture="cs-cz" Language="1029" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">Instalace produktu [WixBundleName]</String>
7 <String Id="Title">Pro instalaci produktu [WixBundleName] je vyžadováno rozhraní Microsoft .NET Framework.</String>
8 <String Id="ConfirmCancelMessage">Opravdu chcete akci zrušit?</String>
9 <String Id="HelpHeader">Nápověda k instalaci</String>
10 <String Id="HelpText">/passive | /quiet - Zobrazí minimální uživatelské rozhraní bez jakýchkoli
11 výzev, nebo nezobrazí žádné uživatelské rozhraní ani žádné výzvy. Ve výchozím
12 nastavení se jak uživatelské rozhraní, tak i všechny výzvy zobrazují.
13
14/norestart - Potlačí jakékoli pokusy o restartování. Ve výchozím nastavení
15 se v uživatelském rozhraní před restartováním zobrazí výzva.
16/log log.txt - Nastaví, že se má zapisovat do konkrétního souboru protokolu.
17 Ve výchozím nastavení je soubor protokolu vytvořen v umístění %TEMP%.</String>
18 <String Id="HelpCloseButton">&amp;Zavřít</String>
19 <String Id="InstallLicenseTerms">Kliknutím na tlačítko Přijmout a nainstalovat přijmete &lt;a href="#"&gt;licenční podmínky&lt;/a&gt; rozhraní Microsoft .NET Framework.</String>
20 <String Id="InstallAcceptAndInstallButton">&amp;Přijmout a instalovat</String>
21 <String Id="InstallDeclineButton">&amp;Odmítnout</String>
22 <String Id="ProgressHeader">Průběh instalace</String>
23 <String Id="ProgressLabel">Probíhá zpracování:</String>
24 <String Id="ProgressCancelButton">&amp;Storno</String>
25 <String Id="FailureHeader">Instalace se nezdařila</String>
26 <String Id="FailureLogLinkText">Byly zjištěny problémy, kvůli kterým se instalaci nepodařilo dokončit. Odstraňte tyto problémy a potom instalaci opakujte. Další informace naleznete v &lt;a href="#"&gt;souboru protokolu&lt;/a&gt;.</String>
27 <String Id="FailureRestartText">Aby bylo možné zrušení instalace softwaru dokončit, je nutné počítač restartovat.</String>
28 <String Id="FailureRestartButton">&amp;Restartovat</String>
29 <String Id="FailureCloseButton">&amp;Zavřít</String>
30</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1030/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1030/mbapreq.wxl
new file mode 100644
index 00000000..a531467a
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1030/mbapreq.wxl
@@ -0,0 +1,30 @@
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<WixLocalization Culture="da-dk" Language="1030" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">Installation af [WixBundleName]</String>
7 <String Id="Title">Microsoft .NET Framework skal være installeret i forbindelse med Installationen af [WixBundleName]</String>
8 <String Id="ConfirmCancelMessage">Er du sikker på, at du vil annullere?</String>
9 <String Id="HelpHeader">Hjælp til installation</String>
10 <String Id="HelpText">/passive | /quiet - viser en minimal brugergrænseflade uden prompter eller
11 viser ingen brugergrænseflade og ingen prompter.
12 Brugergrænsefladen og alle prompter vises som standard.
13
14/norestart - skjuler forsøg på genstart. Der vises som standard en
15 forespørgsel i brugergrænsefladen, før der genstartes.
16/log log.txt - logfører til en bestemt fil. Der oprettes som standard en
17 logfil i %TEMP%.</String>
18 <String Id="HelpCloseButton">&amp;Luk</String>
19 <String Id="InstallLicenseTerms">Klik på knappen "Acceptér og installér" for at acceptere &lt;a href="#"&gt;licensvilkårene&lt;/a&gt; for Microsoft .NET Framework.</String>
20 <String Id="InstallAcceptAndInstallButton">&amp;Acceptér og installér</String>
21 <String Id="InstallDeclineButton">&amp;Afvis</String>
22 <String Id="ProgressHeader">Status for installation</String>
23 <String Id="ProgressLabel">Behandler:</String>
24 <String Id="ProgressCancelButton">&amp;Annuller</String>
25 <String Id="FailureHeader">Installationen blev ikke gennemført</String>
26 <String Id="FailureLogLinkText">Installationen blev ikke gennemført på grund af et eller flere problemer. Løs problemerne, og prøv derefter at installere igen. Se &lt;a href="#"&gt;logfilen&lt;/a&gt; for at få flere oplysninger.</String>
27 <String Id="FailureRestartText">Du skal genstarte computeren for at fuldføre annulleringen af opdateringen af softwaren.</String>
28 <String Id="FailureRestartButton">&amp;Genstart</String>
29 <String Id="FailureCloseButton">&amp;Luk</String>
30</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1031/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1031/mbapreq.wxl
new file mode 100644
index 00000000..ff8111f9
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1031/mbapreq.wxl
@@ -0,0 +1,33 @@
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<WixLocalization Culture="de-de" Language="1031" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <UI Control="InstallButton" Width="180" />
7
8 <String Id="Caption">[WixBundleName]-Setup</String>
9 <String Id="Title">Für das [WixBundleName]-Setup ist Microsoft .NET Framework erforderlich.</String>
10 <String Id="ConfirmCancelMessage">Sind Sie sicher, dass Sie den Vorgang abbrechen möchten?</String>
11 <String Id="HelpHeader">Setup-Hilfe</String>
12 <String Id="HelpText">/passive | /quiet - zeigt eine minimale Benutzeroberfläche ohne
13 Eingabeaufforderungen oder keine Benutzeroberfläche und keine
14 Eingabeaufforderungen an. Standardmäßig werden die Benutzeroberfläche und
15 alle Eingabeaufforderungen angezeigt.
16
17/norestart - unterdrückt alle Neustartversuche. Standardmäßig fordert die
18 Benutzeroberfläche zum Bestätigen eines Neustarts auf.
19/log log.txt - erstellt das Protokoll in einer bestimmten Datei.
20 Standardmäßig wird die Protokolldatei in "%TEMP%" erstellt.</String>
21 <String Id="HelpCloseButton">&amp;Schließen</String>
22 <String Id="InstallLicenseTerms">Klicken Sie auf die Schaltfläche "Akzeptieren und installieren", um den Microsoft .NET Framework &lt;a href="#"&gt;-Lizenzbedingungen&lt;/a&gt; zuzustimmen.</String>
23 <String Id="InstallAcceptAndInstallButton">&amp;Akzeptieren und installieren</String>
24 <String Id="InstallDeclineButton">&amp;Ablehnen</String>
25 <String Id="ProgressHeader">Setup-Status</String>
26 <String Id="ProgressLabel">Verarbeitung:</String>
27 <String Id="ProgressCancelButton">&amp;Abbrechen</String>
28 <String Id="FailureHeader">Setup-Fehler</String>
29 <String Id="FailureLogLinkText">Beim Setup ist aufgrund mindestens eines Problems ein Fehler aufgetreten. Beheben Sie die Probleme, und wiederholen Sie das Setup. Weitere Informationen finden Sie in der &lt;a href="#"&gt;Protokolldatei&lt;/a&gt;.</String>
30 <String Id="FailureRestartText">Sie müssen den Computer neu starten, um das Zurücksetzen der Software abzuschließen.</String>
31 <String Id="FailureRestartButton">&amp;Neu starten</String>
32 <String Id="FailureCloseButton">&amp;Schließen</String>
33</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1032/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1032/mbapreq.wxl
new file mode 100644
index 00000000..bc3703a3
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1032/mbapreq.wxl
@@ -0,0 +1,32 @@
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<WixLocalization Culture="el-gr" Language="1032" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">Εγκατάσταση του [WixBundleName]</String>
7 <String Id="Title">Για την εγκατάσταση του [WixBundleName] απαιτείται το Microsoft .NET Framework</String>
8 <String Id="ConfirmCancelMessage">Είστε βέβαιοι ότι θέλετε να γίνει ακύρωση;</String>
9 <String Id="HelpHeader">Βοήθεια για την εγκατάσταση</String>
10 <String Id="HelpText">/passive | /quiet - εμφανίζει ελάχιστο περιεχόμενο του περιβάλλοντος εργασίας
11 χρήστη χωρίς μηνύματα ή δεν εμφανίζει περιβάλλον εργασίας χρήστη και
12 μηνύματα. Από προεπιλογή, εμφανίζονται όλα τα μηνύματα και το περιβάλλον
13 εργασίας χρήστη.
14
15/norestart - αποκρύπτει οποιεσδήποτε προσπάθειες για επανεκκίνηση. Από
16 προεπιλογή, το περιβάλλον εργασίας χρήστη θα εμφανίσει μήνυμα πριν από την
17 επανεκκίνηση.
18/log log.txt - πραγματοποιεί καταγραφή σε ένα συγκεκριμένο αρχείο. Από
19 προεπιλογή, δημιουργείται ένα αρχείο καταγραφής στο %TEMP%.</String>
20 <String Id="HelpCloseButton">&amp;Κλείσιμο</String>
21 <String Id="InstallLicenseTerms">Κάντε κλικ στο κουμπί "Αποδοχή και εγκατάσταση" για να αποδεχτείτε τους &lt;a href="#"&gt;όρους της άδειας χρήσης&lt;/a&gt; του Microsoft .NET Framework.</String>
22 <String Id="InstallAcceptAndInstallButton">&amp;Αποδοχή και εγκατάσταση</String>
23 <String Id="InstallDeclineButton">&amp;Απόρριψη</String>
24 <String Id="ProgressHeader">Πρόοδος εγκατάστασης</String>
25 <String Id="ProgressLabel">Επεξεργασία:</String>
26 <String Id="ProgressCancelButton">&amp;Άκυρο</String>
27 <String Id="FailureHeader">Αποτυχία εγκατάστασης</String>
28 <String Id="FailureLogLinkText">Ένα ή περισσότερα προβλήματα προκάλεσαν την αποτυχία της εγκατάστασης. Διορθώστε τα προβλήματα και μετά επαναλάβετε την εγκατάσταση. Για περισσότερες πληροφορίες, ανατρέξτε στο &lt;a href="#"&gt;αρχείο καταγραφής&lt;/a&gt;.</String>
29 <String Id="FailureRestartText">Για να ολοκληρωθεί η επαναφορά του λογισμικού, πρέπει να κάνετε επανεκκίνηση του υπολογιστή.</String>
30 <String Id="FailureRestartButton">&amp;Επανεκκίνηση</String>
31 <String Id="FailureCloseButton">&amp;Κλείσιμο</String>
32</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1035/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1035/mbapreq.wxl
new file mode 100644
index 00000000..859e5b23
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1035/mbapreq.wxl
@@ -0,0 +1,30 @@
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<WixLocalization Culture="fi-fi" Language="1035" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">[WixBundleName] -asennus</String>
7 <String Id="Title">Microsoft .NET Framework tarvitaan [WixBundleName] -asennusta varten</String>
8 <String Id="ConfirmCancelMessage">Haluatko varmasti peruuttaa?</String>
9 <String Id="HelpHeader">Asennusohjelman ohje</String>
10 <String Id="HelpText">/passive | /quiet - näyttää mahdollisimman vähän käyttöliittymästä; ei
11 kehotteita tai ei käyttöliittymää ja kehotteita. Oletusarvoisesti
12 käyttöliittymä ja kaikki kehotteet näytetään.
13
14/norestart - estää uudelleenkäynnistysyritykset. Oletusarvoisesti
15 käyttöliittymä kysyy ennen uudelleenkäynnistystä.
16/log loki.txt - kirjaa lokitiedot erityiseen tiedostoon. Oletusarvoisesti
17 lokitiedosto luodaan %TEMP%-kansioon.</String>
18 <String Id="HelpCloseButton">&amp;Sulje</String>
19 <String Id="InstallLicenseTerms">Hyväksy Microsoft .NET Framework -ohjelman &lt;a href="#"&gt;käyttöoikeusehdot&lt;/a&gt; valitsemalla Hyväksy ja asenna.</String>
20 <String Id="InstallAcceptAndInstallButton">&amp;Hyväksy ja asenna</String>
21 <String Id="InstallDeclineButton">&amp;Hylkää</String>
22 <String Id="ProgressHeader">Asennuksen edistyminen</String>
23 <String Id="ProgressLabel">Käsitellään:</String>
24 <String Id="ProgressCancelButton">&amp;Peruuta</String>
25 <String Id="FailureHeader">Asennus epäonnistui</String>
26 <String Id="FailureLogLinkText">Asennus epäonnistui yhdestä tai useammasta syystä. Korjaa ongelmat ja yritä suorittaa asennus sitten uudelleen. Lisätietoja on &lt;a href="#"&gt;lokitiedostossa&lt;/a&gt;.</String>
27 <String Id="FailureRestartText">Tietokone täytyy käynnistää uudelleen ohjelmiston palautuksen viimeistelemiseksi.</String>
28 <String Id="FailureRestartButton">&amp;Käynnistä uudelleen</String>
29 <String Id="FailureCloseButton">&amp;Sulje</String>
30</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1036/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1036/mbapreq.wxl
new file mode 100644
index 00000000..f67dfa8e
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1036/mbapreq.wxl
@@ -0,0 +1,30 @@
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<WixLocalization Culture="fr-fr" Language="1036" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">Installation de [WixBundleName]</String>
7 <String Id="Title">Microsoft .NET Framework requis pour l'installation de [WixBundleName]</String>
8 <String Id="ConfirmCancelMessage">Êtes-vous sûr de vouloir annuler ?</String>
9 <String Id="HelpHeader">Aide de l'installation</String>
10 <String Id="HelpText">/passive | /quiet - affiche une interface minimale sans invites ou n'affiche
11 aucune interface ni aucune invite. Par défaut, l'interface et toutes les
12 invites sont affichées.
13
14/norestart - annule toute tentative de redémarrage. Par défaut, l'interface
15 affiche une invite avant de redémarrer.
16/log journal.txt - consigne les entrées de journal dans un fichier spécifique.
17 Par défaut, un fichier journal est créé dans %TEMP%.</String>
18 <String Id="HelpCloseButton">&amp;Fermer</String>
19 <String Id="InstallLicenseTerms">Cliquez sur le bouton « Accepter et installer » pour accepter les &lt;a href="#"&gt;termes du contrat de licence&lt;/a&gt; Microsoft .NET Framework.</String>
20 <String Id="InstallAcceptAndInstallButton">&amp;Accepter et installer</String>
21 <String Id="InstallDeclineButton">&amp;Refuser</String>
22 <String Id="ProgressHeader">Progression de l'installation</String>
23 <String Id="ProgressLabel">Traitement en cours :</String>
24 <String Id="ProgressCancelButton">&amp;Annuler</String>
25 <String Id="FailureHeader">L'installation a échoué</String>
26 <String Id="FailureLogLinkText">L'installation a échoué pour une ou plusieurs raisons. Corrigez les problèmes et recommencez l'installation. Pour plus d'informations, consultez le &lt;a href="#"&gt;fichier journal&lt;/a&gt;.</String>
27 <String Id="FailureRestartText">Vous devez redémarrer votre ordinateur pour effectuer la restauration du logiciel.</String>
28 <String Id="FailureRestartButton">&amp;Redémarrer</String>
29 <String Id="FailureCloseButton">&amp;Fermer</String>
30</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1038/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1038/mbapreq.wxl
new file mode 100644
index 00000000..6a4b109d
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1038/mbapreq.wxl
@@ -0,0 +1,30 @@
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<WixLocalization Culture="hu-hu" Language="1038" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">[WixBundleName] telepítő</String>
7 <String Id="Title">A(z) [WixBundleName] telepítéséhez Microsoft .NET-keretrendszer szükséges</String>
8 <String Id="ConfirmCancelMessage">Biztosan megszakítja?</String>
9 <String Id="HelpHeader">A telepítő súgója</String>
10 <String Id="HelpText">/passive | /quiet - Minimális felhasználói felület megjelenítése kérdések
11 nélkül, illetve felhasználói felület és kérdések megjelenítése nélküli
12 telepítés. Alapesetben a felhasználói felület és minden kérdés megjelenik.
13
14/norestart - Az újraindítási kérések elrejtése. Alapesetben a felhasználói
15 felületen megjelennek az újraindítási kérések.
16/log naplo.txt - Naplózás a megadott fájlba. Alapesetben a naplófájl a %TEMP%
17 könyvtárban jön létre.</String>
18 <String Id="HelpCloseButton">&amp;Bezárás</String>
19 <String Id="InstallLicenseTerms">A Microsoft .NET-keretrendszer &lt;a href="#"&gt;licencszerződésének&lt;/a&gt; elfogadásához kattintson az „Elfogadás és telepítés” gombra.</String>
20 <String Id="InstallAcceptAndInstallButton">&amp;Elfogadás és telepítés</String>
21 <String Id="InstallDeclineButton">&amp;Elutasítás</String>
22 <String Id="ProgressHeader">Telepítési folyamat</String>
23 <String Id="ProgressLabel">Feldolgozás:</String>
24 <String Id="ProgressCancelButton">&amp;Mégse</String>
25 <String Id="FailureHeader">A telepítés nem sikerült</String>
26 <String Id="FailureLogLinkText">Legalább egy olyan hiba lépett fel, amely a telepítés meghiúsulását okozta. Hárítsa el a hibákat, majd futtassa újra a telepítőt. További információt a &lt;a href="#"&gt;naplófájlban &lt;/a&gt; talál.</String>
27 <String Id="FailureRestartText">A szoftver visszaállításának befejezéséhez újra kell indítania a számítógépet.</String>
28 <String Id="FailureRestartButton">&amp;Újraindítás</String>
29 <String Id="FailureCloseButton">&amp;Bezárás</String>
30</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1040/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1040/mbapreq.wxl
new file mode 100644
index 00000000..f57d58e5
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1040/mbapreq.wxl
@@ -0,0 +1,31 @@
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<WixLocalization Culture="it-it" Language="1040" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">Installazione di [WixBundleName]</String>
7 <String Id="Title">Microsoft .NET Framework necessario per l'installazione di [WixBundleName]</String>
8 <String Id="ConfirmCancelMessage">Annullare?</String>
9 <String Id="HelpHeader">Guida dell'installazione</String>
10 <String Id="HelpText">/passive | /quiet - visualizza l'interfaccia utente minima senza istruzioni
11 oppure non visualizza né l'interfaccia utente né le istruzioni. Per
12 impostazione predefinita vengono visualizzate interfaccia utente e
13 istruzioni.
14
15/norestart - elimina eventuali tentativi di riavvio. Per impostazione
16 predefinita l'interfaccia utente chiede istruzioni prima del riavvio.
17/log log.txt - registra in un file specifico. Per impostazione predefinita un
18 file di log viene creato in %TEMP%.</String>
19 <String Id="HelpCloseButton">&amp;Chiudi</String>
20 <String Id="InstallLicenseTerms">Fare clic sul pulsante "Accetta e installa" per accettare le &lt;a href="#"&gt;condizioni di licenza&lt;/a&gt; di Microsoft .NET Framework.</String>
21 <String Id="InstallAcceptAndInstallButton">&amp;Accetta e installa</String>
22 <String Id="InstallDeclineButton">&amp;Rifiuta</String>
23 <String Id="ProgressHeader">Stato installazione</String>
24 <String Id="ProgressLabel">Elaborazione in corso:</String>
25 <String Id="ProgressCancelButton">&amp;Annulla</String>
26 <String Id="FailureHeader">Installazione non riuscita</String>
27 <String Id="FailureLogLinkText">L'installazione non è riuscita a causa di uno o più problemi. Risolvere i problemi e provare di nuovo l'installazione. Per ulteriori informazioni vedere il &lt;a href="#"&gt;file di log&lt;/a&gt;.</String>
28 <String Id="FailureRestartText">È necessario riavviare il computer per completare il rollback del software.</String>
29 <String Id="FailureRestartButton">&amp;Riavvia</String>
30 <String Id="FailureCloseButton">&amp;Chiudi</String>
31</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1041/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1041/mbapreq.wxl
new file mode 100644
index 00000000..3fe7b9b3
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1041/mbapreq.wxl
@@ -0,0 +1,27 @@
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<WixLocalization Culture="ja-jp" Language="1041" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">[WixBundleName] セットアップ</String>
7 <String Id="Title">[WixBundleName] セットアップには Microsoft .NET Framework が必要です</String>
8 <String Id="ConfirmCancelMessage">取り消しますか?</String>
9 <String Id="HelpHeader">セットアップのヘルプ</String>
10 <String Id="HelpText">/passive | /quiet - 最小の UI だけを表示してプロンプトは表示しないか、UI
11 もプロンプトも表示しません。 既定では、UI とすべてのプロンプトが表示されます。
12
13/norestart - 再起動の試みをすべて抑制します。既定では、再起動の前に UI によりプロンプトが表示されます。
14/log log.txt - 特定のファイルにログを記録します。既定では、%TEMP% にログ ファイルが作成されます。</String>
15 <String Id="HelpCloseButton">閉じる(&amp;C)</String>
16 <String Id="InstallLicenseTerms">Microsoft .NET Framework の&lt;a href="#"&gt;ライセンス条項&lt;/a&gt;に同意する場合は、[同意してインストール]5D; ボタンをクリックします。</String>
17 <String Id="InstallAcceptAndInstallButton">同意してインストール(&amp;A)</String>
18 <String Id="InstallDeclineButton">同意しない(&amp;)</String>
19 <String Id="ProgressHeader">セットアップの進行状況</String>
20 <String Id="ProgressLabel">処理中:</String>
21 <String Id="ProgressCancelButton">キャンセル(&amp;C)</String>
22 <String Id="FailureHeader">セットアップに失敗しました</String>
23 <String Id="FailureLogLinkText">1 つ以上の問題が原因でセットアップに失敗しました。問題を解決してからセットアップをやり直してください。詳細については、&lt;a href="#"&gt;ログ ファイル&lt;/a&gt;を参照してください。</String>
24 <String Id="FailureRestartText">ソフトウェアのロールバックを完了するには、コンピューターを再起動する必要があります。</String>
25 <String Id="FailureRestartButton">再起動(&amp;R)</String>
26 <String Id="FailureCloseButton">閉じる(&amp;C)</String>
27</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1042/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1042/mbapreq.wxl
new file mode 100644
index 00000000..0f53dcc3
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1042/mbapreq.wxl
@@ -0,0 +1,27 @@
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<WixLocalization Culture="ko-kr" Language="1042" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">[WixBundleName] 설치</String>
7 <String Id="Title">[WixBundleName] 설치에 필요한 Microsoft .NET Framework</String>
8 <String Id="ConfirmCancelMessage">취소하시겠습니까?</String>
9 <String Id="HelpHeader">설치 도움말</String>
10 <String Id="HelpText">/passive | /quiet - 메시지 없이 최소 UI를 표시하거나 UI와 메시지를 전혀
11 표시하지 않습니다. 기본적으로 UI 및 모든 메시지는 표시됩니다.
12
13/norestart - 다시 시작하려는 시도를 무시합니다. 기본적으로 UI는 다시 시작하기 전에 메시지를 표시합니다.
14/log log.txt - 특정 파일에 기록합니다. 기본적으로 로그 파일이 %TEMP%에 생성됩니다.</String>
15 <String Id="HelpCloseButton">닫기(&amp;C)</String>
16 <String Id="InstallLicenseTerms">Microsoft .NET Framework &lt;a href="#"&gt;사용 조건&lt;/a&gt;에 동의하려면 "동의 및 설치"를 클릭하십시오.</String>
17 <String Id="InstallAcceptAndInstallButton">동의 및 설치(&amp;A)</String>
18 <String Id="InstallDeclineButton">동의 안 함(&amp;D)</String>
19 <String Id="ProgressHeader">설치 진행률</String>
20 <String Id="ProgressLabel">처리 중:</String>
21 <String Id="ProgressCancelButton">취소(&amp;C)</String>
22 <String Id="FailureHeader">설치 실패</String>
23 <String Id="FailureLogLinkText">하나 이상의 문제로 인해 설치에 실패했습니다. 문제를 수정하고 설치를 다시 시도하십시오. 자세한 내용은 &lt;a href="#"&gt;로그 파일&lt;/a&gt;을 참조하십시오.</String>
24 <String Id="FailureRestartText">소프트웨어의 롤백을 완료하려면 컴퓨터를 다시 시작해야 합니다.</String>
25 <String Id="FailureRestartButton">다시 시작(&amp;R)</String>
26 <String Id="FailureCloseButton">닫기(&amp;C)</String>
27</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1043/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1043/mbapreq.wxl
new file mode 100644
index 00000000..f4a2c78c
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1043/mbapreq.wxl
@@ -0,0 +1,30 @@
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<WixLocalization Culture="nl-nl" Language="1043" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">[WixBundleName] Installatie</String>
7 <String Id="Title">Microsoft .NET Framework is vereist voor installatie [WixBundleName]</String>
8 <String Id="ConfirmCancelMessage">Weet u zeker dat u de installatie wilt annuleren?</String>
9 <String Id="HelpHeader">Help bij Setup</String>
10 <String Id="HelpText">/passive | /quiet - geeft een minimale gebruikersinterface weer zonder prompts
11 of geeft geen gebruikersinterface en geen prompts weer. Gebruikersinterface
12 en alle prompts worden standaard weergegeven.
13
14/norestart - pogingen tot opnieuw opstarten onderdrukken.
15 Gebruikersinterface vraagt standaard alvorens opnieuw op te starten.
16/log log.txt - registreert gegevens in een specifiek bestand. Een logbestand
17 wordt standaard in %TEMP% gemaakt.</String>
18 <String Id="HelpCloseButton">&amp;Sluiten</String>
19 <String Id="InstallLicenseTerms">Klik op de knop 'Accepteren en installeren' om de &lt;a href="#"&gt;licentievoorwaarden&lt;/a&gt; van het Microsoft .NET Framework te accepteren.</String>
20 <String Id="InstallAcceptAndInstallButton">&amp;Accepteren en installeren</String>
21 <String Id="InstallDeclineButton">&amp;Weigeren</String>
22 <String Id="ProgressHeader">Voortgang van de installatie</String>
23 <String Id="ProgressLabel">Verwerken:</String>
24 <String Id="ProgressCancelButton">&amp;Annuleren</String>
25 <String Id="FailureHeader">Installatie mislukt</String>
26 <String Id="FailureLogLinkText">Er zijn een of meer fouten opgetreden waardoor de installatie is mislukt. Corrigeer de problemen en voer Setup opnieuw uit. Raadpleeg het &lt;a href="#"&gt;log boekbestand&lt;/a&gt; voor meer informatie.</String>
27 <String Id="FailureRestartText">U moet uw computer opnieuw opstarten om het terugdraaien van de software te voltooien.</String>
28 <String Id="FailureRestartButton">&amp;Opnieuw opstarten</String>
29 <String Id="FailureCloseButton">&amp;Sluiten</String>
30</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1044/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1044/mbapreq.wxl
new file mode 100644
index 00000000..da5c8283
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1044/mbapreq.wxl
@@ -0,0 +1,30 @@
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<WixLocalization Culture="nb-no" Language="1044" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">[WixBundleName] Installasjonsprogram</String>
7 <String Id="Title">Microsoft .NET Framework kreves for [WixBundleName]-installasjon</String>
8 <String Id="ConfirmCancelMessage">Er du sikker på at du vil avbryte?</String>
9 <String Id="HelpHeader">Installasjonshjelp</String>
10 <String Id="HelpText">/passive | /quiet - viser minimalt brukergrensesnitt uten ledetekster, eller
11 ikke noe brukergrensesnitt og ingen ledetekster. Som standard vises
12 brukergrensesnitt og alle ledetekster.
13
14/norestart - undertrykker alle forsøk på omstart. Som standard spør
15 brukergrensesnittet før omstart.
16/log log.txt - skriver logg til en bestemt fil. Som standard opprettes en
17 loggfil i %TEMP%.</String>
18 <String Id="HelpCloseButton">&amp;Lukk</String>
19 <String Id="InstallLicenseTerms">Klikk Godta og installer for å godta&lt;a href="#"&gt;lisensvilkårene&lt;/a&gt; for Microsoft .NET Framework.</String>
20 <String Id="InstallAcceptAndInstallButton">&amp;Godta og installer</String>
21 <String Id="InstallDeclineButton">&amp;Avslå</String>
22 <String Id="ProgressHeader">Fremdrift for installasjon</String>
23 <String Id="ProgressLabel">Behandler:</String>
24 <String Id="ProgressCancelButton">&amp;Avbryt</String>
25 <String Id="FailureHeader">Installasjon mislyktes</String>
26 <String Id="FailureLogLinkText">Ett eller flere problemer var årsak til at installasjonen mislyktes. Løs problemene, og installer på nytt. Du finner flere opplysninger i &lt;a href="#"&gt;loggfilen&lt;/a&gt;.</String>
27 <String Id="FailureRestartText">Du må starte datamaskinen på nytt for å fullføre tilbakerullingen av programvaren.</String>
28 <String Id="FailureRestartButton">&amp;Start på nytt</String>
29 <String Id="FailureCloseButton">&amp;Lukk</String>
30</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1045/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1045/mbapreq.wxl
new file mode 100644
index 00000000..7aca87c2
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1045/mbapreq.wxl
@@ -0,0 +1,30 @@
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<WixLocalization Culture="pl-pl" Language="1045" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">Instalator programu [WixBundleName]</String>
7 <String Id="Title">Do zainstalowania programu [WixBundleName] jest wymagany program Microsoft .NET Framework</String>
8 <String Id="ConfirmCancelMessage">Czy na pewno chcesz anulować?</String>
9 <String Id="HelpHeader">Pomoc instalatora</String>
10 <String Id="HelpText">/passive | /quiet - wyświetla minimalny interfejs użytkownika bez monitów
11 lub nie wyświetla interfejsu użytkownika ani monitów. Domyślnie jest
12 wyświetlany interfejs użytkownika i wszystkie monity.
13
14/norestart - pomija wszelkie próby ponownego uruchomienia. Domyślnie
15 interfejs użytkownika będzie wyświetlał monit przed ponownym uruchomieniem.
16/log log.txt - zapisuje wpisy dziennika do określonego pliku.
17 Domyślnie plik dziennika jest tworzony w folderze %TEMP%.</String>
18 <String Id="HelpCloseButton">&amp;Zamknij</String>
19 <String Id="InstallLicenseTerms">Kliknij przycisk Zaakceptuj i zainstaluj, aby zaakceptować &lt;a href="#"&gt;warunki licencji&lt;/a&gt; programu Microsoft .NET Framework.</String>
20 <String Id="InstallAcceptAndInstallButton">&amp;Zaakceptuj i zainstaluj</String>
21 <String Id="InstallDeclineButton">&amp;Odrzuć</String>
22 <String Id="ProgressHeader">Postęp instalacji</String>
23 <String Id="ProgressLabel">Trwa przetwarzanie:</String>
24 <String Id="ProgressCancelButton">&amp;Anuluj</String>
25 <String Id="FailureHeader">Instalacja nie powiodła się</String>
26 <String Id="FailureLogLinkText">Co najmniej jeden problem spowodował niepowodzenie instalacji. Usuń problemy, a następnie ponów próbę instalacji. Aby uzyskać więcej informacji można znaleźć w &lt;a href="#"&gt;pliku dziennika&lt;/a&gt;.</String>
27 <String Id="FailureRestartText">Aby zakończyć wycofywanie oprogramowania, musisz ponownie uruchomić komputer.</String>
28 <String Id="FailureRestartButton">&amp;Uruchom ponownie</String>
29 <String Id="FailureCloseButton">&amp;Zamknij</String>
30</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1046/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1046/mbapreq.wxl
new file mode 100644
index 00000000..be185502
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1046/mbapreq.wxl
@@ -0,0 +1,29 @@
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<WixLocalization Culture="pt-br" Language="1046" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">[WixBundleName] Instalação</String>
7 <String Id="Title">Microsoft .NET Framework é necessário para instalação do [WixBundleName]</String>
8 <String Id="ConfirmCancelMessage">Tem certeza de que deseja cancelar?</String>
9 <String Id="HelpHeader">Ajuda da Instalação</String>
10 <String Id="HelpText">/passive | /quiet - exibe UI mínima sem avisos ou exibe sem UI e
11 sem avisos. Por padrão a UI e todos avisos são exibidos.
12
13/norestart - suprime qualquer tentativa de reinicialização. Por padrão a UI
14 irá solicitar antes de reiniciar.
15/log log.txt - logs para um arquivo específico. Por padrão um arquivo de log é
16 criado em %TEMP%.</String>
17 <String Id="HelpCloseButton">&amp;Fechar</String>
18 <String Id="InstallLicenseTerms">Clique o botão "Aceitar e Instalar" para aceitar os termos de licença do Microsoft .NET Framework &lt;a href="#"&gt;&lt;/a&gt;.</String>
19 <String Id="InstallAcceptAndInstallButton">&amp;Aceitar e Instalar</String>
20 <String Id="InstallDeclineButton">&amp;Recusar</String>
21 <String Id="ProgressHeader">Progresso da Instalação</String>
22 <String Id="ProgressLabel">Processando:</String>
23 <String Id="ProgressCancelButton">&amp;Cancelar</String>
24 <String Id="FailureHeader">Falha na Instalação</String>
25 <String Id="FailureLogLinkText">Um ou mais problemas causaram falha na instalação. Corrija os problemas e tente a instalação novamente. Para mais informações consulte o &lt;a href="#"&gt;arquivo de log&lt;/a&gt;.</String>
26 <String Id="FailureRestartText">Você deve reiniciar o computador para completar a reversão do software. </String>
27 <String Id="FailureRestartButton">&amp;Reiniciar</String>
28 <String Id="FailureCloseButton">&amp;Fechar</String>
29</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1049/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1049/mbapreq.wxl
new file mode 100644
index 00000000..a1aec7ed
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1049/mbapreq.wxl
@@ -0,0 +1,29 @@
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<WixLocalization Culture="ru-ru" Language="1049" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">Установка [WixBundleName]</String>
7 <String Id="Title">Для установки [WixBundleName] требуется Microsoft .NET Framework</String>
8 <String Id="ConfirmCancelMessage">Вы действительно хотите отменить операцию?</String>
9 <String Id="HelpHeader">Справка по установке</String>
10 <String Id="HelpText">/passive | /quiet - отображение минимального ИП без запросов или работа без ИП
11 и беззапросов. По умолчанию отображаются ИП и все запросы.
12
13/norestart - отключение всех попыток перезагрузки. По умолчанию в ИП перед
14 перезагрузкой отображается запрос.
15/log log.txt - запись журнала в указанный файл. По умолчанию файл журнала
16 создается в папке %TEMP%.</String>
17 <String Id="HelpCloseButton">&amp;Закрыть</String>
18 <String Id="InstallLicenseTerms">Нажмите кнопку "Принять и установить", чтобы принять &lt;a href="#"&gt;условия лицензии&lt;/a&gt; Microsoft .NET Framework.</String>
19 <String Id="InstallAcceptAndInstallButton">&amp;Принять и установить</String>
20 <String Id="InstallDeclineButton">&amp;Отклонить</String>
21 <String Id="ProgressHeader">Выполнение установки</String>
22 <String Id="ProgressLabel">Обработка:</String>
23 <String Id="ProgressCancelButton">&amp;Отмена</String>
24 <String Id="FailureHeader">Сбой установки</String>
25 <String Id="FailureLogLinkText">Не удалось выполнить установку из-за одной или нескольких проблем. Устраните эти проблемы, а затем снова запустите программу установки. Дополнительные сведения см. в &lt;a href="#"&gt;файле журнала&lt;/a&gt;.</String>
26 <String Id="FailureRestartText">Необходимо перезагрузить компьютер, чтобы завершить откат программного обеспечения.</String>
27 <String Id="FailureRestartButton">&amp;Перезагрузить</String>
28 <String Id="FailureCloseButton">&amp;Закрыть</String>
29</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1051/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1051/mbapreq.wxl
new file mode 100644
index 00000000..9f0b4711
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1051/mbapreq.wxl
@@ -0,0 +1,30 @@
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<WixLocalization Culture="sk-sk" Language="1051" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">[WixBundleName] – inštalácia</String>
7 <String Id="Title">Na inštaláciu aplikácie [WixBundleName] sa vyžaduje súčasť Microsoft .NET Framework</String>
8 <String Id="ConfirmCancelMessage">Naozaj chcete zrušiť operáciu?</String>
9 <String Id="HelpHeader">Pomocník pre inštaláciu</String>
10 <String Id="HelpText">/passive | /quiet – zobrazí minimálne používateľské rozhranie bez výziev alebo
11 nezobrazí žiadne používateľské rozhranie ani výzvy. Predvolene sa
12 zobrazuje používateľské rozhranie aj všetky výzvy.
13
14/norestart – zruší všetky pokusy o reštart. Používateľské rozhranie
15 predvolene zobrazí pred reštartom výzvu.
16/log log.txt – urobí záznam do určeného súboru. Súbor denníka sa predvolene
17 vytvorí v priečinku %TEMP%.</String>
18 <String Id="HelpCloseButton">&amp;Zavrieť</String>
19 <String Id="InstallLicenseTerms">Kliknutím na tlačidlo Súhlasiť a inštalovať vyjadrite svoj súhlas s &lt;a href="#"&gt;licenčnými podmienkami&lt;/a&gt; súčasti Microsoft .NET Framework.</String>
20 <String Id="InstallAcceptAndInstallButton">&amp;Súhlasiť a inštalovať</String>
21 <String Id="InstallDeclineButton">&amp;Odmietnuť</String>
22 <String Id="ProgressHeader">Priebeh inštalácie</String>
23 <String Id="ProgressLabel">Spracúva sa:</String>
24 <String Id="ProgressCancelButton">&amp;Zrušiť</String>
25 <String Id="FailureHeader">Inštalácia zlyhala</String>
26 <String Id="FailureLogLinkText">Inštalácia zlyhala pre jednu alebo viac príčin. Odstráňte problémy a skúste znova spustiť inštaláciu. Ďalšie informácie nájdete v &lt;a href="#"&gt;súbore denníka&lt;/a&gt;.</String>
27 <String Id="FailureRestartText">Dokončenie všetkých zmien softvéru vyžaduje reštart počítača.</String>
28 <String Id="FailureRestartButton">&amp;Reštartovať</String>
29 <String Id="FailureCloseButton">&amp;Zavrieť</String>
30</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1053/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1053/mbapreq.wxl
new file mode 100644
index 00000000..72961409
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1053/mbapreq.wxl
@@ -0,0 +1,30 @@
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<WixLocalization Culture="sv-se" Language="1053" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">[WixBundleName]-installation</String>
7 <String Id="Title">Microsoft .NET Framework krävs för installation av [WixBundleName]</String>
8 <String Id="ConfirmCancelMessage">Vill du avbryta?</String>
9 <String Id="HelpHeader">Installationshjälp</String>
10 <String Id="HelpText">/passive | /quiet - visar ett minimalt användargränssnitt utan prompter,
11 alternativt inget användargränssnitt och inga prompter. Som standard visas
12 användargränssnitt och samtliga prompter.
13
14/norestart - hejdar omstart. Som standard visar användargränssnittet en
15 prompt före omstart.
16/log log.txt - skapar logg till en specifik fil. Som standard skapas loggfilen
17 i %TEMP%.</String>
18 <String Id="HelpCloseButton">&amp;Stäng</String>
19 <String Id="InstallLicenseTerms">Klicka på knappen "Godkänn och installera" för att godkänna &lt;a href="#"&gt;licensvillkoren&lt;/a&gt; för Microsoft .NET Framework.</String>
20 <String Id="InstallAcceptAndInstallButton">&amp;Godkänn och installera</String>
21 <String Id="InstallDeclineButton">&amp;Avbryt</String>
22 <String Id="ProgressHeader">Installationsförlopp</String>
23 <String Id="ProgressLabel">Bearbetar:</String>
24 <String Id="ProgressCancelButton">&amp;Avbryt</String>
25 <String Id="FailureHeader">Installationen misslyckades</String>
26 <String Id="FailureLogLinkText">Installationen misslyckades på grund av ett eller flera problem. Åtgärda problemen och försök igen. Se &lt;a href="#"&gt;loggfilen&lt;/a&gt; för mer information.</String>
27 <String Id="FailureRestartText">Starta om datorn för att återställa programmet.</String>
28 <String Id="FailureRestartButton">&amp;Starta om</String>
29 <String Id="FailureCloseButton">&amp;Stäng</String>
30</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1055/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1055/mbapreq.wxl
new file mode 100644
index 00000000..ee52da98
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1055/mbapreq.wxl
@@ -0,0 +1,30 @@
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<WixLocalization Culture="tr-tr" Language="1055" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">[WixBundleName] Kurulumu</String>
7 <String Id="Title">[WixBundleName] kurulumu için Microsoft .NET Framework gerekir</String>
8 <String Id="ConfirmCancelMessage">İptal etmek istediğinizden emin misiniz?</String>
9 <String Id="HelpHeader">Kurulum Yardımı</String>
10 <String Id="HelpText">/passive | /quiet - komut istemi olmayan olabildiğince küçük bir UI
11 görüntüler veya komut istemi ve UI görüntülemez. Varsayılan olarak UI
12 ve tüm komut istemleri görüntülenir.
13
14/norestart - yeniden başlatma denemelerini engeller. Varsayılan
15 olarak UI yeniden başlatmadan önce komut isteyecektir.
16/log log.txt - belirli bir dosyayı günlük dosyası olarak kullanır.
17 Varsayılan olarak %TEMP% konumunda bir günlük dosyası oluşturulur.</String>
18 <String Id="HelpCloseButton">&amp;Kapat</String>
19 <String Id="InstallLicenseTerms">Microsoft .NET Framework &lt;a href="#"&gt;lisans şartlarını&lt;/a&gt; kabul etmek için "Kabul Et ve Yükle" düğmesini tıklatın.</String>
20 <String Id="InstallAcceptAndInstallButton">&amp;Kabul Et ve Yükle</String>
21 <String Id="InstallDeclineButton">&amp;Reddet</String>
22 <String Id="ProgressHeader">Kurulum İlerleme Durumu</String>
23 <String Id="ProgressLabel">İşleniyor:</String>
24 <String Id="ProgressCancelButton">&amp;İptal</String>
25 <String Id="FailureHeader">Kurulum Başarısız</String>
26 <String Id="FailureLogLinkText">Bir veya daha fazla sorun kurulumun başarısız olmasına neden oldu. Lütfen sorunları çözün ve kurulumu yeniden deneyin. Daha fazla bilgi için &lt;a href="#"&gt;günlük dosyasına&lt;/a&gt; bakın.</String>
27 <String Id="FailureRestartText">Yazılım geri alma işlemini tamamlamak için bilgisayarınızı yeniden başlatmanız gerekir.</String>
28 <String Id="FailureRestartButton">&amp;Yeniden Başlat</String>
29 <String Id="FailureCloseButton">&amp;Kapat</String>
30</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/1060/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/1060/mbapreq.wxl
new file mode 100644
index 00000000..f3b4bfe5
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/1060/mbapreq.wxl
@@ -0,0 +1,30 @@
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<WixLocalization Culture="sl-si" Language="1060" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">[WixBundleName] Namestitev</String>
7 <String Id="Title">Microsoft .NET Framework, potreben za namestitev paketa [WixBundleName]</String>
8 <String Id="ConfirmCancelMessage">Ali ste prepričani, da želite preklicati?</String>
9 <String Id="HelpHeader">Pomoč za namestitev</String>
10 <String Id="HelpText">/passive | /quiet - prikaže minimalni uporabniški vmesnik brez pozivov ali ne prikaže
11 uporabniškega vmesnika in pozivov. Privzeto so prikazani uporabniški vmesnik in
12 vsi pozivi.
13
14/norestart - skrije vse možnosti za vnovicni zagon. Privzeto uporabniški vmesnik
15 prikaže poziv pred ponovnim zagonom.
16/log log.txt - beleži vnose v dnevnik v doloceno datoteko. Privzeto je datoteko
17 ustvarjena v mapi %TEMP%.</String>
18 <String Id="HelpCloseButton">&amp;Zapri</String>
19 <String Id="InstallLicenseTerms">Kliknite »Sprejmi in namesti« in sprejmite &lt;a href="#"&gt;licenčne pogoje&lt;/a&gt; za Microsoft .NET Framework.</String>
20 <String Id="InstallAcceptAndInstallButton">&amp;Sprejmi in namesti</String>
21 <String Id="InstallDeclineButton">&amp;Zavrni</String>
22 <String Id="ProgressHeader">Potek namestitve</String>
23 <String Id="ProgressLabel">Obdelovanje:</String>
24 <String Id="ProgressCancelButton">&amp;Prekliči</String>
25 <String Id="FailureHeader">Namestitev ni uspela</String>
26 <String Id="FailureLogLinkText">Namestitev ni uspela zaradi ene ali več težav. Odpravite težave in ponovno zaženite namestitev. Za več informacij glejte &lt;a href="#"&gt;dnevniško datoteko&lt;/a&gt;.</String>
27 <String Id="FailureRestartText">Za povrnitev prejšnjega stanja programske opreme morate ponovno zagnati računalnik.</String>
28 <String Id="FailureRestartButton">&amp;Ponovni zagon</String>
29 <String Id="FailureCloseButton">&amp;Zapri</String>
30</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/2052/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/2052/mbapreq.wxl
new file mode 100644
index 00000000..63cdb418
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/2052/mbapreq.wxl
@@ -0,0 +1,27 @@
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<WixLocalization Culture="zh-ch" Language="2052" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">[WixBundleName] 安装</String>
7 <String Id="Title">[WixBundleName] 安装需要 Microsoft .NET Framework</String>
8 <String Id="ConfirmCancelMessage">是否确实要取消?</String>
9 <String Id="HelpHeader">安装程序帮助</String>
10 <String Id="HelpText">/passive | /quiet - 显示最小的 UI 且无提示,或者不显示 UI 且
11 无提示。默认情况下显示 UI 和所有提示。
12
13/norestart - 隐藏任何重启提示。默认情况下 UI 会在重启前提示。
14/log log.txt - 记录到特定文件。默认情况下在 %TEMP% 中创建日志文件。</String>
15 <String Id="HelpCloseButton">关闭(&amp;C)</String>
16 <String Id="InstallLicenseTerms">单击“接受并安装”按钮以接受 Microsoft .NET Framework &lt;a href="#"&gt;许可证条款&lt;/a&gt;。</String>
17 <String Id="InstallAcceptAndInstallButton">接受并安装(&amp;A)</String>
18 <String Id="InstallDeclineButton">拒绝(&amp;D)</String>
19 <String Id="ProgressHeader">安装进度</String>
20 <String Id="ProgressLabel">正在处理:</String>
21 <String Id="ProgressCancelButton">取消(&amp;C)</String>
22 <String Id="FailureHeader">安装失败</String>
23 <String Id="FailureLogLinkText">一个或多个问题导致安装失败。请解决问题,然后重新尝试安装。有关详情,请查看&lt;a href="#"&gt;日志文件&lt;/a&gt;。</String>
24 <String Id="FailureRestartText">必须重启计算机才能完成软件的回滚。</String>
25 <String Id="FailureRestartButton">重启(&amp;R)</String>
26 <String Id="FailureCloseButton">关闭(&amp;C)</String>
27</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/2070/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/2070/mbapreq.wxl
new file mode 100644
index 00000000..6a49ca31
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/2070/mbapreq.wxl
@@ -0,0 +1,29 @@
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<WixLocalization Culture="pt-pt" Language="2070" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">Configuração do [WixBundleName]</String>
7 <String Id="Title">O Microsoft .NET Framework é necessário para a configuração do [WixBundleName]</String>
8 <String Id="ConfirmCancelMessage">Tem a certeza de que pretende cancelar?</String>
9 <String Id="HelpHeader">Ajuda da Configuração</String>
10 <String Id="HelpText">/passive | /quiet - apresenta IU mínima sem mensagens ou não apresenta IU nem
11 mensagens. Por predefinição, são apresentadas a IU e todas as mensagens.
12
13/norestart - suprimir qualquer tentativa de reinício. Por predefinição, a IU
14 avisará antes de reiniciar.
15/log log.txt - regista num ficheiro específico. Por predefinição, é criado um
16 ficheiro de registo em %TEMP%.</String>
17 <String Id="HelpCloseButton">&amp;Fechar</String>
18 <String Id="InstallLicenseTerms">Clique no botão "Aceitar e Instalar" para aceitar os &lt;a href="#"&gt;termos de licenciamento&lt;/a&gt; do Microsoft .NET Framework.</String>
19 <String Id="InstallAcceptAndInstallButton">&amp;Aceitar e Instalar</String>
20 <String Id="InstallDeclineButton">&amp;Recusar</String>
21 <String Id="ProgressHeader">Progresso da Configuração</String>
22 <String Id="ProgressLabel">A processar:</String>
23 <String Id="ProgressCancelButton">&amp;Cancelar</String>
24 <String Id="FailureHeader">Falha da Configuração</String>
25 <String Id="FailureLogLinkText">Um ou mais problemas provocaram a falha da configuração. Corrija os problemas e repita a configuração. Para mais informações, consulte o &lt;a href="#"&gt;ficheiro de registo&lt;/a&gt;.</String>
26 <String Id="FailureRestartText">Tem de reiniciar o computador para concluir a reversão do software.</String>
27 <String Id="FailureRestartButton">&amp;Reiniciar</String>
28 <String Id="FailureCloseButton">&amp;Fechar</String>
29</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/3082/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/3082/mbapreq.wxl
new file mode 100644
index 00000000..0290624c
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/3082/mbapreq.wxl
@@ -0,0 +1,31 @@
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<WixLocalization Culture="es-es" Language="3082" xmlns="http://schemas.microsoft.com/wix/2006/localization">
6 <String Id="Caption">Instalación de [WixBundleName]</String>
7 <String Id="Title">La instalación de [WixBundleName] requiere Microsoft .NET Framework</String>
8 <String Id="ConfirmCancelMessage">¿Está seguro de que desea cancelar?</String>
9 <String Id="HelpHeader">Ayuda del programa de instalación</String>
10 <String Id="HelpText">/passive | /quiet - muestra una interfaz de usuario mínima y no realiza
11 preguntas, o bien no muestra interfaz de usuario y no realiza preguntas.
12 De manera predeterminada se muestra la interfaz de usuario completa y se
13 realizan todas las preguntas necesarias.
14
15/norestart - suprime cualquier intento de reinicio. De manera predeterminada,
16 la interfaz de usuario preguntará si se desea reiniciar.
17/log log.txt - registra los datos de instalación en un archivo específico.
18 De manera predeterminada se crea un archivo de registro en %TEMP%.</String>
19 <String Id="HelpCloseButton">&amp;Cerrar</String>
20 <String Id="InstallLicenseTerms">Haga clic en el botón "Aceptar e instalar" para aceptar los &lt;a href="#"&gt;términos de licencia&lt;/a&gt; de Microsoft .NET Framework.</String>
21 <String Id="InstallAcceptAndInstallButton">&amp;Aceptar e instalar</String>
22 <String Id="InstallDeclineButton">&amp;Rechazar</String>
23 <String Id="ProgressHeader">Progreso de la instalación</String>
24 <String Id="ProgressLabel">Procesando:</String>
25 <String Id="ProgressCancelButton">&amp;Cancelar</String>
26 <String Id="FailureHeader">Error de la instalación</String>
27 <String Id="FailureLogLinkText">No se pudo completar la instalación a causa de uno o varios problemas. Corrija los problemas y vuelva a intentar la instalación. Para más información, vea el &lt;a href="#"&gt;archivo de registro&lt;/a&gt;.</String>
28 <String Id="FailureRestartText">Debe reiniciar el equipo para completar la reversión del software.</String>
29 <String Id="FailureRestartButton">&amp;Reiniciar</String>
30 <String Id="FailureCloseButton">&amp;Cerrar</String>
31</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/HyperlinkLargeTheme.xml b/src/ext/Bal/wixstdba/Resources/HyperlinkLargeTheme.xml
new file mode 100644
index 00000000..39a38ee0
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/HyperlinkLargeTheme.xml
@@ -0,0 +1,109 @@
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<Theme xmlns="http://wixtoolset.org/schemas/v4/thmutil">
6 <Font Id="0" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font>
7 <Font Id="1" Height="-24" Weight="500" Foreground="windowtext">Segoe UI</Font>
8 <Font Id="2" Height="-22" Weight="500" Foreground="graytext">Segoe UI</Font>
9 <Font Id="3" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font>
10
11 <Window Width="500" Height="390" HexStyle="100a0000" FontId="0" Caption="#(loc.Caption)">
12 <ImageControl X="11" Y="11" Width="64" Height="64" ImageFile="logo.png" Visible="yes"/>
13 <Label X="80" Y="11" Width="-11" Height="64" FontId="1" Visible="yes" DisablePrefix="yes">#(loc.Title)</Label>
14
15 <Page Name="Help">
16 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.HelpHeader)</Label>
17 <Label X="11" Y="112" Width="-11" Height="-35" FontId="3" DisablePrefix="yes">#(loc.HelpText)</Label>
18 <Button Name="HelpCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
19 <Text>#(loc.HelpCloseButton)</Text>
20 <CloseWindowAction />
21 </Button>
22 </Page>
23 <Page Name="Install">
24 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.InstallHeader)</Label>
25 <Label X="11" Y="121" Width="-11" Height="-129" FontId="3" DisablePrefix="yes">#(loc.InstallMessage)</Label>
26 <Hypertext Name="EulaHyperlink" X="11" Y="-107" Width="-11" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallLicenseLinkText)</Hypertext>
27 <Label Name="InstallVersion" X="11" Y="-73" Width="246" Height="17" FontId="3" DisablePrefix="yes" VisibleCondition="WixStdBAShowVersion">#(loc.InstallVersion)</Label>
28 <Checkbox Name="EulaAcceptCheckbox" X="-11" Y="-41" Width="260" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallAcceptCheckbox)</Checkbox>
29 <Button Name="OptionsButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" VisibleCondition="NOT WixStdBASuppressOptionsUI">
30 <Text>#(loc.InstallOptionsButton)</Text>
31 <ChangePageAction Page="Options" />
32 </Button>
33 <Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
34 <Button Name="InstallCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
35 <Text>#(loc.InstallCancelButton)</Text>
36 <CloseWindowAction />
37 </Button>
38 </Page>
39 <Page Name="Options">
40 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.OptionsHeader)</Label>
41 <Label X="11" Y="121" Width="-11" Height="17" FontId="3" DisablePrefix="yes">#(loc.OptionsLocationLabel)</Label>
42 <Editbox Name="InstallFolder" X="11" Y="143" Width="-91" Height="21" TabStop="yes" FontId="3" FileSystemAutoComplete="yes" />
43 <Button Name="BrowseButton" X="-11" Y="142" Width="75" Height="23" TabStop="yes" FontId="0">
44 <Text>#(loc.OptionsBrowseButton)</Text>
45 <BrowseDirectoryAction VariableName="InstallFolder" />
46 </Button>
47 <Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
48 <Text>#(loc.OptionsOkButton)</Text>
49 <ChangePageAction Page="Install" />
50 </Button>
51 <Button Name="OptionsCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
52 <Text>#(loc.OptionsCancelButton)</Text>
53 <ChangePageAction Page="Install" Cancel="yes" />
54 </Button>
55 </Page>
56 <Page Name="Progress">
57 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ProgressHeader)</Label>
58 <Label X="11" Y="121" Width="70" Height="17" FontId="3" DisablePrefix="yes">#(loc.ProgressLabel)</Label>
59 <Label Name="OverallProgressPackageText" X="85" Y="121" Width="-11" Height="17" FontId="3" DisablePrefix="yes">#(loc.OverallProgressPackageText)</Label>
60 <Progressbar Name="OverallCalculatedProgressbar" X="11" Y="143" Width="-11" Height="15" />
61 <Button Name="ProgressCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ProgressCancelButton)</Button>
62 </Page>
63 <Page Name="Modify">
64 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ModifyHeader)</Label>
65 <Button Name="RepairButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.ModifyRepairButton)</Button>
66 <Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ModifyUninstallButton)</Button>
67 <Button Name="ModifyCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
68 <Text>#(loc.ModifyCancelButton)</Text>
69 <CloseWindowAction />
70 </Button>
71 </Page>
72 <Page Name="Success">
73 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">
74 <Text>#(loc.SuccessHeader)</Text>
75 <Text Condition="WixBundleAction = 2">#(loc.SuccessLayoutHeader)</Text>
76 <Text Condition="WixBundleAction = 3">#(loc.SuccessUninstallHeader)</Text>
77 <Text Condition="WixBundleAction = 5">#(loc.SuccessInstallHeader)</Text>
78 <Text Condition="WixBundleAction = 7">#(loc.SuccessRepairHeader)</Text>
79 </Label>
80 <Button Name="LaunchButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.SuccessLaunchButton)</Button>
81 <Label X="-11" Y="-51" Width="400" Height="34" FontId="3" DisablePrefix="yes" VisibleCondition="WixStdBARestartRequired">
82 <Text>#(loc.SuccessRestartText)</Text>
83 <Text Condition="WixBundleAction = 3">#(loc.SuccessUninstallRestartText)</Text>
84 </Label>
85 <Button Name="SuccessRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.SuccessRestartButton)</Button>
86 <Button Name="SuccessCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
87 <Text>#(loc.SuccessCloseButton)</Text>
88 <CloseWindowAction />
89 </Button>
90 </Page>
91 <Page Name="Failure">
92 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">
93 <Text>#(loc.FailureHeader)</Text>
94 <Text Condition="WixBundleAction = 2">#(loc.FailureLayoutHeader)</Text>
95 <Text Condition="WixBundleAction = 3">#(loc.FailureUninstallHeader)</Text>
96 <Text Condition="WixBundleAction = 5">#(loc.FailureInstallHeader)</Text>
97 <Text Condition="WixBundleAction = 7">#(loc.FailureRepairHeader)</Text>
98 </Label>
99 <Hypertext Name="FailureLogFileLink" X="11" Y="121" Width="-11" Height="42" FontId="3" TabStop="yes" HideWhenDisabled="yes">#(loc.FailureHyperlinkLogText)</Hypertext>
100 <Hypertext Name="FailureMessageText" X="22" Y="163" Width="-11" Height="51" FontId="3" TabStop="yes" HideWhenDisabled="yes" />
101 <Label X="-11" Y="-51" Width="400" Height="34" FontId="3" DisablePrefix="yes" VisibleCondition="WixStdBARestartRequired">#(loc.FailureRestartText)</Label>
102 <Button Name="FailureRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.FailureRestartButton)</Button>
103 <Button Name="FailureCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
104 <Text>#(loc.FailureCloseButton)</Text>
105 <CloseWindowAction />
106 </Button>
107 </Page>
108 </Window>
109</Theme>
diff --git a/src/ext/Bal/wixstdba/Resources/HyperlinkSidebarTheme.xml b/src/ext/Bal/wixstdba/Resources/HyperlinkSidebarTheme.xml
new file mode 100644
index 00000000..1dff9d7e
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/HyperlinkSidebarTheme.xml
@@ -0,0 +1,120 @@
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<Theme xmlns="http://wixtoolset.org/schemas/v4/thmutil">
6 <Font Id="0" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font>
7 <Font Id="1" Height="-24" Weight="500" Foreground="windowtext">Segoe UI</Font>
8 <Font Id="2" Height="-22" Weight="500" Foreground="graytext">Segoe UI</Font>
9 <Font Id="3" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font>
10
11 <Window Width="600" Height="450" HexStyle="100a0000" FontId="0" Caption="#(loc.Caption)">
12 <Page Name="Help">
13 <Label X="80" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.Title)</Label>
14 <ImageControl X="11" Y="11" Width="64" Height="64" ImageFile="logo.png"/>
15 <Label X="11" Y="80" Width="-11" Height="32" FontId="2" DisablePrefix="yes">#(loc.HelpHeader)</Label>
16 <Label X="11" Y="121" Width="-11" Height="-35" FontId="3" DisablePrefix="yes">#(loc.HelpText)</Label>
17 <Button Name="HelpCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
18 <Text>#(loc.HelpCloseButton)</Text>
19 <CloseWindowAction />
20 </Button>
21 </Page>
22 <Page Name="Install">
23 <Label X="185" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.Title)</Label>
24 <ImageControl X="11" Y="11" Width="165" Height="400" ImageFile="logoside.png"/>
25 <Label X="185" Y="50" Width="-11" Height="32" FontId="2" DisablePrefix="yes">#(loc.InstallHeader)</Label>
26 <Label X="185" Y="91" Width="-11" Height="64" FontId="3" DisablePrefix="yes">#(loc.InstallMessage)</Label>
27 <Hypertext Name="EulaHyperlink" X="185" Y="-111" Width="-11" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallLicenseLinkText)</Hypertext>
28 <Label Name="InstallVersion" X="185" Y="-81" Width="-11" Height="17" FontId="3" DisablePrefix="yes" VisibleCondition="WixStdBAShowVersion">#(loc.InstallVersion)</Label>
29 <Checkbox Name="EulaAcceptCheckbox" X="185" Y="-51" Width="-11" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallAcceptCheckbox)</Checkbox>
30 <Button Name="OptionsButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" VisibleCondition="NOT WixStdBASuppressOptionsUI">
31 <Text>#(loc.InstallOptionsButton)</Text>
32 <ChangePageAction Page="Options" />
33 </Button>
34 <Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
35 <Button Name="InstallCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
36 <Text>#(loc.InstallCancelButton)</Text>
37 <CloseWindowAction />
38 </Button>
39 </Page>
40 <Page Name="Options">
41 <Label X="80" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.Title)</Label>
42 <ImageControl X="11" Y="11" Width="64" Height="64" ImageFile="logo.png"/>
43 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.OptionsHeader)</Label>
44 <Label X="11" Y="121" Width="-11" Height="17" FontId="3">#(loc.OptionsLocationLabel)</Label>
45 <Editbox Name="InstallFolder" X="11" Y="143" Width="-91" Height="21" TabStop="yes" FontId="3" FileSystemAutoComplete="yes" />
46 <Button Name="BrowseButton" X="-11" Y="142" Width="75" Height="23" TabStop="yes" FontId="3">
47 <Text>#(loc.OptionsBrowseButton)</Text>
48 <BrowseDirectoryAction VariableName="InstallFolder" />
49 </Button>
50 <Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
51 <Text>#(loc.OptionsOkButton)</Text>
52 <ChangePageAction Page="Install" />
53 </Button>
54 <Button Name="OptionsCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
55 <Text>#(loc.OptionsCancelButton)</Text>
56 <ChangePageAction Page="Install" Cancel="yes" />
57 </Button>
58 </Page>
59 <Page Name="Progress">
60 <Label X="80" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.Title)</Label>
61 <ImageControl X="11" Y="11" Width="64" Height="64" ImageFile="logo.png"/>
62 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ProgressHeader)</Label>
63 <Label X="11" Y="141" Width="70" Height="17" FontId="3" DisablePrefix="yes">#(loc.ProgressLabel)</Label>
64 <Label Name="OverallProgressPackageText" X="85" Y="141" Width="-11" Height="17" FontId="3" DisablePrefix="yes">#(loc.OverallProgressPackageText)</Label>
65 <Progressbar Name="OverallCalculatedProgressbar" X="11" Y="163" Width="-11" Height="20" />
66 <Button Name="ProgressCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ProgressCancelButton)</Button>
67 </Page>
68 <Page Name="Modify">
69 <Label X="185" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.Title)</Label>
70 <ImageControl X="11" Y="11" Width="165" Height="400" ImageFile="logoside.png"/>
71 <Label X="185" Y="50" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ModifyHeader)</Label>
72 <Button Name="RepairButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.ModifyRepairButton)</Button>
73 <Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ModifyUninstallButton)</Button>
74 <Button Name="ModifyCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
75 <Text>#(loc.ModifyCancelButton)</Text>
76 <CloseWindowAction />
77 </Button>
78 </Page>
79 <Page Name="Success">
80 <Label X="185" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.Title)</Label>
81 <ImageControl X="11" Y="11" Width="165" Height="400" ImageFile="logoside.png"/>
82 <Label X="185" Y="50" Width="-11" Height="30" FontId="2" DisablePrefix="yes">
83 <Text>#(loc.SuccessHeader)</Text>
84 <Text Condition="WixBundleAction = 2">#(loc.SuccessLayoutHeader)</Text>
85 <Text Condition="WixBundleAction = 3">#(loc.SuccessUninstallHeader)</Text>
86 <Text Condition="WixBundleAction = 5">#(loc.SuccessInstallHeader)</Text>
87 <Text Condition="WixBundleAction = 7">#(loc.SuccessRepairHeader)</Text>
88 </Label>
89 <Button Name="LaunchButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.SuccessLaunchButton)</Button>
90 <Label X="185" Y="-51" Width="400" Height="34" FontId="3" DisablePrefix="yes" VisibleCondition="WixStdBARestartRequired">
91 <Text>#(loc.SuccessRestartText)</Text>
92 <Text Condition="WixBundleAction = 3">#(loc.SuccessUninstallRestartText)</Text>
93 </Label>
94 <Button Name="SuccessRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.SuccessRestartButton)</Button>
95 <Button Name="SuccessCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
96 <Text>#(loc.SuccessCloseButton)</Text>
97 <CloseWindowAction />
98 </Button>
99 </Page>
100 <Page Name="Failure">
101 <Label X="185" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.Title)</Label>
102 <ImageControl X="11" Y="11" Width="165" Height="400" ImageFile="logoside.png"/>
103 <Label X="185" Y="50" Width="-11" Height="30" FontId="2" DisablePrefix="yes">
104 <Text>#(loc.FailureHeader)</Text>
105 <Text Condition="WixBundleAction = 2">#(loc.FailureLayoutHeader)</Text>
106 <Text Condition="WixBundleAction = 3">#(loc.FailureUninstallHeader)</Text>
107 <Text Condition="WixBundleAction = 5">#(loc.FailureInstallHeader)</Text>
108 <Text Condition="WixBundleAction = 7">#(loc.FailureRepairHeader)</Text>
109 </Label>
110 <Hypertext Name="FailureLogFileLink" X="185" Y="121" Width="-11" Height="68" FontId="3" TabStop="yes" HideWhenDisabled="yes">#(loc.FailureHyperlinkLogText)</Hypertext>
111 <Hypertext Name="FailureMessageText" X="185" Y="-115" Width="-11" Height="80" FontId="3" TabStop="yes" HideWhenDisabled="yes" />
112 <Label X="185" Y="-57" Width="-11" Height="80" FontId="3" DisablePrefix="yes" VisibleCondition="WixStdBARestartRequired">#(loc.FailureRestartText)</Label>
113 <Button Name="FailureRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.FailureRestartButton)</Button>
114 <Button Name="FailureCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
115 <Text>#(loc.FailureCloseButton)</Text>
116 <CloseWindowAction />
117 </Button>
118 </Page>
119 </Window>
120</Theme>
diff --git a/src/ext/Bal/wixstdba/Resources/HyperlinkTheme.wxl b/src/ext/Bal/wixstdba/Resources/HyperlinkTheme.wxl
new file mode 100644
index 00000000..e6e3f8ab
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/HyperlinkTheme.wxl
@@ -0,0 +1,61 @@
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<WixLocalization Culture="en-us" Language="1033" xmlns="http://wixtoolset.org/schemas/v4/wxl">
6 <String Id="Caption">[WixBundleName] Setup</String>
7 <String Id="Title">[WixBundleName]</String>
8 <String Id="InstallHeader">Welcome</String>
9 <String Id="InstallMessage">Setup will install [WixBundleName] on your computer. Click install to continue, options to set the install directory or Close to exit.</String>
10 <String Id="InstallVersion">Version [WixBundleVersion]</String>
11 <String Id="ConfirmCancelMessage">Are you sure you want to cancel?</String>
12 <String Id="ExecuteUpgradeRelatedBundleMessage">Previous version</String>
13 <String Id="HelpHeader">Setup Help</String>
14 <String Id="HelpText">/install | /repair | /uninstall | /layout [directory] - installs, repairs, uninstalls or
15 creates a complete local copy of the bundle in directory. Install is the default.
16
17/passive | /quiet - displays minimal UI with no prompts or displays no UI and
18 no prompts. By default UI and all prompts are displayed.
19
20/norestart - suppress any attempts to restart. By default UI will prompt before restart.
21/log log.txt - logs to a specific file. By default a log file is created in %TEMP%.</String>
22 <String Id="HelpCloseButton">&amp;Close</String>
23 <String Id="InstallLicenseLinkText">[WixBundleName] &lt;a href="#"&gt;license terms&lt;/a&gt;.</String>
24 <String Id="InstallAcceptCheckbox">I &amp;agree to the license terms and conditions</String>
25 <String Id="InstallOptionsButton">&amp;Options</String>
26 <String Id="InstallInstallButton">&amp;Install</String>
27 <String Id="InstallCancelButton">&amp;Cancel</String>
28 <String Id="OptionsHeader">Setup Options</String>
29 <String Id="OptionsLocationLabel">Install location:</String>
30 <String Id="OptionsBrowseButton">&amp;Browse</String>
31 <String Id="OptionsOkButton">&amp;OK</String>
32 <String Id="OptionsCancelButton">&amp;Cancel</String>
33 <String Id="ProgressHeader">Setup Progress</String>
34 <String Id="ProgressLabel">Processing:</String>
35 <String Id="OverallProgressPackageText">Initializing...</String>
36 <String Id="ProgressCancelButton">&amp;Cancel</String>
37 <String Id="ModifyHeader">Modify Setup</String>
38 <String Id="ModifyRepairButton">&amp;Repair</String>
39 <String Id="ModifyUninstallButton">&amp;Uninstall</String>
40 <String Id="ModifyCancelButton">&amp;Cancel</String>
41 <String Id="SuccessHeader">Setup Successful</String>
42 <String Id="SuccessInstallHeader">Installation Successfully Completed</String>
43 <String Id="SuccessLayoutHeader">Layout Successfully Completed</String>
44 <String Id="SuccessRepairHeader">Repair Successfully Completed</String>
45 <String Id="SuccessUninstallHeader">Uninstall Successfully Completed</String>
46 <String Id="SuccessLaunchButton">&amp;Launch</String>
47 <String Id="SuccessRestartText">You must restart your computer before you can use the software.</String>
48 <String Id="SuccessUninstallRestartText">You must restart your computer to complete the removal of the software.</String>
49 <String Id="SuccessRestartButton">&amp;Restart</String>
50 <String Id="SuccessCloseButton">&amp;Close</String>
51 <String Id="FailureHeader">Setup Failed</String>
52 <String Id="FailureInstallHeader">Setup Failed</String>
53 <String Id="FailureLayoutHeader">Layout Failed</String>
54 <String Id="FailureRepairHeader">Repair Failed</String>
55 <String Id="FailureUninstallHeader">Uninstall Failed</String>
56 <String Id="FailureHyperlinkLogText">One or more issues caused the setup to fail. Please fix the issues and then retry setup. For more information see the &lt;a href="#"&gt;log file&lt;/a&gt;.</String>
57 <String Id="FailureRestartText">You must restart your computer to complete the rollback of the software.</String>
58 <String Id="FailureRestartButton">&amp;Restart</String>
59 <String Id="FailureCloseButton">&amp;Close</String>
60 <String Id="ErrorFailNoActionReboot">No action was taken as a system reboot is required.</String>
61</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/HyperlinkTheme.xml b/src/ext/Bal/wixstdba/Resources/HyperlinkTheme.xml
new file mode 100644
index 00000000..657db34b
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/HyperlinkTheme.xml
@@ -0,0 +1,106 @@
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<Theme xmlns="http://wixtoolset.org/schemas/v4/thmutil">
6 <Font Id="0" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font>
7 <Font Id="1" Height="-24" Weight="500" Foreground="windowtext">Segoe UI</Font>
8 <Font Id="2" Height="-22" Weight="500" Foreground="graytext">Segoe UI</Font>
9 <Font Id="3" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font>
10
11 <Window Width="485" Height="300" HexStyle="100a0000" FontId="0" Caption="#(loc.Caption)">
12 <ImageControl X="11" Y="11" Width="64" Height="64" ImageFile="logo.png" Visible="yes"/>
13 <Label X="80" Y="11" Width="-11" Height="64" FontId="1" Visible="yes" DisablePrefix="yes">#(loc.Title)</Label>
14
15 <Page Name="Help">
16 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.HelpHeader)</Label>
17 <Label X="11" Y="112" Width="-11" Height="-35" FontId="3" DisablePrefix="yes">#(loc.HelpText)</Label>
18 <Button Name="HelpCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
19 <Text>#(loc.HelpCloseButton)</Text>
20 <CloseWindowAction />
21 </Button>
22 </Page>
23 <Page Name="Install">
24 <Hypertext Name="EulaHyperlink" X="11" Y="121" Width="-11" Height="51" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallLicenseLinkText)</Hypertext>
25 <Checkbox Name="EulaAcceptCheckbox" X="-11" Y="-41" Width="260" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallAcceptCheckbox)</Checkbox>
26 <Button Name="OptionsButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" VisibleCondition="NOT WixStdBASuppressOptionsUI">
27 <Text>#(loc.InstallOptionsButton)</Text>
28 <ChangePageAction Page="Options" />
29 </Button>
30 <Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
31 <Button Name="InstallCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
32 <Text>#(loc.InstallCancelButton)</Text>
33 <CloseWindowAction />
34 </Button>
35 </Page>
36 <Page Name="Options">
37 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.OptionsHeader)</Label>
38 <Label X="11" Y="121" Width="-11" Height="17" FontId="3" DisablePrefix="yes">#(loc.OptionsLocationLabel)</Label>
39 <Editbox Name="InstallFolder" X="11" Y="143" Width="-91" Height="21" TabStop="yes" FontId="3" FileSystemAutoComplete="yes" />
40 <Button Name="BrowseButton" X="-11" Y="142" Width="75" Height="23" TabStop="yes" FontId="3">
41 <Text>#(loc.OptionsBrowseButton)</Text>
42 <BrowseDirectoryAction VariableName="InstallFolder" />
43 </Button>
44 <Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
45 <Text>#(loc.OptionsOkButton)</Text>
46 <ChangePageAction Page="Install" />
47 </Button>
48 <Button Name="OptionsCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
49 <Text>#(loc.OptionsCancelButton)</Text>
50 <ChangePageAction Page="Install" Cancel="yes" />
51 </Button>
52 </Page>
53 <Page Name="Progress">
54 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ProgressHeader)</Label>
55 <Label X="11" Y="121" Width="70" Height="17" FontId="3" DisablePrefix="yes">#(loc.ProgressLabel)</Label>
56 <Label Name="OverallProgressPackageText" X="85" Y="121" Width="-11" Height="17" FontId="3" DisablePrefix="yes">#(loc.OverallProgressPackageText)</Label>
57 <Progressbar Name="OverallCalculatedProgressbar" X="11" Y="143" Width="-11" Height="15" />
58 <Button Name="ProgressCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ProgressCancelButton)</Button>
59 </Page>
60 <Page Name="Modify">
61 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ModifyHeader)</Label>
62 <Button Name="RepairButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.ModifyRepairButton)</Button>
63 <Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ModifyUninstallButton)</Button>
64 <Button Name="ModifyCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
65 <Text>#(loc.ModifyCancelButton)</Text>
66 <CloseWindowAction />
67 </Button>
68 </Page>
69 <Page Name="Success">
70 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">
71 <Text>#(loc.SuccessHeader)</Text>
72 <Text Condition="WixBundleAction = 2">#(loc.SuccessLayoutHeader)</Text>
73 <Text Condition="WixBundleAction = 3">#(loc.SuccessUninstallHeader)</Text>
74 <Text Condition="WixBundleAction = 5">#(loc.SuccessInstallHeader)</Text>
75 <Text Condition="WixBundleAction = 7">#(loc.SuccessRepairHeader)</Text>
76 </Label>
77 <Button Name="LaunchButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.SuccessLaunchButton)</Button>
78 <Label X="-11" Y="-51" Width="400" Height="34" FontId="3" DisablePrefix="yes" VisibleCondition="WixStdBARestartRequired">
79 <Text>#(loc.SuccessRestartText)</Text>
80 <Text Condition="WixBundleAction = 3">#(loc.SuccessUninstallRestartText)</Text>
81 </Label>
82 <Button Name="SuccessRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.SuccessRestartButton)</Button>
83 <Button Name="SuccessCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
84 <Text>#(loc.SuccessCloseButton)</Text>
85 <CloseWindowAction />
86 </Button>
87 </Page>
88 <Page Name="Failure">
89 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">
90 <Text>#(loc.FailureHeader)</Text>
91 <Text Condition="WixBundleAction = 2">#(loc.FailureLayoutHeader)</Text>
92 <Text Condition="WixBundleAction = 3">#(loc.FailureUninstallHeader)</Text>
93 <Text Condition="WixBundleAction = 5">#(loc.FailureInstallHeader)</Text>
94 <Text Condition="WixBundleAction = 7">#(loc.FailureRepairHeader)</Text>
95 </Label>
96 <Hypertext Name="FailureLogFileLink" X="11" Y="121" Width="-11" Height="42" FontId="3" TabStop="yes" HideWhenDisabled="yes">#(loc.FailureHyperlinkLogText)</Hypertext>
97 <Hypertext Name="FailureMessageText" X="22" Y="163" Width="-11" Height="51" FontId="3" TabStop="yes" HideWhenDisabled="yes" />
98 <Label X="-11" Y="-51" Width="400" Height="34" FontId="3" DisablePrefix="yes" VisibleCondition="WixStdBARestartRequired">#(loc.FailureRestartText)</Label>
99 <Button Name="FailureRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.FailureRestartButton)</Button>
100 <Button Name="FailureCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
101 <Text>#(loc.FailureCloseButton)</Text>
102 <CloseWindowAction />
103 </Button>
104 </Page>
105 </Window>
106</Theme>
diff --git a/src/ext/Bal/wixstdba/Resources/LoremIpsumLicense.rtf b/src/ext/Bal/wixstdba/Resources/LoremIpsumLicense.rtf
new file mode 100644
index 00000000..1a183236
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/LoremIpsumLicense.rtf
Binary files differ
diff --git a/src/ext/Bal/wixstdba/Resources/RtfLargeTheme.xml b/src/ext/Bal/wixstdba/Resources/RtfLargeTheme.xml
new file mode 100644
index 00000000..3571e13a
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/RtfLargeTheme.xml
@@ -0,0 +1,108 @@
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<Theme xmlns="http://wixtoolset.org/schemas/v4/thmutil">
6 <Font Id="0" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font>
7 <Font Id="1" Height="-24" Weight="500" Foreground="windowtext">Segoe UI</Font>
8 <Font Id="2" Height="-22" Weight="500" Foreground="graytext">Segoe UI</Font>
9 <Font Id="3" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font>
10
11 <Window Width="500" Height="390" HexStyle="100a0000" FontId="0" Caption="#(loc.Caption)">
12 <ImageControl X="11" Y="11" Width="64" Height="64" ImageFile="logo.png" Visible="yes"/>
13 <Label X="80" Y="11" Width="-11" Height="64" FontId="1" Visible="yes" DisablePrefix="yes">#(loc.Title)</Label>
14
15 <Page Name="Help">
16 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.HelpHeader)</Label>
17 <Label X="11" Y="112" Width="-11" Height="-35" FontId="3" DisablePrefix="yes">#(loc.HelpText)</Label>
18 <Button Name="HelpCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
19 <Text>#(loc.HelpCloseButton)</Text>
20 <CloseWindowAction />
21 </Button>
22 </Page>
23 <Page Name="Install">
24 <Label X="11" Y="80" Width="-11" Height="-70" TabStop="no" FontId="2" HexStyle="800000" DisablePrefix="yes" />
25 <Richedit Name="EulaRichedit" X="12" Y="81" Width="-12" Height="-71" TabStop="yes" FontId="0" />
26 <Label Name="InstallVersion" X="11" Y="-41" Width="210" Height="17" FontId="3" DisablePrefix="yes" VisibleCondition="WixStdBAShowVersion">#(loc.InstallVersion)</Label>
27 <Checkbox Name="EulaAcceptCheckbox" X="-11" Y="-41" Width="260" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallAcceptCheckbox)</Checkbox>
28 <Button Name="OptionsButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" VisibleCondition="NOT WixStdBASuppressOptionsUI">
29 <Text>#(loc.InstallOptionsButton)</Text>
30 <ChangePageAction Page="Options" />
31 </Button>
32 <Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
33 <Button Name="InstallCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
34 <Text>#(loc.InstallCancelButton)</Text>
35 <CloseWindowAction />
36 </Button>
37 </Page>
38 <Page Name="Options">
39 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.OptionsHeader)</Label>
40 <Label X="11" Y="121" Width="-11" Height="17" FontId="3" DisablePrefix="yes">#(loc.OptionsLocationLabel)</Label>
41 <Editbox Name="InstallFolder" X="11" Y="143" Width="-91" Height="21" TabStop="yes" FontId="3" FileSystemAutoComplete="yes" />
42 <Button Name="BrowseButton" X="-11" Y="142" Width="75" Height="23" TabStop="yes" FontId="3">
43 <Text>#(loc.OptionsBrowseButton)</Text>
44 <BrowseDirectoryAction VariableName="InstallFolder" />
45 </Button>
46 <Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
47 <Text>#(loc.OptionsOkButton)</Text>
48 <ChangePageAction Page="Install" />
49 </Button>
50 <Button Name="OptionsCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
51 <Text>#(loc.OptionsCancelButton)</Text>
52 <ChangePageAction Page="Install" Cancel="yes" />
53 </Button>
54 </Page>
55 <Page Name="Progress">
56 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ProgressHeader)</Label>
57 <Label X="11" Y="121" Width="70" Height="17" FontId="3" DisablePrefix="yes">#(loc.ProgressLabel)</Label>
58 <Label Name="OverallProgressPackageText" X="85" Y="121" Width="-11" Height="17" FontId="3" DisablePrefix="yes">#(loc.OverallProgressPackageText)</Label>
59 <Progressbar Name="OverallCalculatedProgressbar" X="11" Y="143" Width="-11" Height="15" />
60 <Button Name="ProgressCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ProgressCancelButton)</Button>
61 </Page>
62 <Page Name="Modify">
63 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ModifyHeader)</Label>
64 <Button Name="RepairButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.ModifyRepairButton)</Button>
65 <Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ModifyUninstallButton)</Button>
66 <Button Name="ModifyCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
67 <Text>#(loc.ModifyCancelButton)</Text>
68 <CloseWindowAction />
69 </Button>
70 </Page>
71 <Page Name="Success">
72 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">
73 <Text>#(loc.SuccessHeader)</Text>
74 <Text Condition="WixBundleAction = 2">#(loc.SuccessLayoutHeader)</Text>
75 <Text Condition="WixBundleAction = 3">#(loc.SuccessUninstallHeader)</Text>
76 <Text Condition="WixBundleAction = 5">#(loc.SuccessInstallHeader)</Text>
77 <Text Condition="WixBundleAction = 7">#(loc.SuccessRepairHeader)</Text>
78 </Label>
79 <Button Name="LaunchButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.SuccessLaunchButton)</Button>
80 <Label X="-11" Y="-51" Width="400" Height="34" FontId="3" DisablePrefix="yes" VisibleCondition="WixStdBARestartRequired">
81 <Text>#(loc.SuccessRestartText)</Text>
82 <Text Condition="WixBundleAction = 3">#(loc.SuccessUninstallRestartText)</Text>
83 </Label>
84 <Button Name="SuccessRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.SuccessRestartButton)</Button>
85 <Button Name="SuccessCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
86 <Text>#(loc.SuccessCloseButton)</Text>
87 <CloseWindowAction />
88 </Button>
89 </Page>
90 <Page Name="Failure">
91 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">
92 <Text>#(loc.FailureHeader)</Text>
93 <Text Condition="WixBundleAction = 2">#(loc.FailureLayoutHeader)</Text>
94 <Text Condition="WixBundleAction = 3">#(loc.FailureUninstallHeader)</Text>
95 <Text Condition="WixBundleAction = 5">#(loc.FailureInstallHeader)</Text>
96 <Text Condition="WixBundleAction = 7">#(loc.FailureRepairHeader)</Text>
97 </Label>
98 <Hypertext Name="FailureLogFileLink" X="11" Y="121" Width="-11" Height="42" FontId="3" TabStop="yes" HideWhenDisabled="yes">#(loc.FailureHyperlinkLogText)</Hypertext>
99 <Hypertext Name="FailureMessageText" X="22" Y="163" Width="-11" Height="51" FontId="3" TabStop="yes" HideWhenDisabled="yes" />
100 <Label Name="FailureRestartText" X="-11" Y="-51" Width="400" Height="34" FontId="3" HideWhenDisabled="yes" DisablePrefix="yes">#(loc.FailureRestartText)</Label>
101 <Button Name="FailureRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.FailureRestartButton)</Button>
102 <Button Name="FailureCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
103 <Text>#(loc.FailureCloseButton)</Text>
104 <CloseWindowAction />
105 </Button>
106 </Page>
107 </Window>
108</Theme>
diff --git a/src/ext/Bal/wixstdba/Resources/RtfTheme.wxl b/src/ext/Bal/wixstdba/Resources/RtfTheme.wxl
new file mode 100644
index 00000000..f73fb994
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/RtfTheme.wxl
@@ -0,0 +1,58 @@
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<WixLocalization Culture="en-us" Language="1033" xmlns="http://wixtoolset.org/schemas/v4/wxl">
6 <String Id="Caption">[WixBundleName] Setup</String>
7 <String Id="Title">[WixBundleName]</String>
8 <String Id="InstallVersion">Version [WixBundleVersion]</String>
9 <String Id="ConfirmCancelMessage">Are you sure you want to cancel?</String>
10 <String Id="ExecuteUpgradeRelatedBundleMessage">Previous version</String>
11 <String Id="HelpHeader">Setup Help</String>
12 <String Id="HelpText">/install | /repair | /uninstall | /layout [directory] - installs, repairs, uninstalls or
13 creates a complete local copy of the bundle in directory. Install is the default.
14
15/passive | /quiet - displays minimal UI with no prompts or displays no UI and
16 no prompts. By default UI and all prompts are displayed.
17
18/norestart - suppress any attempts to restart. By default UI will prompt before restart.
19/log log.txt - logs to a specific file. By default a log file is created in %TEMP%.</String>
20 <String Id="HelpCloseButton">&amp;Close</String>
21 <String Id="InstallAcceptCheckbox">I &amp;agree to the license terms and conditions</String>
22 <String Id="InstallOptionsButton">&amp;Options</String>
23 <String Id="InstallInstallButton">&amp;Install</String>
24 <String Id="InstallCancelButton">&amp;Cancel</String>
25 <String Id="OptionsHeader">Setup Options</String>
26 <String Id="OptionsLocationLabel">Install location:</String>
27 <String Id="OptionsBrowseButton">&amp;Browse</String>
28 <String Id="OptionsOkButton">&amp;OK</String>
29 <String Id="OptionsCancelButton">&amp;Cancel</String>
30 <String Id="ProgressHeader">Setup Progress</String>
31 <String Id="ProgressLabel">Processing:</String>
32 <String Id="OverallProgressPackageText">Initializing...</String>
33 <String Id="ProgressCancelButton">&amp;Cancel</String>
34 <String Id="ModifyHeader">Modify Setup</String>
35 <String Id="ModifyRepairButton">&amp;Repair</String>
36 <String Id="ModifyUninstallButton">&amp;Uninstall</String>
37 <String Id="ModifyCancelButton">&amp;Cancel</String>
38 <String Id="SuccessHeader">Setup Successful</String>
39 <String Id="SuccessInstallHeader">Installation Successfully Completed</String>
40 <String Id="SuccessLayoutHeader">Layout Successfully Completed</String>
41 <String Id="SuccessRepairHeader">Repair Successfully Completed</String>
42 <String Id="SuccessUninstallHeader">Uninstall Successfully Completed</String>
43 <String Id="SuccessLaunchButton">&amp;Launch</String>
44 <String Id="SuccessRestartText">You must restart your computer before you can use the software.</String>
45 <String Id="SuccessUninstallRestartText">You must restart your computer to complete the removal of the software.</String>
46 <String Id="SuccessRestartButton">&amp;Restart</String>
47 <String Id="SuccessCloseButton">&amp;Close</String>
48 <String Id="FailureHeader">Setup Failed</String>
49 <String Id="FailureInstallHeader">Setup Failed</String>
50 <String Id="FailureLayoutHeader">Layout Failed</String>
51 <String Id="FailureRepairHeader">Repair Failed</String>
52 <String Id="FailureUninstallHeader">Uninstall Failed</String>
53 <String Id="FailureHyperlinkLogText">One or more issues caused the setup to fail. Please fix the issues and then retry setup. For more information see the &lt;a href="#"&gt;log file&lt;/a&gt;.</String>
54 <String Id="FailureRestartText">You must restart your computer to complete the rollback of the software.</String>
55 <String Id="FailureRestartButton">&amp;Restart</String>
56 <String Id="FailureCloseButton">&amp;Close</String>
57 <String Id="ErrorFailNoActionReboot">No action was taken as a system reboot is required.</String>
58</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/RtfTheme.xml b/src/ext/Bal/wixstdba/Resources/RtfTheme.xml
new file mode 100644
index 00000000..d6535bac
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/RtfTheme.xml
@@ -0,0 +1,106 @@
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<Theme xmlns="http://wixtoolset.org/schemas/v4/thmutil">
6 <Font Id="0" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font>
7 <Font Id="1" Height="-24" Weight="500" Foreground="windowtext">Segoe UI</Font>
8 <Font Id="2" Height="-22" Weight="500" Foreground="graytext">Segoe UI</Font>
9 <Font Id="3" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font>
10
11 <Window Width="485" Height="300" HexStyle="100a0000" FontId="0" Caption="#(loc.Caption)">
12 <ImageControl X="11" Y="11" Width="64" Height="64" ImageFile="logo.png" Visible="yes"/>
13 <Label X="80" Y="11" Width="-11" Height="64" FontId="1" Visible="yes" DisablePrefix="yes">#(loc.Title)</Label>
14
15 <Page Name="Help">
16 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.HelpHeader)</Label>
17 <Label X="11" Y="112" Width="-11" Height="-35" FontId="3" DisablePrefix="yes">#(loc.HelpText)</Label>
18 <Button Name="HelpCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
19 <Text>#(loc.HelpCloseButton)</Text>
20 <CloseWindowAction />
21 </Button>
22 </Page>
23 <Page Name="Install">
24 <Richedit Name="EulaRichedit" X="11" Y="80" Width="-11" Height="-70" TabStop="yes" FontId="0" HexStyle="800000" />
25 <Checkbox Name="EulaAcceptCheckbox" X="-11" Y="-41" Width="260" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallAcceptCheckbox)</Checkbox>
26 <Button Name="OptionsButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" VisibleCondition="NOT WixStdBASuppressOptionsUI">
27 <Text>#(loc.InstallOptionsButton)</Text>
28 <ChangePageAction Page="Options" />
29 </Button>
30 <Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
31 <Button Name="InstallCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
32 <Text>#(loc.InstallCancelButton)</Text>
33 <CloseWindowAction />
34 </Button>
35 </Page>
36 <Page Name="Options">
37 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.OptionsHeader)</Label>
38 <Label X="11" Y="121" Width="-11" Height="17" FontId="3" DisablePrefix="yes">#(loc.OptionsLocationLabel)</Label>
39 <Editbox Name="InstallFolder" X="11" Y="143" Width="-91" Height="21" TabStop="yes" FontId="3" FileSystemAutoComplete="yes" />
40 <Button Name="BrowseButton" X="-11" Y="142" Width="75" Height="23" TabStop="yes" FontId="3">
41 <Text>#(loc.OptionsBrowseButton)</Text>
42 <BrowseDirectoryAction VariableName="InstallFolder" />
43 </Button>
44 <Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
45 <Text>#(loc.OptionsOkButton)</Text>
46 <ChangePageAction Page="Install" />
47 </Button>
48 <Button Name="OptionsCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
49 <Text>#(loc.OptionsCancelButton)</Text>
50 <ChangePageAction Page="Install" Cancel="yes" />
51 </Button>
52 </Page>
53 <Page Name="Progress">
54 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ProgressHeader)</Label>
55 <Label X="11" Y="121" Width="70" Height="17" FontId="3" DisablePrefix="yes">#(loc.ProgressLabel)</Label>
56 <Label Name="OverallProgressPackageText" X="85" Y="121" Width="-11" Height="17" FontId="3" DisablePrefix="yes">#(loc.OverallProgressPackageText)</Label>
57 <Progressbar Name="OverallCalculatedProgressbar" X="11" Y="143" Width="-11" Height="15" />
58 <Button Name="ProgressCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ProgressCancelButton)</Button>
59 </Page>
60 <Page Name="Modify">
61 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ModifyHeader)</Label>
62 <Button Name="RepairButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.ModifyRepairButton)</Button>
63 <Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ModifyUninstallButton)</Button>
64 <Button Name="ModifyCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
65 <Text>#(loc.ModifyCancelButton)</Text>
66 <CloseWindowAction />
67 </Button>
68 </Page>
69 <Page Name="Success">
70 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">
71 <Text>#(loc.SuccessHeader)</Text>
72 <Text Condition="WixBundleAction = 2">#(loc.SuccessLayoutHeader)</Text>
73 <Text Condition="WixBundleAction = 3">#(loc.SuccessUninstallHeader)</Text>
74 <Text Condition="WixBundleAction = 5">#(loc.SuccessInstallHeader)</Text>
75 <Text Condition="WixBundleAction = 7">#(loc.SuccessRepairHeader)</Text>
76 </Label>
77 <Button Name="LaunchButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.SuccessLaunchButton)</Button>
78 <Label X="-11" Y="-51" Width="400" Height="34" FontId="3" DisablePrefix="yes" VisibleCondition="WixStdBARestartRequired">
79 <Text>#(loc.SuccessRestartText)</Text>
80 <Text Condition="WixBundleAction = 3">#(loc.SuccessUninstallRestartText)</Text>
81 </Label>
82 <Button Name="SuccessRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.SuccessRestartButton)</Button>
83 <Button Name="SuccessCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
84 <Text>#(loc.SuccessCloseButton)</Text>
85 <CloseWindowAction />
86 </Button>
87 </Page>
88 <Page Name="Failure">
89 <Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">
90 <Text>#(loc.FailureHeader)</Text>
91 <Text Condition="WixBundleAction = 2">#(loc.FailureLayoutHeader)</Text>
92 <Text Condition="WixBundleAction = 3">#(loc.FailureUninstallHeader)</Text>
93 <Text Condition="WixBundleAction = 5">#(loc.FailureInstallHeader)</Text>
94 <Text Condition="WixBundleAction = 7">#(loc.FailureRepairHeader)</Text>
95 </Label>
96 <Hypertext Name="FailureLogFileLink" X="11" Y="121" Width="-11" Height="42" FontId="3" TabStop="yes" HideWhenDisabled="yes">#(loc.FailureHyperlinkLogText)</Hypertext>
97 <Hypertext Name="FailureMessageText" X="22" Y="163" Width="-11" Height="51" FontId="3" TabStop="yes" HideWhenDisabled="yes" />
98 <Label X="-11" Y="-51" Width="400" Height="34" FontId="3" DisablePrefix="yes" VisibleCondition="WixStdBARestartRequired">#(loc.FailureRestartText)</Label>
99 <Button Name="FailureRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.FailureRestartButton)</Button>
100 <Button Name="FailureCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
101 <Text>#(loc.FailureCloseButton)</Text>
102 <CloseWindowAction />
103 </Button>
104 </Page>
105 </Window>
106</Theme>
diff --git a/src/ext/Bal/wixstdba/Resources/dncpreq.thm b/src/ext/Bal/wixstdba/Resources/dncpreq.thm
new file mode 100644
index 00000000..4ae61819
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/dncpreq.thm
@@ -0,0 +1,47 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Theme xmlns="http://wixtoolset.org/schemas/v4/thmutil">
3 <Font Id="0" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font>
4 <Font Id="1" Height="-24" Weight="500" Foreground="windowtext">Segoe UI</Font>
5 <Font Id="2" Height="-22" Weight="500" Foreground="graytext">Segoe UI</Font>
6 <Font Id="3" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font>
7
8 <Window Width="485" Height="300" HexStyle="100a0000" FontId="0" Caption="#(loc.Caption)">
9 <ImageControl X="11" Y="11" Width="64" Height="64" ImageFile="mbapreq.png" Visible="yes"/>
10 <Label X="80" Y="11" Width="-11" Height="96" FontId="1" Visible="yes" DisablePrefix="yes">#(loc.Title)</Label>
11
12 <Page Name="Help">
13 <Label X="11" Y="112" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.HelpHeader)</Label>
14 <Label X="11" Y="153" Width="-11" Height="-35" FontId="3" DisablePrefix="yes">#(loc.HelpText)</Label>
15 <Button Name="HelpCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
16 <Text>#(loc.HelpCloseButton)</Text>
17 <CloseWindowAction />
18 </Button>
19 </Page>
20 <Page Name="Install">
21 <Hypertext Name="EulaHyperlink" X="11" Y="121" Width="-11" Height="34" TabStop="yes" FontId="3">#(loc.InstallLicenseTerms)</Hypertext>
22 <Button Name="InstallButton" X="-91" Y="-11" Width="130" Height="23" TabStop="yes" FontId="0">#(loc.InstallAcceptAndInstallButton)</Button>
23 <Button Name="InstallDeclineButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
24 <Text>#(loc.InstallDeclineButton)</Text>
25 <CloseWindowAction />
26 </Button>
27 </Page>
28 <Page Name="Progress">
29 <Label X="11" Y="112" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ProgressHeader)</Label>
30 <Label X="11" Y="153" Width="70" Height="17" FontId="3" DisablePrefix="yes">#(loc.ProgressLabel)</Label>
31 <Label Name="OverallProgressPackageText" X="85" Y="153" Width="-11" Height="17" FontId="3" DisablePrefix="yes">[ProgressPackageName]</Label>
32 <Progressbar Name="OverallCalculatedProgressbar" X="11" Y="175" Width="-11" Height="15" />
33 <Button Name="ProgressCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ProgressCancelButton)</Button>
34 </Page>
35 <Page Name="Failure">
36 <Label X="11" Y="112" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.FailureHeader)</Label>
37 <Hypertext Name="FailureLogFileLink" X="11" Y="153" Width="-11" Height="51" FontId="3" TabStop="yes" HideWhenDisabled="yes">#(loc.FailureLogLinkText)</Hypertext>
38 <Hypertext Name="FailureMessageText" X="22" Y="190" Width="-11" Height="51" FontId="3" TabStop="yes" HideWhenDisabled="yes"/>
39 <Label X="-11" Y="-20" Width="400" Height="34" FontId="3" DisablePrefix="yes" VisibleCondition="WixStdBARestartRequired">#(loc.FailureRestartText)</Label>
40 <Button Name="FailureRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.FailureRestartButton)</Button>
41 <Button Name="FailureCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
42 <Text>#(loc.FailureCloseButton)</Text>
43 <CloseWindowAction />
44 </Button>
45 </Page>
46 </Window>
47</Theme>
diff --git a/src/ext/Bal/wixstdba/Resources/dncpreq.wxl b/src/ext/Bal/wixstdba/Resources/dncpreq.wxl
new file mode 100644
index 00000000..d6b73b5f
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/dncpreq.wxl
@@ -0,0 +1,29 @@
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<WixLocalization Culture="en-us" Language="1033" xmlns="http://wixtoolset.org/schemas/v4/wxl">
6 <String Id="Caption">[WixBundleName] Setup</String>
7 <String Id="Title">Microsoft .NET Core required for [WixBundleName] setup</String>
8 <String Id="ConfirmCancelMessage">Are you sure you want to cancel?</String>
9 <String Id="HelpHeader">Setup Help</String>
10 <String Id="HelpText">/passive | /quiet - displays minimal UI with no prompts or displays no UI and
11 no prompts. By default UI and all prompts are displayed.
12
13/norestart - suppress any attempts to restart. By default UI will prompt before restart.
14/log log.txt - logs to a specific file. By default a log file is created in %TEMP%.</String>
15 <String Id="HelpCloseButton">&amp;Close</String>
16 <String Id="InstallLicenseTerms">Click the "Accept and Install" button to accept the Microsoft .NET Core &lt;a href="#"&gt;license terms&lt;/a&gt;.</String>
17 <String Id="InstallAcceptAndInstallButton">&amp;Accept and Install</String>
18 <String Id="InstallDeclineButton">&amp;Decline</String>
19 <String Id="ProgressHeader">Setup Progress</String>
20 <String Id="ProgressLabel">Processing:</String>
21 <String Id="ProgressCancelButton">&amp;Cancel</String>
22 <String Id="FailureHeader">Setup Failed</String>
23 <String Id="FailureLogLinkText">One or more issues caused the setup to fail. Please fix the issues and then retry setup. For more information see the &lt;a href="#"&gt;log file&lt;/a&gt;.</String>
24 <String Id="FailureRestartText">You must restart your computer to complete the rollback of the software.</String>
25 <String Id="FailureRestartButton">&amp;Restart</String>
26 <String Id="FailureCloseButton">&amp;Close</String>
27 <String Id="SCDRUNTIMEFAILUREErrorMessage">[WixBundleName] cannot run on this machine. Install the latest updates and/or the latest OS to run in a supported environment.</String>
28 <String Id="ErrorFailNoActionReboot">No action was taken as a system reboot is required.</String>
29</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/Resources/logo.png b/src/ext/Bal/wixstdba/Resources/logo.png
new file mode 100644
index 00000000..7adc6e11
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/logo.png
Binary files differ
diff --git a/src/ext/Bal/wixstdba/Resources/logoSide.png b/src/ext/Bal/wixstdba/Resources/logoSide.png
new file mode 100644
index 00000000..308841c5
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/logoSide.png
Binary files differ
diff --git a/src/ext/Bal/wixstdba/Resources/mbapreq.png b/src/ext/Bal/wixstdba/Resources/mbapreq.png
new file mode 100644
index 00000000..c6e9527b
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/mbapreq.png
Binary files differ
diff --git a/src/ext/Bal/wixstdba/Resources/mbapreq.thm b/src/ext/Bal/wixstdba/Resources/mbapreq.thm
new file mode 100644
index 00000000..4ae61819
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/mbapreq.thm
@@ -0,0 +1,47 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Theme xmlns="http://wixtoolset.org/schemas/v4/thmutil">
3 <Font Id="0" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font>
4 <Font Id="1" Height="-24" Weight="500" Foreground="windowtext">Segoe UI</Font>
5 <Font Id="2" Height="-22" Weight="500" Foreground="graytext">Segoe UI</Font>
6 <Font Id="3" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font>
7
8 <Window Width="485" Height="300" HexStyle="100a0000" FontId="0" Caption="#(loc.Caption)">
9 <ImageControl X="11" Y="11" Width="64" Height="64" ImageFile="mbapreq.png" Visible="yes"/>
10 <Label X="80" Y="11" Width="-11" Height="96" FontId="1" Visible="yes" DisablePrefix="yes">#(loc.Title)</Label>
11
12 <Page Name="Help">
13 <Label X="11" Y="112" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.HelpHeader)</Label>
14 <Label X="11" Y="153" Width="-11" Height="-35" FontId="3" DisablePrefix="yes">#(loc.HelpText)</Label>
15 <Button Name="HelpCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
16 <Text>#(loc.HelpCloseButton)</Text>
17 <CloseWindowAction />
18 </Button>
19 </Page>
20 <Page Name="Install">
21 <Hypertext Name="EulaHyperlink" X="11" Y="121" Width="-11" Height="34" TabStop="yes" FontId="3">#(loc.InstallLicenseTerms)</Hypertext>
22 <Button Name="InstallButton" X="-91" Y="-11" Width="130" Height="23" TabStop="yes" FontId="0">#(loc.InstallAcceptAndInstallButton)</Button>
23 <Button Name="InstallDeclineButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
24 <Text>#(loc.InstallDeclineButton)</Text>
25 <CloseWindowAction />
26 </Button>
27 </Page>
28 <Page Name="Progress">
29 <Label X="11" Y="112" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ProgressHeader)</Label>
30 <Label X="11" Y="153" Width="70" Height="17" FontId="3" DisablePrefix="yes">#(loc.ProgressLabel)</Label>
31 <Label Name="OverallProgressPackageText" X="85" Y="153" Width="-11" Height="17" FontId="3" DisablePrefix="yes">[ProgressPackageName]</Label>
32 <Progressbar Name="OverallCalculatedProgressbar" X="11" Y="175" Width="-11" Height="15" />
33 <Button Name="ProgressCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ProgressCancelButton)</Button>
34 </Page>
35 <Page Name="Failure">
36 <Label X="11" Y="112" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.FailureHeader)</Label>
37 <Hypertext Name="FailureLogFileLink" X="11" Y="153" Width="-11" Height="51" FontId="3" TabStop="yes" HideWhenDisabled="yes">#(loc.FailureLogLinkText)</Hypertext>
38 <Hypertext Name="FailureMessageText" X="22" Y="190" Width="-11" Height="51" FontId="3" TabStop="yes" HideWhenDisabled="yes"/>
39 <Label X="-11" Y="-20" Width="400" Height="34" FontId="3" DisablePrefix="yes" VisibleCondition="WixStdBARestartRequired">#(loc.FailureRestartText)</Label>
40 <Button Name="FailureRestartButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.FailureRestartButton)</Button>
41 <Button Name="FailureCloseButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
42 <Text>#(loc.FailureCloseButton)</Text>
43 <CloseWindowAction />
44 </Button>
45 </Page>
46 </Window>
47</Theme>
diff --git a/src/ext/Bal/wixstdba/Resources/mbapreq.wxl b/src/ext/Bal/wixstdba/Resources/mbapreq.wxl
new file mode 100644
index 00000000..95e3a6ae
--- /dev/null
+++ b/src/ext/Bal/wixstdba/Resources/mbapreq.wxl
@@ -0,0 +1,29 @@
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<WixLocalization Culture="en-us" Language="1033" xmlns="http://wixtoolset.org/schemas/v4/wxl">
6 <String Id="Caption">[WixBundleName] Setup</String>
7 <String Id="Title">Microsoft .NET Framework required for [WixBundleName] setup</String>
8 <String Id="ConfirmCancelMessage">Are you sure you want to cancel?</String>
9 <String Id="HelpHeader">Setup Help</String>
10 <String Id="HelpText">/passive | /quiet - displays minimal UI with no prompts or displays no UI and
11 no prompts. By default UI and all prompts are displayed.
12
13/norestart - suppress any attempts to restart. By default UI will prompt before restart.
14/log log.txt - logs to a specific file. By default a log file is created in %TEMP%.</String>
15 <String Id="HelpCloseButton">&amp;Close</String>
16 <String Id="InstallLicenseTerms">Click the "Accept and Install" button to accept the Microsoft .NET Framework &lt;a href="#"&gt;license terms&lt;/a&gt;.</String>
17 <String Id="InstallAcceptAndInstallButton">&amp;Accept and Install</String>
18 <String Id="InstallDeclineButton">&amp;Decline</String>
19 <String Id="ProgressHeader">Setup Progress</String>
20 <String Id="ProgressLabel">Processing:</String>
21 <String Id="ProgressCancelButton">&amp;Cancel</String>
22 <String Id="FailureHeader">Setup Failed</String>
23 <String Id="FailureLogLinkText">One or more issues caused the setup to fail. Please fix the issues and then retry setup. For more information see the &lt;a href="#"&gt;log file&lt;/a&gt;.</String>
24 <String Id="FailureRestartText">You must restart your computer to complete the rollback of the software.</String>
25 <String Id="FailureRestartButton">&amp;Restart</String>
26 <String Id="FailureCloseButton">&amp;Close</String>
27 <String Id="NET452WIN7RTMErrorMessage">[WixBundleName] cannot run on Windows 7 RTM with .NET 4.5.2 installed. Install Windows 7 SP1 to run in a supported environment.</String>
28 <String Id="ErrorFailNoActionReboot">No action was taken as a system reboot is required.</String>
29</WixLocalization>
diff --git a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp
new file mode 100644
index 00000000..d4bf7b43
--- /dev/null
+++ b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp
@@ -0,0 +1,4264 @@
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#include "precomp.h"
4#include "BalBaseBootstrapperApplicationProc.h"
5#include "BalBaseBootstrapperApplication.h"
6
7static const LPCWSTR WIXBUNDLE_VARIABLE_ELEVATED = L"WixBundleElevated";
8
9static const LPCWSTR WIXSTDBA_WINDOW_CLASS = L"WixStdBA";
10
11static const LPCWSTR WIXSTDBA_VARIABLE_INSTALL_FOLDER = L"InstallFolder";
12static const LPCWSTR WIXSTDBA_VARIABLE_LAUNCH_TARGET_PATH = L"LaunchTarget";
13static const LPCWSTR WIXSTDBA_VARIABLE_LAUNCH_TARGET_ELEVATED_ID = L"LaunchTargetElevatedId";
14static const LPCWSTR WIXSTDBA_VARIABLE_LAUNCH_ARGUMENTS = L"LaunchArguments";
15static const LPCWSTR WIXSTDBA_VARIABLE_LAUNCH_HIDDEN = L"LaunchHidden";
16static const LPCWSTR WIXSTDBA_VARIABLE_LAUNCH_WORK_FOLDER = L"LaunchWorkingFolder";
17
18static const DWORD WIXSTDBA_ACQUIRE_PERCENTAGE = 30;
19
20static const LPCWSTR WIXSTDBA_VARIABLE_BUNDLE_FILE_VERSION = L"WixBundleFileVersion";
21static const LPCWSTR WIXSTDBA_VARIABLE_LANGUAGE_ID = L"WixStdBALanguageId";
22static const LPCWSTR WIXSTDBA_VARIABLE_RESTART_REQUIRED = L"WixStdBARestartRequired";
23static const LPCWSTR WIXSTDBA_VARIABLE_SHOW_VERSION = L"WixStdBAShowVersion";
24static const LPCWSTR WIXSTDBA_VARIABLE_SUPPRESS_OPTIONS_UI = L"WixStdBASuppressOptionsUI";
25
26enum WIXSTDBA_STATE
27{
28 WIXSTDBA_STATE_INITIALIZING,
29 WIXSTDBA_STATE_INITIALIZED,
30 WIXSTDBA_STATE_HELP,
31 WIXSTDBA_STATE_DETECTING,
32 WIXSTDBA_STATE_DETECTED,
33 WIXSTDBA_STATE_PLANNING,
34 WIXSTDBA_STATE_PLANNED,
35 WIXSTDBA_STATE_APPLYING,
36 WIXSTDBA_STATE_CACHING,
37 WIXSTDBA_STATE_CACHED,
38 WIXSTDBA_STATE_EXECUTING,
39 WIXSTDBA_STATE_EXECUTED,
40 WIXSTDBA_STATE_APPLIED,
41 WIXSTDBA_STATE_FAILED,
42};
43
44enum WM_WIXSTDBA
45{
46 WM_WIXSTDBA_SHOW_HELP = WM_APP + 100,
47 WM_WIXSTDBA_DETECT_PACKAGES,
48 WM_WIXSTDBA_PLAN_PACKAGES,
49 WM_WIXSTDBA_APPLY_PACKAGES,
50 WM_WIXSTDBA_CHANGE_STATE,
51 WM_WIXSTDBA_SHOW_FAILURE,
52};
53
54// This enum must be kept in the same order as the vrgwzPageNames array.
55enum WIXSTDBA_PAGE
56{
57 WIXSTDBA_PAGE_LOADING,
58 WIXSTDBA_PAGE_HELP,
59 WIXSTDBA_PAGE_INSTALL,
60 WIXSTDBA_PAGE_MODIFY,
61 WIXSTDBA_PAGE_PROGRESS,
62 WIXSTDBA_PAGE_PROGRESS_PASSIVE,
63 WIXSTDBA_PAGE_SUCCESS,
64 WIXSTDBA_PAGE_FAILURE,
65 COUNT_WIXSTDBA_PAGE,
66};
67
68// This array must be kept in the same order as the WIXSTDBA_PAGE enum.
69static LPCWSTR vrgwzPageNames[] = {
70 L"Loading",
71 L"Help",
72 L"Install",
73 L"Modify",
74 L"Progress",
75 L"ProgressPassive",
76 L"Success",
77 L"Failure",
78};
79
80enum WIXSTDBA_CONTROL
81{
82 // Welcome page
83 WIXSTDBA_CONTROL_INSTALL_BUTTON = THEME_FIRST_ASSIGN_CONTROL_ID,
84 WIXSTDBA_CONTROL_EULA_RICHEDIT,
85 WIXSTDBA_CONTROL_EULA_LINK,
86 WIXSTDBA_CONTROL_EULA_ACCEPT_CHECKBOX,
87
88 // Modify page
89 WIXSTDBA_CONTROL_REPAIR_BUTTON,
90 WIXSTDBA_CONTROL_UNINSTALL_BUTTON,
91
92 // Progress page
93 WIXSTDBA_CONTROL_CACHE_PROGRESS_PACKAGE_TEXT,
94 WIXSTDBA_CONTROL_CACHE_PROGRESS_BAR,
95 WIXSTDBA_CONTROL_CACHE_PROGRESS_TEXT,
96
97 WIXSTDBA_CONTROL_EXECUTE_PROGRESS_PACKAGE_TEXT,
98 WIXSTDBA_CONTROL_EXECUTE_PROGRESS_BAR,
99 WIXSTDBA_CONTROL_EXECUTE_PROGRESS_TEXT,
100 WIXSTDBA_CONTROL_EXECUTE_PROGRESS_ACTIONDATA_TEXT,
101
102 WIXSTDBA_CONTROL_OVERALL_PROGRESS_PACKAGE_TEXT,
103 WIXSTDBA_CONTROL_OVERALL_PROGRESS_BAR,
104 WIXSTDBA_CONTROL_OVERALL_CALCULATED_PROGRESS_BAR,
105 WIXSTDBA_CONTROL_OVERALL_PROGRESS_TEXT,
106
107 WIXSTDBA_CONTROL_PROGRESS_CANCEL_BUTTON,
108
109 // Success page
110 WIXSTDBA_CONTROL_LAUNCH_BUTTON,
111 WIXSTDBA_CONTROL_SUCCESS_RESTART_BUTTON,
112
113 // Failure page
114 WIXSTDBA_CONTROL_FAILURE_LOGFILE_LINK,
115 WIXSTDBA_CONTROL_FAILURE_MESSAGE_TEXT,
116 WIXSTDBA_CONTROL_FAILURE_RESTART_BUTTON,
117};
118
119static THEME_ASSIGN_CONTROL_ID vrgInitControls[] = {
120 { WIXSTDBA_CONTROL_INSTALL_BUTTON, L"InstallButton" },
121 { WIXSTDBA_CONTROL_EULA_RICHEDIT, L"EulaRichedit" },
122 { WIXSTDBA_CONTROL_EULA_LINK, L"EulaHyperlink" },
123 { WIXSTDBA_CONTROL_EULA_ACCEPT_CHECKBOX, L"EulaAcceptCheckbox" },
124
125 { WIXSTDBA_CONTROL_REPAIR_BUTTON, L"RepairButton" },
126 { WIXSTDBA_CONTROL_UNINSTALL_BUTTON, L"UninstallButton" },
127
128 { WIXSTDBA_CONTROL_CACHE_PROGRESS_PACKAGE_TEXT, L"CacheProgressPackageText" },
129 { WIXSTDBA_CONTROL_CACHE_PROGRESS_BAR, L"CacheProgressbar" },
130 { WIXSTDBA_CONTROL_CACHE_PROGRESS_TEXT, L"CacheProgressText" },
131 { WIXSTDBA_CONTROL_EXECUTE_PROGRESS_PACKAGE_TEXT, L"ExecuteProgressPackageText" },
132 { WIXSTDBA_CONTROL_EXECUTE_PROGRESS_BAR, L"ExecuteProgressbar" },
133 { WIXSTDBA_CONTROL_EXECUTE_PROGRESS_TEXT, L"ExecuteProgressText" },
134 { WIXSTDBA_CONTROL_EXECUTE_PROGRESS_ACTIONDATA_TEXT, L"ExecuteProgressActionDataText"},
135 { WIXSTDBA_CONTROL_OVERALL_PROGRESS_PACKAGE_TEXT, L"OverallProgressPackageText" },
136 { WIXSTDBA_CONTROL_OVERALL_PROGRESS_BAR, L"OverallProgressbar" },
137 { WIXSTDBA_CONTROL_OVERALL_CALCULATED_PROGRESS_BAR, L"OverallCalculatedProgressbar" },
138 { WIXSTDBA_CONTROL_OVERALL_PROGRESS_TEXT, L"OverallProgressText" },
139 { WIXSTDBA_CONTROL_PROGRESS_CANCEL_BUTTON, L"ProgressCancelButton" },
140
141 { WIXSTDBA_CONTROL_LAUNCH_BUTTON, L"LaunchButton" },
142 { WIXSTDBA_CONTROL_SUCCESS_RESTART_BUTTON, L"SuccessRestartButton" },
143
144 { WIXSTDBA_CONTROL_FAILURE_LOGFILE_LINK, L"FailureLogFileLink" },
145 { WIXSTDBA_CONTROL_FAILURE_MESSAGE_TEXT, L"FailureMessageText" },
146 { WIXSTDBA_CONTROL_FAILURE_RESTART_BUTTON, L"FailureRestartButton" },
147};
148
149typedef struct _WIXSTDBA_PACKAGE_INFO
150{
151 LPWSTR sczPackageId;
152 BOOL fWasAlreadyInstalled;
153 BOOL fPlannedToBeInstalled;
154 BOOL fSuccessfullyInstalled;
155} WIXSTDBA_PACKAGE_INFO;
156
157
158static HRESULT DAPI EvaluateVariableConditionCallback(
159 __in_z LPCWSTR wzCondition,
160 __out BOOL* pf,
161 __in_opt LPVOID pvContext
162 );
163static HRESULT DAPI FormatVariableStringCallback(
164 __in_z LPCWSTR wzFormat,
165 __inout LPWSTR* psczOut,
166 __in_opt LPVOID pvContext
167 );
168static HRESULT DAPI GetVariableNumericCallback(
169 __in_z LPCWSTR wzVariable,
170 __out LONGLONG* pllValue,
171 __in_opt LPVOID pvContext
172 );
173static HRESULT DAPI SetVariableNumericCallback(
174 __in_z LPCWSTR wzVariable,
175 __in LONGLONG llValue,
176 __in_opt LPVOID pvContext
177 );
178static HRESULT DAPI GetVariableStringCallback(
179 __in_z LPCWSTR wzVariable,
180 __inout LPWSTR* psczValue,
181 __in_opt LPVOID pvContext
182 );
183static HRESULT DAPI SetVariableStringCallback(
184 __in_z LPCWSTR wzVariable,
185 __in_z_opt LPCWSTR wzValue,
186 __in BOOL fFormatted,
187 __in_opt LPVOID pvContext
188 );
189static LPCSTR LoggingRequestStateToString(
190 __in BOOTSTRAPPER_REQUEST_STATE requestState
191 );
192static LPCSTR LoggingMsiFeatureStateToString(
193 __in BOOTSTRAPPER_FEATURE_STATE featureState
194 );
195
196
197class CWixStandardBootstrapperApplication : public CBalBaseBootstrapperApplication
198{
199public: // IBootstrapperApplication
200 virtual STDMETHODIMP OnStartup()
201 {
202 HRESULT hr = S_OK;
203 DWORD dwUIThreadId = 0;
204
205 // create UI thread
206 m_hUiThread = ::CreateThread(NULL, 0, UiThreadProc, this, 0, &dwUIThreadId);
207 if (!m_hUiThread)
208 {
209 ExitWithLastError(hr, "Failed to create UI thread.");
210 }
211
212 LExit:
213 return hr;
214 }
215
216
217 virtual STDMETHODIMP OnShutdown(
218 __inout BOOTSTRAPPER_SHUTDOWN_ACTION* pAction
219 )
220 {
221 HRESULT hr = S_OK;
222
223 // wait for UI thread to terminate
224 if (m_hUiThread)
225 {
226 ::WaitForSingleObject(m_hUiThread, INFINITE);
227 ReleaseHandle(m_hUiThread);
228 }
229
230 // If a restart was required.
231 if (m_fRestartRequired)
232 {
233 if (m_fAllowRestart)
234 {
235 *pAction = BOOTSTRAPPER_SHUTDOWN_ACTION_RESTART;
236 }
237
238 if (m_fPrereq)
239 {
240 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, m_fAllowRestart ? "The prerequisites scheduled a restart. The bootstrapper application will be reloaded after the computer is restarted."
241 : "A restart is required by the prerequisites but the user delayed it. The bootstrapper application will be reloaded after the computer is restarted.");
242 }
243 }
244 else if (m_fPrereqInstalled)
245 {
246 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "The prerequisites were successfully installed. The bootstrapper application will be reloaded.");
247 *pAction = BOOTSTRAPPER_SHUTDOWN_ACTION_RELOAD_BOOTSTRAPPER;
248 }
249 else if (m_fPrereqAlreadyInstalled)
250 {
251 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "The prerequisites were already installed. The bootstrapper application will not be reloaded to prevent an infinite loop.");
252 }
253 else if (m_fPrereq)
254 {
255 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "The prerequisites were not successfully installed, error: 0x%x. The bootstrapper application will be not reloaded.", m_hrFinal);
256 }
257
258 return hr;
259 }
260
261
262 virtual STDMETHODIMP OnDetectRelatedBundle(
263 __in LPCWSTR wzBundleId,
264 __in BOOTSTRAPPER_RELATION_TYPE relationType,
265 __in LPCWSTR wzBundleTag,
266 __in BOOL fPerMachine,
267 __in LPCWSTR wzVersion,
268 __in BOOTSTRAPPER_RELATED_OPERATION operation,
269 __in BOOL fMissingFromCache,
270 __inout BOOL* pfCancel
271 )
272 {
273 BAL_INFO_PACKAGE* pPackage = NULL;
274
275 if (!fMissingFromCache)
276 {
277 if (SUCCEEDED(BalInfoAddRelatedBundleAsPackage(&m_Bundle.packages, wzBundleId, relationType, fPerMachine, &pPackage)))
278 {
279 InitializePackageInfoForPackage(pPackage);
280 }
281
282 // If we're not doing a prerequisite install, remember when our bundle would cause a downgrade.
283 if (!m_fPrereq && BOOTSTRAPPER_RELATED_OPERATION_DOWNGRADE == operation)
284 {
285 m_fDowngrading = TRUE;
286 }
287 }
288
289 return CBalBaseBootstrapperApplication::OnDetectRelatedBundle(wzBundleId, relationType, wzBundleTag, fPerMachine, wzVersion, operation, fMissingFromCache, pfCancel);
290 }
291
292
293 virtual STDMETHODIMP OnDetectPackageComplete(
294 __in LPCWSTR wzPackageId,
295 __in HRESULT /*hrStatus*/,
296 __in BOOTSTRAPPER_PACKAGE_STATE state
297 )
298 {
299 WIXSTDBA_PACKAGE_INFO* pPackageInfo = NULL;
300 BAL_INFO_PACKAGE* pPackage = NULL;
301
302 if (BOOTSTRAPPER_PACKAGE_STATE_PRESENT == state &&
303 SUCCEEDED(GetPackageInfo(wzPackageId, &pPackageInfo, &pPackage)) &&
304 pPackageInfo)
305 {
306 // If the package is already installed, remember that.
307 pPackageInfo->fWasAlreadyInstalled = TRUE;
308 }
309
310 return S_OK;
311 }
312
313
314 virtual STDMETHODIMP OnDetectComplete(
315 __in HRESULT hrStatus,
316 __in BOOL /*fEligibleForCleanup*/
317 )
318 {
319 HRESULT hr = S_OK;
320 // If we're not interacting with the user or we're doing a layout or we're resuming just after a force restart
321 // then automatically start planning.
322 BOOL fSkipToPlan = SUCCEEDED(hrStatus) &&
323 (BOOTSTRAPPER_DISPLAY_FULL > m_command.display ||
324 BOOTSTRAPPER_ACTION_LAYOUT == m_command.action ||
325 BOOTSTRAPPER_RESUME_TYPE_REBOOT == m_command.resumeType);
326 // If we're requiring user input (which currently means Install, Repair, or Uninstall)
327 // or if we're skipping to an action that modifies machine state
328 // then evaluate conditions.
329 BOOL fEvaluateConditions = SUCCEEDED(hrStatus) &&
330 (!fSkipToPlan || BOOTSTRAPPER_ACTION_LAYOUT < m_command.action && BOOTSTRAPPER_ACTION_UPDATE_REPLACE > m_command.action);
331
332 if (fEvaluateConditions)
333 {
334 hrStatus = EvaluateConditions();
335 }
336
337 if (FAILED(hrStatus))
338 {
339 fSkipToPlan = FALSE;
340 }
341 else
342 {
343 if (m_fPrereq)
344 {
345 m_fPrereqAlreadyInstalled = TRUE;
346
347 // At this point we have to assume that all prerequisite packages need to be installed, so set to false if any of them aren't installed.
348 for (DWORD i = 0; i < m_Bundle.packages.cPackages; ++i)
349 {
350 BAL_INFO_PACKAGE* pPackage = &m_Bundle.packages.rgPackages[i];
351 WIXSTDBA_PACKAGE_INFO* pPackageInfo = reinterpret_cast<WIXSTDBA_PACKAGE_INFO*>(pPackage->pvCustomData);
352 if (pPackage->fPrereqPackage && pPackageInfo && !pPackageInfo->fWasAlreadyInstalled)
353 {
354 m_fPrereqAlreadyInstalled = FALSE;
355 break;
356 }
357 }
358 }
359 }
360
361 SetState(WIXSTDBA_STATE_DETECTED, hrStatus);
362
363 if (fSkipToPlan)
364 {
365 ::PostMessageW(m_hWnd, WM_WIXSTDBA_PLAN_PACKAGES, 0, m_command.action);
366 }
367
368 return hr;
369 }
370
371
372 virtual STDMETHODIMP OnPlanRelatedBundle(
373 __in_z LPCWSTR wzBundleId,
374 __in BOOTSTRAPPER_REQUEST_STATE recommendedState,
375 __inout_z BOOTSTRAPPER_REQUEST_STATE* pRequestedState,
376 __inout BOOL* pfCancel
377 )
378 {
379 // If we're only installing prerequisites, do not touch related bundles.
380 if (m_fPrereq)
381 {
382 *pRequestedState = BOOTSTRAPPER_REQUEST_STATE_NONE;
383 }
384
385 return CBalBaseBootstrapperApplication::OnPlanRelatedBundle(wzBundleId, recommendedState, pRequestedState, pfCancel);
386 }
387
388
389 virtual STDMETHODIMP OnPlanPackageBegin(
390 __in_z LPCWSTR wzPackageId,
391 __in BOOTSTRAPPER_PACKAGE_STATE state,
392 __in BOOL fCached,
393 __in BOOTSTRAPPER_PACKAGE_CONDITION_RESULT installCondition,
394 __in BOOTSTRAPPER_REQUEST_STATE recommendedState,
395 __in BOOTSTRAPPER_CACHE_TYPE recommendedCacheType,
396 __inout BOOTSTRAPPER_REQUEST_STATE* pRequestState,
397 __inout BOOTSTRAPPER_CACHE_TYPE* pRequestedCacheType,
398 __inout BOOL* pfCancel
399 )
400 {
401 HRESULT hr = S_OK;
402 WIXSTDBA_PACKAGE_INFO* pPackageInfo = NULL;
403 BAL_INFO_PACKAGE* pPackage = NULL;
404
405 // If we're planning to install prerequisites, install them. The prerequisites need to be installed
406 // in all cases (even uninstall!) so the BA can load next.
407 if (m_fPrereq)
408 {
409 // Only install prerequisite packages, and check the InstallCondition on them.
410 BOOL fInstall = FALSE;
411 hr = GetPackageInfo(wzPackageId, &pPackageInfo, &pPackage);
412 if (SUCCEEDED(hr) && pPackage->fPrereqPackage && pPackageInfo)
413 {
414 pPackageInfo->fPlannedToBeInstalled = fInstall = BOOTSTRAPPER_PACKAGE_CONDITION_FALSE != installCondition;
415 }
416
417 if (fInstall)
418 {
419 *pRequestState = BOOTSTRAPPER_REQUEST_STATE_PRESENT;
420 }
421 else
422 {
423 *pRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE;
424 }
425
426 // Don't force cache packages while installing prerequisites.
427 if (BOOTSTRAPPER_CACHE_TYPE_FORCE == *pRequestedCacheType)
428 {
429 *pRequestedCacheType = BOOTSTRAPPER_CACHE_TYPE_KEEP;
430 }
431 }
432 else if (m_sczAfterForcedRestartPackage) // after force restart, skip packages until after the package that caused the restart.
433 {
434 // After restart we need to finish the dependency registration for our package so allow the package
435 // to go present.
436 if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, wzPackageId, -1, m_sczAfterForcedRestartPackage, -1))
437 {
438 // Do not allow a repair because that could put us in a perpetual restart loop.
439 if (BOOTSTRAPPER_REQUEST_STATE_REPAIR == *pRequestState)
440 {
441 *pRequestState = BOOTSTRAPPER_REQUEST_STATE_PRESENT;
442 }
443
444 ReleaseNullStr(m_sczAfterForcedRestartPackage); // no more skipping now.
445 }
446 else // not the matching package, so skip it.
447 {
448 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Skipping package: %ls, after restart because it was applied before the restart.", wzPackageId);
449
450 *pRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE;
451 }
452 }
453
454 return CBalBaseBootstrapperApplication::OnPlanPackageBegin(wzPackageId, state, fCached, installCondition, recommendedState, recommendedCacheType, pRequestState, pRequestedCacheType, pfCancel);
455 }
456
457
458 virtual STDMETHODIMP OnPlanMsiPackage(
459 __in_z LPCWSTR wzPackageId,
460 __in BOOL fExecute,
461 __in BOOTSTRAPPER_ACTION_STATE action,
462 __inout BOOL* pfCancel,
463 __inout BURN_MSI_PROPERTY* pActionMsiProperty,
464 __inout INSTALLUILEVEL* pUiLevel,
465 __inout BOOL* pfDisableExternalUiHandler
466 )
467 {
468 HRESULT hr = S_OK;
469 WIXSTDBA_PACKAGE_INFO* pPackageInfo = NULL;
470 BAL_INFO_PACKAGE* pPackage = NULL;
471 BOOL fShowInternalUI = FALSE;
472 INSTALLUILEVEL uiLevel = INSTALLUILEVEL_NOCHANGE;
473
474 switch (m_command.display)
475 {
476 case BOOTSTRAPPER_DISPLAY_FULL:
477 uiLevel = INSTALLUILEVEL_FULL;
478 break;
479
480 case BOOTSTRAPPER_DISPLAY_PASSIVE:
481 uiLevel = INSTALLUILEVEL_REDUCED;
482 break;
483 }
484
485 if (INSTALLUILEVEL_NOCHANGE != uiLevel)
486 {
487 hr = GetPackageInfo(wzPackageId, &pPackageInfo, &pPackage);
488 if (SUCCEEDED(hr) && pPackage->sczDisplayInternalUICondition)
489 {
490 hr = BalEvaluateCondition(pPackage->sczDisplayInternalUICondition, &fShowInternalUI);
491 BalExitOnFailure(hr, "Failed to evaluate condition for package '%ls': %ls", wzPackageId, pPackage->sczDisplayInternalUICondition);
492
493 if (fShowInternalUI)
494 {
495 *pUiLevel = uiLevel;
496 }
497 }
498 }
499
500 LExit:
501 return __super::OnPlanMsiPackage(wzPackageId, fExecute, action, pfCancel, pActionMsiProperty, pUiLevel, pfDisableExternalUiHandler);
502 }
503
504
505 virtual STDMETHODIMP OnPlanComplete(
506 __in HRESULT hrStatus
507 )
508 {
509 HRESULT hr = S_OK;
510
511 if (m_fPrereq)
512 {
513 m_fPrereqAlreadyInstalled = TRUE;
514
515 // Now that we've planned the packages, we can focus on the prerequisite packages that are supposed to be installed.
516 for (DWORD i = 0; i < m_Bundle.packages.cPackages; ++i)
517 {
518 BAL_INFO_PACKAGE* pPackage = &m_Bundle.packages.rgPackages[i];
519 WIXSTDBA_PACKAGE_INFO* pPackageInfo = reinterpret_cast<WIXSTDBA_PACKAGE_INFO*>(pPackage->pvCustomData);
520 if (pPackage->fPrereqPackage && pPackageInfo && !pPackageInfo->fWasAlreadyInstalled && pPackageInfo->fPlannedToBeInstalled)
521 {
522 m_fPrereqAlreadyInstalled = FALSE;
523 break;
524 }
525 }
526 }
527
528 SetState(WIXSTDBA_STATE_PLANNED, hrStatus);
529
530 if (SUCCEEDED(hrStatus))
531 {
532 ::PostMessageW(m_hWnd, WM_WIXSTDBA_APPLY_PACKAGES, 0, 0);
533 }
534
535 m_fStartedExecution = FALSE;
536 m_dwCalculatedCacheProgress = 0;
537 m_dwCalculatedExecuteProgress = 0;
538
539 return hr;
540 }
541
542
543 virtual STDMETHODIMP OnPauseAutomaticUpdatesBegin(
544 )
545 {
546 HRESULT hr = S_OK;
547 LOC_STRING* pLocString = NULL;
548 LPWSTR sczFormattedString = NULL;
549 LPCWSTR wz = NULL;
550
551 hr = __super::OnPauseAutomaticUpdatesBegin();
552
553 LocGetString(m_pWixLoc, L"#(loc.PauseAutomaticUpdatesMessage)", &pLocString);
554
555 if (pLocString)
556 {
557 BalFormatString(pLocString->wzText, &sczFormattedString);
558 }
559
560 wz = sczFormattedString ? sczFormattedString : L"Pausing Windows automatic updates";
561
562 ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_OVERALL_PROGRESS_PACKAGE_TEXT, wz);
563
564 ReleaseStr(sczFormattedString);
565 return hr;
566 }
567
568
569 virtual STDMETHODIMP OnSystemRestorePointBegin(
570 )
571 {
572 HRESULT hr = S_OK;
573 LOC_STRING* pLocString = NULL;
574 LPWSTR sczFormattedString = NULL;
575 LPCWSTR wz = NULL;
576
577 hr = __super::OnSystemRestorePointBegin();
578
579 LocGetString(m_pWixLoc, L"#(loc.SystemRestorePointMessage)", &pLocString);
580
581 if (pLocString)
582 {
583 BalFormatString(pLocString->wzText, &sczFormattedString);
584 }
585
586 wz = sczFormattedString ? sczFormattedString : L"Creating system restore point";
587
588 ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_OVERALL_PROGRESS_PACKAGE_TEXT, wz);
589
590 ReleaseStr(sczFormattedString);
591 return hr;
592 }
593
594
595 virtual STDMETHODIMP OnCachePackageBegin(
596 __in_z LPCWSTR wzPackageId,
597 __in DWORD cCachePayloads,
598 __in DWORD64 dw64PackageCacheSize,
599 __inout BOOL* pfCancel
600 )
601 {
602 if (wzPackageId && *wzPackageId)
603 {
604 BAL_INFO_PACKAGE* pPackage = NULL;
605 HRESULT hr = BalInfoFindPackageById(&m_Bundle.packages, wzPackageId, &pPackage);
606 LPCWSTR wz = (SUCCEEDED(hr) && pPackage->sczDisplayName) ? pPackage->sczDisplayName : wzPackageId;
607
608 ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_CACHE_PROGRESS_PACKAGE_TEXT, wz);
609
610 // If something started executing, leave it in the overall progress text.
611 if (!m_fStartedExecution)
612 {
613 ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_OVERALL_PROGRESS_PACKAGE_TEXT, wz);
614 }
615 }
616
617 return __super::OnCachePackageBegin(wzPackageId, cCachePayloads, dw64PackageCacheSize, pfCancel);
618 }
619
620
621 virtual STDMETHODIMP OnCacheAcquireProgress(
622 __in_z LPCWSTR wzPackageOrContainerId,
623 __in_z_opt LPCWSTR wzPayloadId,
624 __in DWORD64 dw64Progress,
625 __in DWORD64 dw64Total,
626 __in DWORD dwOverallPercentage,
627 __inout BOOL* pfCancel
628 )
629 {
630#ifdef DEBUG
631 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: OnCacheAcquireProgress() - container/package: %ls, payload: %ls, progress: %I64u, total: %I64u, overall progress: %u%%", wzPackageOrContainerId, wzPayloadId, dw64Progress, dw64Total, dwOverallPercentage);
632#endif
633
634 UpdateCacheProgress(dwOverallPercentage);
635
636 return __super::OnCacheAcquireProgress(wzPackageOrContainerId, wzPayloadId, dw64Progress, dw64Total, dwOverallPercentage, pfCancel);
637 }
638
639
640 virtual STDMETHODIMP OnCacheContainerOrPayloadVerifyProgress(
641 __in_z LPCWSTR wzPackageOrContainerId,
642 __in_z_opt LPCWSTR wzPayloadId,
643 __in DWORD64 dw64Progress,
644 __in DWORD64 dw64Total,
645 __in DWORD dwOverallPercentage,
646 __inout BOOL* pfCancel
647 )
648 {
649#ifdef DEBUG
650 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: OnCacheContainerOrPayloadVerifyProgress() - container/package: %ls, payload: %ls, progress: %I64u, total: %I64u, overall progress: %u%%", wzPackageOrContainerId, wzPayloadId, dw64Progress, dw64Total, dwOverallPercentage);
651#endif
652
653 UpdateCacheProgress(dwOverallPercentage);
654
655 return __super::OnCacheContainerOrPayloadVerifyProgress(wzPackageOrContainerId, wzPayloadId, dw64Progress, dw64Total, dwOverallPercentage, pfCancel);
656 }
657
658
659 virtual STDMETHODIMP OnCachePayloadExtractProgress(
660 __in_z LPCWSTR wzPackageOrContainerId,
661 __in_z_opt LPCWSTR wzPayloadId,
662 __in DWORD64 dw64Progress,
663 __in DWORD64 dw64Total,
664 __in DWORD dwOverallPercentage,
665 __inout BOOL* pfCancel
666 )
667 {
668#ifdef DEBUG
669 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: OnCachePayloadExtractProgress() - container/package: %ls, payload: %ls, progress: %I64u, total: %I64u, overall progress: %u%%", wzPackageOrContainerId, wzPayloadId, dw64Progress, dw64Total, dwOverallPercentage);
670#endif
671
672 UpdateCacheProgress(dwOverallPercentage);
673
674 return __super::OnCachePayloadExtractProgress(wzPackageOrContainerId, wzPayloadId, dw64Progress, dw64Total, dwOverallPercentage, pfCancel);
675 }
676
677
678 virtual STDMETHODIMP OnCacheVerifyProgress(
679 __in_z LPCWSTR wzPackageOrContainerId,
680 __in_z_opt LPCWSTR wzPayloadId,
681 __in DWORD64 dw64Progress,
682 __in DWORD64 dw64Total,
683 __in DWORD dwOverallPercentage,
684 __in BOOTSTRAPPER_CACHE_VERIFY_STEP verifyStep,
685 __inout BOOL* pfCancel
686 )
687 {
688#ifdef DEBUG
689 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: OnCacheVerifyProgress() - container/package: %ls, payload: %ls, progress: %I64u, total: %I64u, overall progress: %u%%, step: %u", wzPackageOrContainerId, wzPayloadId, dw64Progress, dw64Total, dwOverallPercentage, verifyStep);
690#endif
691
692 UpdateCacheProgress(dwOverallPercentage);
693
694 return __super::OnCacheVerifyProgress(wzPackageOrContainerId, wzPayloadId, dw64Progress, dw64Total, dwOverallPercentage, verifyStep, pfCancel);
695 }
696
697
698 virtual STDMETHODIMP OnCacheAcquireComplete(
699 __in_z LPCWSTR wzPackageOrContainerId,
700 __in_z_opt LPCWSTR wzPayloadId,
701 __in HRESULT hrStatus,
702 __in BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION recommendation,
703 __inout BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION* pAction
704 )
705 {
706 SetProgressState(hrStatus);
707 return __super::OnCacheAcquireComplete(wzPackageOrContainerId, wzPayloadId, hrStatus, recommendation, pAction);
708 }
709
710
711 virtual STDMETHODIMP OnCacheContainerOrPayloadVerifyComplete(
712 __in_z LPCWSTR wzPackageOrContainerId,
713 __in_z_opt LPCWSTR wzPayloadId,
714 __in HRESULT hrStatus
715 )
716 {
717 SetProgressState(hrStatus);
718 return __super::OnCacheContainerOrPayloadVerifyComplete(wzPackageOrContainerId, wzPayloadId, hrStatus);
719 }
720
721
722 virtual STDMETHODIMP OnCachePayloadExtractComplete(
723 __in_z LPCWSTR wzPackageOrContainerId,
724 __in_z_opt LPCWSTR wzPayloadId,
725 __in HRESULT hrStatus
726 )
727 {
728 SetProgressState(hrStatus);
729 return __super::OnCachePayloadExtractComplete(wzPackageOrContainerId, wzPayloadId, hrStatus);
730 }
731
732
733 virtual STDMETHODIMP OnCacheVerifyComplete(
734 __in_z LPCWSTR wzPackageId,
735 __in_z LPCWSTR wzPayloadId,
736 __in HRESULT hrStatus,
737 __in BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION recommendation,
738 __inout BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION* pAction
739 )
740 {
741 SetProgressState(hrStatus);
742 return __super::OnCacheVerifyComplete(wzPackageId, wzPayloadId, hrStatus, recommendation, pAction);
743 }
744
745
746 virtual STDMETHODIMP OnCacheComplete(
747 __in HRESULT hrStatus
748 )
749 {
750 UpdateCacheProgress(SUCCEEDED(hrStatus) ? 100 : 0);
751 ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_CACHE_PROGRESS_PACKAGE_TEXT, L"");
752 SetState(WIXSTDBA_STATE_CACHED, S_OK); // we always return success here and let OnApplyComplete() deal with the error.
753 return __super::OnCacheComplete(hrStatus);
754 }
755
756
757 virtual STDMETHODIMP OnError(
758 __in BOOTSTRAPPER_ERROR_TYPE errorType,
759 __in LPCWSTR wzPackageId,
760 __in DWORD dwCode,
761 __in_z LPCWSTR wzError,
762 __in DWORD dwUIHint,
763 __in DWORD /*cData*/,
764 __in_ecount_z_opt(cData) LPCWSTR* /*rgwzData*/,
765 __in int /*nRecommendation*/,
766 __inout int* pResult
767 )
768 {
769 HRESULT hr = S_OK;
770 int nResult = *pResult;
771 LPWSTR sczError = NULL;
772
773 if (BOOTSTRAPPER_DISPLAY_EMBEDDED == m_command.display)
774 {
775 hr = m_pEngine->SendEmbeddedError(dwCode, wzError, dwUIHint, &nResult);
776 if (FAILED(hr))
777 {
778 nResult = IDERROR;
779 }
780 }
781 else if (BOOTSTRAPPER_DISPLAY_FULL == m_command.display)
782 {
783 // If this is an authentication failure, let the engine try to handle it for us.
784 if (BOOTSTRAPPER_ERROR_TYPE_HTTP_AUTH_SERVER == errorType || BOOTSTRAPPER_ERROR_TYPE_HTTP_AUTH_PROXY == errorType)
785 {
786 nResult = IDTRYAGAIN;
787 }
788 else // show a generic error message box.
789 {
790 BalRetryErrorOccurred(wzPackageId, dwCode);
791
792 if (!m_fShowingInternalUiThisPackage)
793 {
794 // If no error message was provided, use the error code to try and get an error message.
795 if (!wzError || !*wzError || BOOTSTRAPPER_ERROR_TYPE_WINDOWS_INSTALLER != errorType)
796 {
797 hr = StrAllocFromError(&sczError, dwCode, NULL);
798 if (FAILED(hr) || !sczError || !*sczError)
799 {
800 // special case for ERROR_FAIL_NOACTION_REBOOT: use loc string for Windows XP
801 if (ERROR_FAIL_NOACTION_REBOOT == dwCode)
802 {
803 LOC_STRING* pLocString = NULL;
804 hr = LocGetString(m_pWixLoc, L"#(loc.ErrorFailNoActionReboot)", &pLocString);
805 if (SUCCEEDED(hr))
806 {
807 StrAllocString(&sczError, pLocString->wzText, 0);
808 }
809 else
810 {
811 StrAllocFormatted(&sczError, L"0x%x", dwCode);
812 }
813 }
814 else
815 {
816 StrAllocFormatted(&sczError, L"0x%x", dwCode);
817 }
818 }
819 hr = S_OK;
820 }
821
822 nResult = ::MessageBoxW(m_hWnd, sczError ? sczError : wzError, m_pTheme->sczCaption, dwUIHint);
823 }
824 }
825
826 SetProgressState(HRESULT_FROM_WIN32(dwCode));
827 }
828 else // just take note of the error code and let things continue.
829 {
830 BalRetryErrorOccurred(wzPackageId, dwCode);
831 }
832
833 ReleaseStr(sczError);
834 *pResult = nResult;
835 return hr;
836 }
837
838
839 virtual STDMETHODIMP OnExecuteMsiMessage(
840 __in_z LPCWSTR wzPackageId,
841 __in INSTALLMESSAGE messageType,
842 __in DWORD dwUIHint,
843 __in_z LPCWSTR wzMessage,
844 __in DWORD cData,
845 __in_ecount_z_opt(cData) LPCWSTR* rgwzData,
846 __in int nRecommendation,
847 __inout int* pResult
848 )
849 {
850#ifdef DEBUG
851 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: OnExecuteMsiMessage() - package: %ls, message: %ls", wzPackageId, wzMessage);
852#endif
853 if (BOOTSTRAPPER_DISPLAY_FULL == m_command.display && (INSTALLMESSAGE_WARNING == messageType || INSTALLMESSAGE_USER == messageType))
854 {
855 if (!m_fShowingInternalUiThisPackage)
856 {
857 int nResult = ::MessageBoxW(m_hWnd, wzMessage, m_pTheme->sczCaption, dwUIHint);
858 return nResult;
859 }
860 }
861
862 if (INSTALLMESSAGE_ACTIONSTART == messageType)
863 {
864 ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_EXECUTE_PROGRESS_ACTIONDATA_TEXT, wzMessage);
865 }
866
867 return __super::OnExecuteMsiMessage(wzPackageId, messageType, dwUIHint, wzMessage, cData, rgwzData, nRecommendation, pResult);
868 }
869
870
871 virtual STDMETHODIMP OnProgress(
872 __in DWORD dwProgressPercentage,
873 __in DWORD dwOverallProgressPercentage,
874 __inout BOOL* pfCancel
875 )
876 {
877 WCHAR wzProgress[5] = { };
878
879#ifdef DEBUG
880 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: OnProgress() - progress: %u%%, overall progress: %u%%", dwProgressPercentage, dwOverallProgressPercentage);
881#endif
882
883 ::StringCchPrintfW(wzProgress, countof(wzProgress), L"%u%%", dwOverallProgressPercentage);
884 ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_OVERALL_PROGRESS_TEXT, wzProgress);
885
886 ThemeSetProgressControl(m_pTheme, WIXSTDBA_CONTROL_OVERALL_PROGRESS_BAR, dwOverallProgressPercentage);
887 SetTaskbarButtonProgress(dwOverallProgressPercentage);
888
889 return __super::OnProgress(dwProgressPercentage, dwOverallProgressPercentage, pfCancel);
890 }
891
892
893 virtual STDMETHODIMP OnExecutePackageBegin(
894 __in_z LPCWSTR wzPackageId,
895 __in BOOL fExecute,
896 __in BOOTSTRAPPER_ACTION_STATE action,
897 __in INSTALLUILEVEL uiLevel,
898 __in BOOL fDisableExternalUiHandler,
899 __inout BOOL* pfCancel
900 )
901 {
902 HRESULT hr = S_OK;
903 LPWSTR sczFormattedString = NULL;
904 BOOL fShowingInternalUiThisPackage = FALSE;
905
906 m_fStartedExecution = TRUE;
907
908 if (wzPackageId && *wzPackageId)
909 {
910 BAL_INFO_PACKAGE* pPackage = NULL;
911 BalInfoFindPackageById(&m_Bundle.packages, wzPackageId, &pPackage);
912
913 LPCWSTR wz = wzPackageId;
914 if (pPackage)
915 {
916 LOC_STRING* pLocString = NULL;
917
918 switch (pPackage->type)
919 {
920 case BAL_INFO_PACKAGE_TYPE_BUNDLE_ADDON:
921 LocGetString(m_pWixLoc, L"#(loc.ExecuteAddonRelatedBundleMessage)", &pLocString);
922 break;
923
924 case BAL_INFO_PACKAGE_TYPE_BUNDLE_PATCH:
925 LocGetString(m_pWixLoc, L"#(loc.ExecutePatchRelatedBundleMessage)", &pLocString);
926 break;
927
928 case BAL_INFO_PACKAGE_TYPE_BUNDLE_UPGRADE:
929 LocGetString(m_pWixLoc, L"#(loc.ExecuteUpgradeRelatedBundleMessage)", &pLocString);
930 break;
931 }
932
933 if (pLocString)
934 {
935 // If the wix developer is showing a hidden variable in the UI, then obviously they don't care about keeping it safe
936 // so don't go down the rabbit hole of making sure that this is securely freed.
937 BalFormatString(pLocString->wzText, &sczFormattedString);
938 }
939
940 wz = sczFormattedString ? sczFormattedString : pPackage->sczDisplayName ? pPackage->sczDisplayName : wzPackageId;
941 }
942
943 fShowingInternalUiThisPackage = INSTALLUILEVEL_NONE != (INSTALLUILEVEL_NONE & uiLevel);
944
945 ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_EXECUTE_PROGRESS_PACKAGE_TEXT, wz);
946 ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_OVERALL_PROGRESS_PACKAGE_TEXT, wz);
947 }
948
949 ::EnterCriticalSection(&m_csShowingInternalUiThisPackage);
950 m_fShowingInternalUiThisPackage = fShowingInternalUiThisPackage;
951 hr = __super::OnExecutePackageBegin(wzPackageId, fExecute, action, uiLevel, fDisableExternalUiHandler, pfCancel);
952 ::LeaveCriticalSection(&m_csShowingInternalUiThisPackage);
953
954 ReleaseStr(sczFormattedString);
955 return hr;
956 }
957
958
959 virtual STDMETHODIMP OnExecuteProgress(
960 __in_z LPCWSTR wzPackageId,
961 __in DWORD dwProgressPercentage,
962 __in DWORD dwOverallProgressPercentage,
963 __inout BOOL* pfCancel
964 )
965 {
966 WCHAR wzProgress[5] = { };
967
968#ifdef DEBUG
969 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: OnExecuteProgress() - package: %ls, progress: %u%%, overall progress: %u%%", wzPackageId, dwProgressPercentage, dwOverallProgressPercentage);
970#endif
971
972 ::StringCchPrintfW(wzProgress, countof(wzProgress), L"%u%%", dwOverallProgressPercentage);
973 ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_EXECUTE_PROGRESS_TEXT, wzProgress);
974
975 ThemeSetProgressControl(m_pTheme, WIXSTDBA_CONTROL_EXECUTE_PROGRESS_BAR, dwOverallProgressPercentage);
976
977 m_dwCalculatedExecuteProgress = dwOverallProgressPercentage * (100 - WIXSTDBA_ACQUIRE_PERCENTAGE) / 100;
978 ThemeSetProgressControl(m_pTheme, WIXSTDBA_CONTROL_OVERALL_CALCULATED_PROGRESS_BAR, m_dwCalculatedCacheProgress + m_dwCalculatedExecuteProgress);
979
980 SetTaskbarButtonProgress(m_dwCalculatedCacheProgress + m_dwCalculatedExecuteProgress);
981
982 return __super::OnExecuteProgress(wzPackageId, dwProgressPercentage, dwOverallProgressPercentage, pfCancel);
983 }
984
985
986 virtual STDMETHODIMP OnExecutePackageComplete(
987 __in_z LPCWSTR wzPackageId,
988 __in HRESULT hrStatus,
989 __in BOOTSTRAPPER_APPLY_RESTART restart,
990 __in BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION recommendation,
991 __inout BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION* pAction
992 )
993 {
994 HRESULT hr = S_OK;
995 SetProgressState(hrStatus);
996
997 hr = __super::OnExecutePackageComplete(wzPackageId, hrStatus, restart, recommendation, pAction);
998
999 WIXSTDBA_PACKAGE_INFO* pPackageInfo = NULL;
1000 BAL_INFO_PACKAGE* pPackage;
1001 HRESULT hrPrereq = GetPackageInfo(wzPackageId, &pPackageInfo, &pPackage);
1002 if (SUCCEEDED(hrPrereq) && pPackageInfo)
1003 {
1004 pPackageInfo->fSuccessfullyInstalled = SUCCEEDED(hrStatus);
1005
1006 // If the prerequisite required a restart (any restart) then do an immediate
1007 // restart to ensure that the bundle will get launched again post reboot.
1008 if (m_fPrereq && pPackage->fPrereqPackage && BOOTSTRAPPER_APPLY_RESTART_NONE != restart)
1009 {
1010 *pAction = BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION_RESTART;
1011 }
1012 }
1013
1014 return hr;
1015 }
1016
1017
1018 virtual STDMETHODIMP OnExecuteComplete(
1019 __in HRESULT hrStatus
1020 )
1021 {
1022 HRESULT hr = S_OK;
1023
1024 ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_EXECUTE_PROGRESS_PACKAGE_TEXT, L"");
1025 ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_EXECUTE_PROGRESS_ACTIONDATA_TEXT, L"");
1026 ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_OVERALL_PROGRESS_PACKAGE_TEXT, L"");
1027 ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_PROGRESS_CANCEL_BUTTON, FALSE); // no more cancel.
1028 m_fShowingInternalUiThisPackage = FALSE;
1029
1030 SetState(WIXSTDBA_STATE_EXECUTED, S_OK); // we always return success here and let OnApplyComplete() deal with the error.
1031 SetProgressState(hrStatus);
1032
1033 return hr;
1034 }
1035
1036
1037 virtual STDMETHODIMP OnCacheAcquireResolving(
1038 __in_z_opt LPCWSTR wzPackageOrContainerId,
1039 __in_z_opt LPCWSTR wzPayloadId,
1040 __in_z LPCWSTR* rgSearchPaths,
1041 __in DWORD /*cSearchPaths*/,
1042 __in BOOL /*fFoundLocal*/,
1043 __in DWORD dwRecommendedSearchPath,
1044 __in_z_opt LPCWSTR /*wzDownloadUrl*/,
1045 __in_z_opt LPCWSTR /*wzPayloadContainerId*/,
1046 __in BOOTSTRAPPER_CACHE_RESOLVE_OPERATION /*recommendation*/,
1047 __inout DWORD* /*pdwChosenSearchPath*/,
1048 __inout BOOTSTRAPPER_CACHE_RESOLVE_OPERATION* pAction,
1049 __inout BOOL* pfCancel
1050 )
1051 {
1052 HRESULT hr = S_OK;
1053
1054 if (BOOTSTRAPPER_CACHE_RESOLVE_NONE == *pAction && BOOTSTRAPPER_DISPLAY_FULL == m_command.display) // prompt to change the source location.
1055 {
1056 OPENFILENAMEW ofn = { };
1057 WCHAR wzFile[MAX_PATH] = { };
1058
1059 ::StringCchCopyW(wzFile, countof(wzFile), rgSearchPaths[dwRecommendedSearchPath]);
1060
1061 ofn.lStructSize = sizeof(ofn);
1062 ofn.hwndOwner = m_hWnd;
1063 ofn.lpstrFile = wzFile;
1064 ofn.nMaxFile = countof(wzFile);
1065 ofn.lpstrFilter = L"All Files\0*.*\0";
1066 ofn.nFilterIndex = 1;
1067 ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
1068 ofn.lpstrTitle = m_pTheme->sczCaption;
1069
1070 if (::GetOpenFileNameW(&ofn))
1071 {
1072 hr = m_pEngine->SetLocalSource(wzPackageOrContainerId, wzPayloadId, ofn.lpstrFile);
1073 *pAction = BOOTSTRAPPER_CACHE_RESOLVE_RETRY;
1074 }
1075 else
1076 {
1077 *pfCancel = TRUE;
1078 }
1079 }
1080 // else there's nothing more we can do in non-interactive mode
1081
1082 *pfCancel |= CheckCanceled();
1083 return hr;
1084 }
1085
1086
1087 virtual STDMETHODIMP OnApplyComplete(
1088 __in HRESULT hrStatus,
1089 __in BOOTSTRAPPER_APPLY_RESTART restart,
1090 __in BOOTSTRAPPER_APPLYCOMPLETE_ACTION recommendation,
1091 __inout BOOTSTRAPPER_APPLYCOMPLETE_ACTION* pAction
1092 )
1093 {
1094 HRESULT hr = S_OK;
1095
1096 __super::OnApplyComplete(hrStatus, restart, recommendation, pAction);
1097
1098 m_restartResult = restart; // remember the restart result so we return the correct error code no matter what the user chooses to do in the UI.
1099
1100 // If a restart was encountered and we are not suppressing restarts, then restart is required.
1101 m_fRestartRequired = (BOOTSTRAPPER_APPLY_RESTART_NONE != restart && BOOTSTRAPPER_RESTART_NEVER < m_command.restart);
1102 BalSetStringVariable(WIXSTDBA_VARIABLE_RESTART_REQUIRED, m_fRestartRequired ? L"1" : NULL, FALSE);
1103
1104 // If a restart is required and we're not displaying a UI or we are not supposed to prompt for restart then allow the restart.
1105 m_fAllowRestart = m_fRestartRequired && (BOOTSTRAPPER_DISPLAY_FULL > m_command.display || BOOTSTRAPPER_RESTART_PROMPT < m_command.restart);
1106
1107 if (m_fPrereq)
1108 {
1109 m_fPrereqInstalled = TRUE;
1110 BOOL fInstalledAPackage = FALSE;
1111
1112 for (DWORD i = 0; i < m_Bundle.packages.cPackages; ++i)
1113 {
1114 BAL_INFO_PACKAGE* pPackage = &m_Bundle.packages.rgPackages[i];
1115 WIXSTDBA_PACKAGE_INFO* pPackageInfo = reinterpret_cast<WIXSTDBA_PACKAGE_INFO*>(pPackage->pvCustomData);
1116 if (pPackage->fPrereqPackage && pPackageInfo && pPackageInfo->fPlannedToBeInstalled && !pPackageInfo->fWasAlreadyInstalled)
1117 {
1118 if (pPackageInfo->fSuccessfullyInstalled)
1119 {
1120 fInstalledAPackage = TRUE;
1121 }
1122 else
1123 {
1124 m_fPrereqInstalled = FALSE;
1125 break;
1126 }
1127 }
1128 }
1129
1130 m_fPrereqInstalled = m_fPrereqInstalled && fInstalledAPackage;
1131 }
1132
1133 // If we are showing UI, wait a beat before moving to the final screen.
1134 if (BOOTSTRAPPER_DISPLAY_NONE < m_command.display)
1135 {
1136 ::Sleep(250);
1137 }
1138
1139 SetState(WIXSTDBA_STATE_APPLIED, hrStatus);
1140 SetTaskbarButtonProgress(100); // show full progress bar, green, yellow, or red
1141
1142 *pAction = BOOTSTRAPPER_APPLYCOMPLETE_ACTION_NONE;
1143
1144 return hr;
1145 }
1146
1147 virtual STDMETHODIMP OnLaunchApprovedExeComplete(
1148 __in HRESULT hrStatus,
1149 __in DWORD /*processId*/
1150 )
1151 {
1152 HRESULT hr = S_OK;
1153
1154 if (HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED) == hrStatus)
1155 {
1156 //try with ShelExec next time
1157 OnClickLaunchButton();
1158 }
1159 else
1160 {
1161 ::PostMessageW(m_hWnd, WM_CLOSE, 0, 0);
1162 }
1163
1164 return hr;
1165 }
1166
1167 virtual STDMETHODIMP_(void) BAProcFallback(
1168 __in BOOTSTRAPPER_APPLICATION_MESSAGE message,
1169 __in const LPVOID pvArgs,
1170 __inout LPVOID pvResults,
1171 __inout HRESULT* phr,
1172 __in_opt LPVOID /*pvContext*/
1173 )
1174 {
1175 if (!m_pfnBAFunctionsProc || FAILED(*phr))
1176 {
1177 return;
1178 }
1179
1180 // Always log before and after so we don't get blamed when BAFunctions changes something.
1181 switch (message)
1182 {
1183 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTBEGIN:
1184 OnDetectBeginFallback(reinterpret_cast<BA_ONDETECTBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONDETECTBEGIN_RESULTS*>(pvResults));
1185 break;
1186 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPLETE:
1187 OnDetectCompleteFallback(reinterpret_cast<BA_ONDETECTCOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONDETECTCOMPLETE_RESULTS*>(pvResults));
1188 break;
1189 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANBEGIN:
1190 OnPlanBeginFallback(reinterpret_cast<BA_ONPLANBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONPLANBEGIN_RESULTS*>(pvResults));
1191 break;
1192 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPLETE:
1193 OnPlanCompleteFallback(reinterpret_cast<BA_ONPLANCOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONPLANCOMPLETE_RESULTS*>(pvResults));
1194 break;
1195 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONSTARTUP: // BAFunctions is loaded during this event on a separate thread so it's not possible to forward it.
1196 break;
1197 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONSHUTDOWN:
1198 OnShutdownFallback(reinterpret_cast<BA_ONSHUTDOWN_ARGS*>(pvArgs), reinterpret_cast<BA_ONSHUTDOWN_RESULTS*>(pvResults));
1199 break;
1200 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMSHUTDOWN:
1201 OnSystemShutdownFallback(reinterpret_cast<BA_ONSYSTEMSHUTDOWN_ARGS*>(pvArgs), reinterpret_cast<BA_ONSYSTEMSHUTDOWN_RESULTS*>(pvResults));
1202 break;
1203 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE:
1204 OnDetectForwardCompatibleBundleFallback(reinterpret_cast<BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_ARGS*>(pvArgs), reinterpret_cast<BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_RESULTS*>(pvResults));
1205 break;
1206 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATEBEGIN:
1207 OnDetectUpdateBeginFallback(reinterpret_cast<BA_ONDETECTUPDATEBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONDETECTUPDATEBEGIN_RESULTS*>(pvResults));
1208 break;
1209 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATE:
1210 OnDetectUpdateFallback(reinterpret_cast<BA_ONDETECTUPDATE_ARGS*>(pvArgs), reinterpret_cast<BA_ONDETECTUPDATE_RESULTS*>(pvResults));
1211 break;
1212 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATECOMPLETE:
1213 OnDetectUpdateCompleteFallback(reinterpret_cast<BA_ONDETECTUPDATECOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONDETECTUPDATECOMPLETE_RESULTS*>(pvResults));
1214 break;
1215 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDBUNDLE:
1216 OnDetectRelatedBundleFallback(reinterpret_cast<BA_ONDETECTRELATEDBUNDLE_ARGS*>(pvArgs), reinterpret_cast<BA_ONDETECTRELATEDBUNDLE_RESULTS*>(pvResults));
1217 break;
1218 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGEBEGIN:
1219 OnDetectPackageBeginFallback(reinterpret_cast<BA_ONDETECTPACKAGEBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONDETECTPACKAGEBEGIN_RESULTS*>(pvResults));
1220 break;
1221 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDMSIPACKAGE:
1222 OnDetectRelatedMsiPackageFallback(reinterpret_cast<BA_ONDETECTRELATEDMSIPACKAGE_ARGS*>(pvArgs), reinterpret_cast<BA_ONDETECTRELATEDMSIPACKAGE_RESULTS*>(pvResults));
1223 break;
1224 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPATCHTARGET:
1225 OnDetectPatchTargetFallback(reinterpret_cast<BA_ONDETECTPATCHTARGET_ARGS*>(pvArgs), reinterpret_cast<BA_ONDETECTPATCHTARGET_RESULTS*>(pvResults));
1226 break;
1227 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTMSIFEATURE:
1228 OnDetectMsiFeatureFallback(reinterpret_cast<BA_ONDETECTMSIFEATURE_ARGS*>(pvArgs), reinterpret_cast<BA_ONDETECTMSIFEATURE_RESULTS*>(pvResults));
1229 break;
1230 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGECOMPLETE:
1231 OnDetectPackageCompleteFallback(reinterpret_cast<BA_ONDETECTPACKAGECOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONDETECTPACKAGECOMPLETE_RESULTS*>(pvResults));
1232 break;
1233 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANRELATEDBUNDLE:
1234 OnPlanRelatedBundleFallback(reinterpret_cast<BA_ONPLANRELATEDBUNDLE_ARGS*>(pvArgs), reinterpret_cast<BA_ONPLANRELATEDBUNDLE_RESULTS*>(pvResults));
1235 break;
1236 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGEBEGIN:
1237 OnPlanPackageBeginFallback(reinterpret_cast<BA_ONPLANPACKAGEBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONPLANPACKAGEBEGIN_RESULTS*>(pvResults));
1238 break;
1239 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPATCHTARGET:
1240 OnPlanPatchTargetFallback(reinterpret_cast<BA_ONPLANPATCHTARGET_ARGS*>(pvArgs), reinterpret_cast<BA_ONPLANPATCHTARGET_RESULTS*>(pvResults));
1241 break;
1242 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANMSIFEATURE:
1243 OnPlanMsiFeatureFallback(reinterpret_cast<BA_ONPLANMSIFEATURE_ARGS*>(pvArgs), reinterpret_cast<BA_ONPLANMSIFEATURE_RESULTS*>(pvResults));
1244 break;
1245 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGECOMPLETE:
1246 OnPlanPackageCompleteFallback(reinterpret_cast<BA_ONPLANPACKAGECOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONPLANPACKAGECOMPLETE_RESULTS*>(pvResults));
1247 break;
1248 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONAPPLYBEGIN:
1249 OnApplyBeginFallback(reinterpret_cast<BA_ONAPPLYBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONAPPLYBEGIN_RESULTS*>(pvResults));
1250 break;
1251 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONELEVATEBEGIN:
1252 OnElevateBeginFallback(reinterpret_cast<BA_ONELEVATEBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONELEVATEBEGIN_RESULTS*>(pvResults));
1253 break;
1254 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONELEVATECOMPLETE:
1255 OnElevateCompleteFallback(reinterpret_cast<BA_ONELEVATECOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONELEVATECOMPLETE_RESULTS*>(pvResults));
1256 break;
1257 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPROGRESS:
1258 OnProgressFallback(reinterpret_cast<BA_ONPROGRESS_ARGS*>(pvArgs), reinterpret_cast<BA_ONPROGRESS_RESULTS*>(pvResults));
1259 break;
1260 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONERROR:
1261 OnErrorFallback(reinterpret_cast<BA_ONERROR_ARGS*>(pvArgs), reinterpret_cast<BA_ONERROR_RESULTS*>(pvResults));
1262 break;
1263 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONREGISTERBEGIN:
1264 OnRegisterBeginFallback(reinterpret_cast<BA_ONREGISTERBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONREGISTERBEGIN_RESULTS*>(pvResults));
1265 break;
1266 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONREGISTERCOMPLETE:
1267 OnRegisterCompleteFallback(reinterpret_cast<BA_ONREGISTERCOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONREGISTERCOMPLETE_RESULTS*>(pvResults));
1268 break;
1269 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEBEGIN:
1270 OnCacheBeginFallback(reinterpret_cast<BA_ONCACHEBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEBEGIN_RESULTS*>(pvResults));
1271 break;
1272 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPACKAGEBEGIN:
1273 OnCachePackageBeginFallback(reinterpret_cast<BA_ONCACHEPACKAGEBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEPACKAGEBEGIN_RESULTS*>(pvResults));
1274 break;
1275 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREBEGIN:
1276 OnCacheAcquireBeginFallback(reinterpret_cast<BA_ONCACHEACQUIREBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIREBEGIN_RESULTS*>(pvResults));
1277 break;
1278 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIREPROGRESS:
1279 OnCacheAcquireProgressFallback(reinterpret_cast<BA_ONCACHEACQUIREPROGRESS_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIREPROGRESS_RESULTS*>(pvResults));
1280 break;
1281 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRERESOLVING:
1282 OnCacheAcquireResolvingFallback(reinterpret_cast<BA_ONCACHEACQUIRERESOLVING_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIRERESOLVING_RESULTS*>(pvResults));
1283 break;
1284 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEACQUIRECOMPLETE:
1285 OnCacheAcquireCompleteFallback(reinterpret_cast<BA_ONCACHEACQUIRECOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEACQUIRECOMPLETE_RESULTS*>(pvResults));
1286 break;
1287 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYBEGIN:
1288 OnCacheVerifyBeginFallback(reinterpret_cast<BA_ONCACHEVERIFYBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEVERIFYBEGIN_RESULTS*>(pvResults));
1289 break;
1290 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYCOMPLETE:
1291 OnCacheVerifyCompleteFallback(reinterpret_cast<BA_ONCACHEVERIFYCOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEVERIFYCOMPLETE_RESULTS*>(pvResults));
1292 break;
1293 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPACKAGECOMPLETE:
1294 OnCachePackageCompleteFallback(reinterpret_cast<BA_ONCACHEPACKAGECOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEPACKAGECOMPLETE_RESULTS*>(pvResults));
1295 break;
1296 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHECOMPLETE:
1297 OnCacheCompleteFallback(reinterpret_cast<BA_ONCACHECOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHECOMPLETE_RESULTS*>(pvResults));
1298 break;
1299 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEBEGIN:
1300 OnExecuteBeginFallback(reinterpret_cast<BA_ONEXECUTEBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONEXECUTEBEGIN_RESULTS*>(pvResults));
1301 break;
1302 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPACKAGEBEGIN:
1303 OnExecutePackageBeginFallback(reinterpret_cast<BA_ONEXECUTEPACKAGEBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONEXECUTEPACKAGEBEGIN_RESULTS*>(pvResults));
1304 break;
1305 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPATCHTARGET:
1306 OnExecutePatchTargetFallback(reinterpret_cast<BA_ONEXECUTEPATCHTARGET_ARGS*>(pvArgs), reinterpret_cast<BA_ONEXECUTEPATCHTARGET_RESULTS*>(pvResults));
1307 break;
1308 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPROGRESS:
1309 OnExecuteProgressFallback(reinterpret_cast<BA_ONEXECUTEPROGRESS_ARGS*>(pvArgs), reinterpret_cast<BA_ONEXECUTEPROGRESS_RESULTS*>(pvResults));
1310 break;
1311 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEMSIMESSAGE:
1312 OnExecuteMsiMessageFallback(reinterpret_cast<BA_ONEXECUTEMSIMESSAGE_ARGS*>(pvArgs), reinterpret_cast<BA_ONEXECUTEMSIMESSAGE_RESULTS*>(pvResults));
1313 break;
1314 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEFILESINUSE:
1315 OnExecuteFilesInUseFallback(reinterpret_cast<BA_ONEXECUTEFILESINUSE_ARGS*>(pvArgs), reinterpret_cast<BA_ONEXECUTEFILESINUSE_RESULTS*>(pvResults));
1316 break;
1317 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTEPACKAGECOMPLETE:
1318 OnExecutePackageCompleteFallback(reinterpret_cast<BA_ONEXECUTEPACKAGECOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONEXECUTEPACKAGECOMPLETE_RESULTS*>(pvResults));
1319 break;
1320 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONEXECUTECOMPLETE:
1321 OnExecuteCompleteFallback(reinterpret_cast<BA_ONEXECUTECOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONEXECUTECOMPLETE_RESULTS*>(pvResults));
1322 break;
1323 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONUNREGISTERBEGIN:
1324 OnUnregisterBeginFallback(reinterpret_cast<BA_ONUNREGISTERBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONUNREGISTERBEGIN_RESULTS*>(pvResults));
1325 break;
1326 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONUNREGISTERCOMPLETE:
1327 OnUnregisterCompleteFallback(reinterpret_cast<BA_ONUNREGISTERCOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONUNREGISTERCOMPLETE_RESULTS*>(pvResults));
1328 break;
1329 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONAPPLYCOMPLETE:
1330 OnApplyCompleteFallback(reinterpret_cast<BA_ONAPPLYCOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONAPPLYCOMPLETE_RESULTS*>(pvResults));
1331 break;
1332 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONLAUNCHAPPROVEDEXEBEGIN:
1333 OnLaunchApprovedExeBeginFallback(reinterpret_cast<BA_ONLAUNCHAPPROVEDEXEBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONLAUNCHAPPROVEDEXEBEGIN_RESULTS*>(pvResults));
1334 break;
1335 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONLAUNCHAPPROVEDEXECOMPLETE:
1336 OnLaunchApprovedExeCompleteFallback(reinterpret_cast<BA_ONLAUNCHAPPROVEDEXECOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONLAUNCHAPPROVEDEXECOMPLETE_RESULTS*>(pvResults));
1337 break;
1338 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANMSIPACKAGE:
1339 OnPlanMsiPackageFallback(reinterpret_cast<BA_ONPLANMSIPACKAGE_ARGS*>(pvArgs), reinterpret_cast<BA_ONPLANMSIPACKAGE_RESULTS*>(pvResults));
1340 break;
1341 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONBEGINMSITRANSACTIONBEGIN:
1342 OnBeginMsiTransactionBeginFallback(reinterpret_cast<BA_ONBEGINMSITRANSACTIONBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONBEGINMSITRANSACTIONBEGIN_RESULTS*>(pvResults));
1343 break;
1344 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONBEGINMSITRANSACTIONCOMPLETE:
1345 OnBeginMsiTransactionCompleteFallback(reinterpret_cast<BA_ONBEGINMSITRANSACTIONCOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONBEGINMSITRANSACTIONCOMPLETE_RESULTS*>(pvResults));
1346 break;
1347 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONBEGIN:
1348 OnCommitMsiTransactionBeginFallback(reinterpret_cast<BA_ONCOMMITMSITRANSACTIONBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONCOMMITMSITRANSACTIONBEGIN_RESULTS*>(pvResults));
1349 break;
1350 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCOMMITMSITRANSACTIONCOMPLETE:
1351 OnCommitMsiTransactionCompleteFallback(reinterpret_cast<BA_ONCOMMITMSITRANSACTIONCOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONCOMMITMSITRANSACTIONCOMPLETE_RESULTS*>(pvResults));
1352 break;
1353 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONBEGIN:
1354 OnRollbackMsiTransactionBeginFallback(reinterpret_cast<BA_ONROLLBACKMSITRANSACTIONBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONROLLBACKMSITRANSACTIONBEGIN_RESULTS*>(pvResults));
1355 break;
1356 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONROLLBACKMSITRANSACTIONCOMPLETE:
1357 OnRollbackMsiTransactionCompleteFallback(reinterpret_cast<BA_ONROLLBACKMSITRANSACTIONCOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONROLLBACKMSITRANSACTIONCOMPLETE_RESULTS*>(pvResults));
1358 break;
1359 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPAUSEAUTOMATICUPDATESBEGIN:
1360 OnPauseAutomaticUpdatesBeginFallback(reinterpret_cast<BA_ONPAUSEAUTOMATICUPDATESBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONPAUSEAUTOMATICUPDATESBEGIN_RESULTS*>(pvResults));
1361 break;
1362 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPAUSEAUTOMATICUPDATESCOMPLETE:
1363 OnPauseAutomaticUpdatesCompleteFallback(reinterpret_cast<BA_ONPAUSEAUTOMATICUPDATESCOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONPAUSEAUTOMATICUPDATESCOMPLETE_RESULTS*>(pvResults));
1364 break;
1365 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMRESTOREPOINTBEGIN:
1366 OnSystemRestorePointBeginFallback(reinterpret_cast<BA_ONSYSTEMRESTOREPOINTBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONSYSTEMRESTOREPOINTBEGIN_RESULTS*>(pvResults));
1367 break;
1368 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONSYSTEMRESTOREPOINTCOMPLETE:
1369 OnSystemRestorePointCompleteFallback(reinterpret_cast<BA_ONSYSTEMRESTOREPOINTCOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONSYSTEMRESTOREPOINTCOMPLETE_RESULTS*>(pvResults));
1370 break;
1371 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANNEDPACKAGE:
1372 OnPlannedPackageFallback(reinterpret_cast<BA_ONPLANNEDPACKAGE_ARGS*>(pvArgs), reinterpret_cast<BA_ONPLANNEDPACKAGE_RESULTS*>(pvResults));
1373 break;
1374 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEVERIFYPROGRESS:
1375 OnCacheVerifyProgressFallback(reinterpret_cast<BA_ONCACHEVERIFYPROGRESS_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEVERIFYPROGRESS_RESULTS*>(pvResults));
1376 break;
1377 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYBEGIN:
1378 OnCacheContainerOrPayloadVerifyBeginFallback(reinterpret_cast<BA_ONCACHECONTAINERORPAYLOADVERIFYBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHECONTAINERORPAYLOADVERIFYBEGIN_RESULTS*>(pvResults));
1379 break;
1380 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE:
1381 OnCacheContainerOrPayloadVerifyCompleteFallback(reinterpret_cast<BA_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE_RESULTS*>(pvResults));
1382 break;
1383 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS:
1384 OnCacheContainerOrPayloadVerifyProgressFallback(reinterpret_cast<BA_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS_RESULTS*>(pvResults));
1385 break;
1386 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTBEGIN:
1387 OnCachePayloadExtractBeginFallback(reinterpret_cast<BA_ONCACHEPAYLOADEXTRACTBEGIN_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEPAYLOADEXTRACTBEGIN_RESULTS*>(pvResults));
1388 break;
1389 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE:
1390 OnCachePayloadExtractCompleteFallback(reinterpret_cast<BA_ONCACHEPAYLOADEXTRACTCOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEPAYLOADEXTRACTCOMPLETE_RESULTS*>(pvResults));
1391 break;
1392 case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS:
1393 OnCachePayloadExtractProgressFallback(reinterpret_cast<BA_ONCACHEPAYLOADEXTRACTPROGRESS_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEPAYLOADEXTRACTPROGRESS_RESULTS*>(pvResults));
1394 break;
1395 default:
1396#ifdef DEBUG
1397 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: Forwarding unknown BA message: %d", message);
1398#endif
1399 m_pfnBAFunctionsProc((BA_FUNCTIONS_MESSAGE)message, pvArgs, pvResults, m_pvBAFunctionsProcContext);
1400 break;
1401 }
1402 }
1403
1404
1405private: // privates
1406 void OnDetectBeginFallback(
1407 __in BA_ONDETECTBEGIN_ARGS* pArgs,
1408 __inout BA_ONDETECTBEGIN_RESULTS* pResults
1409 )
1410 {
1411 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONDETECTBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1412 }
1413
1414 void OnDetectCompleteFallback(
1415 __in BA_ONDETECTCOMPLETE_ARGS* pArgs,
1416 __inout BA_ONDETECTCOMPLETE_RESULTS* pResults
1417 )
1418 {
1419 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONDETECTCOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1420 }
1421
1422 void OnPlanBeginFallback(
1423 __in BA_ONPLANBEGIN_ARGS* pArgs,
1424 __inout BA_ONPLANBEGIN_RESULTS* pResults
1425 )
1426 {
1427 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONPLANBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1428 }
1429
1430 void OnPlanCompleteFallback(
1431 __in BA_ONPLANCOMPLETE_ARGS* pArgs,
1432 __inout BA_ONPLANCOMPLETE_RESULTS* pResults
1433 )
1434 {
1435 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONPLANCOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1436 }
1437
1438 void OnShutdownFallback(
1439 __in BA_ONSHUTDOWN_ARGS* pArgs,
1440 __inout BA_ONSHUTDOWN_RESULTS* pResults
1441 )
1442 {
1443 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONSHUTDOWN, pArgs, pResults, m_pvBAFunctionsProcContext);
1444 }
1445
1446 void OnSystemShutdownFallback(
1447 __in BA_ONSYSTEMSHUTDOWN_ARGS* pArgs,
1448 __inout BA_ONSYSTEMSHUTDOWN_RESULTS* pResults
1449 )
1450 {
1451 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONSYSTEMSHUTDOWN, pArgs, pResults, m_pvBAFunctionsProcContext);
1452 }
1453
1454 void OnDetectForwardCompatibleBundleFallback(
1455 __in BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_ARGS* pArgs,
1456 __inout BA_ONDETECTFORWARDCOMPATIBLEBUNDLE_RESULTS* pResults
1457 )
1458 {
1459 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONDETECTFORWARDCOMPATIBLEBUNDLE, pArgs, pResults, m_pvBAFunctionsProcContext);
1460 }
1461
1462 void OnDetectUpdateBeginFallback(
1463 __in BA_ONDETECTUPDATEBEGIN_ARGS* pArgs,
1464 __inout BA_ONDETECTUPDATEBEGIN_RESULTS* pResults
1465 )
1466 {
1467 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONDETECTUPDATEBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1468 }
1469
1470 void OnDetectUpdateFallback(
1471 __in BA_ONDETECTUPDATE_ARGS* pArgs,
1472 __inout BA_ONDETECTUPDATE_RESULTS* pResults
1473 )
1474 {
1475 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONDETECTUPDATE, pArgs, pResults, m_pvBAFunctionsProcContext);
1476 }
1477
1478 void OnDetectUpdateCompleteFallback(
1479 __in BA_ONDETECTUPDATECOMPLETE_ARGS* pArgs,
1480 __inout BA_ONDETECTUPDATECOMPLETE_RESULTS* pResults
1481 )
1482 {
1483 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONDETECTUPDATECOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1484 }
1485
1486 void OnDetectRelatedBundleFallback(
1487 __in BA_ONDETECTRELATEDBUNDLE_ARGS* pArgs,
1488 __inout BA_ONDETECTRELATEDBUNDLE_RESULTS* pResults
1489 )
1490 {
1491 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONDETECTRELATEDBUNDLE, pArgs, pResults, m_pvBAFunctionsProcContext);
1492 }
1493
1494 void OnDetectPackageBeginFallback(
1495 __in BA_ONDETECTPACKAGEBEGIN_ARGS* pArgs,
1496 __inout BA_ONDETECTPACKAGEBEGIN_RESULTS* pResults
1497 )
1498 {
1499 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONDETECTPACKAGEBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1500 }
1501
1502 void OnDetectRelatedMsiPackageFallback(
1503 __in BA_ONDETECTRELATEDMSIPACKAGE_ARGS* pArgs,
1504 __inout BA_ONDETECTRELATEDMSIPACKAGE_RESULTS* pResults
1505 )
1506 {
1507 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONDETECTRELATEDMSIPACKAGE, pArgs, pResults, m_pvBAFunctionsProcContext);
1508 }
1509
1510 void OnDetectPatchTargetFallback(
1511 __in BA_ONDETECTPATCHTARGET_ARGS* pArgs,
1512 __inout BA_ONDETECTPATCHTARGET_RESULTS* pResults
1513 )
1514 {
1515 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONDETECTPATCHTARGET, pArgs, pResults, m_pvBAFunctionsProcContext);
1516 }
1517
1518 void OnDetectMsiFeatureFallback(
1519 __in BA_ONDETECTMSIFEATURE_ARGS* pArgs,
1520 __inout BA_ONDETECTMSIFEATURE_RESULTS* pResults
1521 )
1522 {
1523 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONDETECTMSIFEATURE, pArgs, pResults, m_pvBAFunctionsProcContext);
1524 }
1525
1526 void OnDetectPackageCompleteFallback(
1527 __in BA_ONDETECTPACKAGECOMPLETE_ARGS* pArgs,
1528 __inout BA_ONDETECTPACKAGECOMPLETE_RESULTS* pResults
1529 )
1530 {
1531 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONDETECTPACKAGECOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1532 }
1533
1534 void OnPlanRelatedBundleFallback(
1535 __in BA_ONPLANRELATEDBUNDLE_ARGS* pArgs,
1536 __inout BA_ONPLANRELATEDBUNDLE_RESULTS* pResults
1537 )
1538 {
1539 BOOTSTRAPPER_REQUEST_STATE requestedState = pResults->requestedState;
1540 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONPLANRELATEDBUNDLE, pArgs, pResults, m_pvBAFunctionsProcContext);
1541 BalLogId(BOOTSTRAPPER_LOG_LEVEL_STANDARD, MSG_WIXSTDBA_PLANNED_RELATED_BUNDLE, m_hModule, pArgs->wzBundleId, LoggingRequestStateToString(requestedState), LoggingRequestStateToString(pResults->requestedState));
1542 }
1543
1544 void OnPlanPackageBeginFallback(
1545 __in BA_ONPLANPACKAGEBEGIN_ARGS* pArgs,
1546 __inout BA_ONPLANPACKAGEBEGIN_RESULTS* pResults
1547 )
1548 {
1549 BOOTSTRAPPER_REQUEST_STATE requestedState = pResults->requestedState;
1550 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONPLANPACKAGEBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1551 BalLogId(BOOTSTRAPPER_LOG_LEVEL_STANDARD, MSG_WIXSTDBA_PLANNED_PACKAGE, m_hModule, pArgs->wzPackageId, LoggingRequestStateToString(requestedState), LoggingRequestStateToString(pResults->requestedState));
1552 }
1553
1554 void OnPlanPatchTargetFallback(
1555 __in BA_ONPLANPATCHTARGET_ARGS* pArgs,
1556 __inout BA_ONPLANPATCHTARGET_RESULTS* pResults
1557 )
1558 {
1559 BOOTSTRAPPER_REQUEST_STATE requestedState = pResults->requestedState;
1560 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONPLANPATCHTARGET, pArgs, pResults, m_pvBAFunctionsProcContext);
1561 BalLogId(BOOTSTRAPPER_LOG_LEVEL_STANDARD, MSG_WIXSTDBA_PLANNED_TARGET_MSI_PACKAGE, m_hModule, pArgs->wzPackageId, pArgs->wzProductCode, LoggingRequestStateToString(requestedState), LoggingRequestStateToString(pResults->requestedState));
1562 }
1563
1564 void OnPlanMsiFeatureFallback(
1565 __in BA_ONPLANMSIFEATURE_ARGS* pArgs,
1566 __inout BA_ONPLANMSIFEATURE_RESULTS* pResults
1567 )
1568 {
1569 BOOTSTRAPPER_FEATURE_STATE requestedState = pResults->requestedState;
1570 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONPLANMSIFEATURE, pArgs, pResults, m_pvBAFunctionsProcContext);
1571 BalLogId(BOOTSTRAPPER_LOG_LEVEL_STANDARD, MSG_WIXSTDBA_PLANNED_MSI_FEATURE, m_hModule, pArgs->wzPackageId, pArgs->wzFeatureId, LoggingMsiFeatureStateToString(requestedState), LoggingMsiFeatureStateToString(pResults->requestedState));
1572 }
1573
1574 void OnPlanPackageCompleteFallback(
1575 __in BA_ONPLANPACKAGECOMPLETE_ARGS* pArgs,
1576 __inout BA_ONPLANPACKAGECOMPLETE_RESULTS* pResults
1577 )
1578 {
1579 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONPLANPACKAGECOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1580 }
1581
1582 void OnPlannedPackageFallback(
1583 __in BA_ONPLANNEDPACKAGE_ARGS* pArgs,
1584 __inout BA_ONPLANNEDPACKAGE_RESULTS* pResults
1585 )
1586 {
1587 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONPLANNEDPACKAGE, pArgs, pResults, m_pvBAFunctionsProcContext);
1588 }
1589
1590 void OnApplyBeginFallback(
1591 __in BA_ONAPPLYBEGIN_ARGS* pArgs,
1592 __inout BA_ONAPPLYBEGIN_RESULTS* pResults
1593 )
1594 {
1595 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONAPPLYBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1596 }
1597
1598 void OnElevateBeginFallback(
1599 __in BA_ONELEVATEBEGIN_ARGS* pArgs,
1600 __inout BA_ONELEVATEBEGIN_RESULTS* pResults
1601 )
1602 {
1603 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONELEVATEBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1604 }
1605
1606 void OnElevateCompleteFallback(
1607 __in BA_ONELEVATECOMPLETE_ARGS* pArgs,
1608 __inout BA_ONELEVATECOMPLETE_RESULTS* pResults
1609 )
1610 {
1611 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONELEVATECOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1612 }
1613
1614 void OnProgressFallback(
1615 __in BA_ONPROGRESS_ARGS* pArgs,
1616 __inout BA_ONPROGRESS_RESULTS* pResults
1617 )
1618 {
1619 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONPROGRESS, pArgs, pResults, m_pvBAFunctionsProcContext);
1620 }
1621
1622 void OnErrorFallback(
1623 __in BA_ONERROR_ARGS* pArgs,
1624 __inout BA_ONERROR_RESULTS* pResults
1625 )
1626 {
1627 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONERROR, pArgs, pResults, m_pvBAFunctionsProcContext);
1628 }
1629
1630 void OnRegisterBeginFallback(
1631 __in BA_ONREGISTERBEGIN_ARGS* pArgs,
1632 __inout BA_ONREGISTERBEGIN_RESULTS* pResults
1633 )
1634 {
1635 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONREGISTERBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1636 }
1637
1638 void OnRegisterCompleteFallback(
1639 __in BA_ONREGISTERCOMPLETE_ARGS* pArgs,
1640 __inout BA_ONREGISTERCOMPLETE_RESULTS* pResults
1641 )
1642 {
1643 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONREGISTERCOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1644 }
1645
1646 void OnCacheBeginFallback(
1647 __in BA_ONCACHEBEGIN_ARGS* pArgs,
1648 __inout BA_ONCACHEBEGIN_RESULTS* pResults
1649 )
1650 {
1651 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1652 }
1653
1654 void OnCachePackageBeginFallback(
1655 __in BA_ONCACHEPACKAGEBEGIN_ARGS* pArgs,
1656 __inout BA_ONCACHEPACKAGEBEGIN_RESULTS* pResults
1657 )
1658 {
1659 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEPACKAGEBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1660 }
1661
1662 void OnCacheAcquireBeginFallback(
1663 __in BA_ONCACHEACQUIREBEGIN_ARGS* pArgs,
1664 __inout BA_ONCACHEACQUIREBEGIN_RESULTS* pResults
1665 )
1666 {
1667 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1668 }
1669
1670 void OnCacheAcquireProgressFallback(
1671 __in BA_ONCACHEACQUIREPROGRESS_ARGS* pArgs,
1672 __inout BA_ONCACHEACQUIREPROGRESS_RESULTS* pResults
1673 )
1674 {
1675 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEACQUIREPROGRESS, pArgs, pResults, m_pvBAFunctionsProcContext);
1676 }
1677
1678 void OnCacheAcquireResolvingFallback(
1679 __in BA_ONCACHEACQUIRERESOLVING_ARGS* pArgs,
1680 __inout BA_ONCACHEACQUIRERESOLVING_RESULTS* pResults
1681 )
1682 {
1683 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRERESOLVING, pArgs, pResults, m_pvBAFunctionsProcContext);
1684 }
1685
1686 void OnCacheAcquireCompleteFallback(
1687 __in BA_ONCACHEACQUIRECOMPLETE_ARGS* pArgs,
1688 __inout BA_ONCACHEACQUIRECOMPLETE_RESULTS* pResults
1689 )
1690 {
1691 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEACQUIRECOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1692 }
1693
1694 void OnCacheVerifyBeginFallback(
1695 __in BA_ONCACHEVERIFYBEGIN_ARGS* pArgs,
1696 __inout BA_ONCACHEVERIFYBEGIN_RESULTS* pResults
1697 )
1698 {
1699 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1700 }
1701
1702 void OnCacheVerifyCompleteFallback(
1703 __in BA_ONCACHEVERIFYCOMPLETE_ARGS* pArgs,
1704 __inout BA_ONCACHEVERIFYCOMPLETE_RESULTS* pResults
1705 )
1706 {
1707 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYCOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1708 }
1709
1710 void OnCachePackageCompleteFallback(
1711 __in BA_ONCACHEPACKAGECOMPLETE_ARGS* pArgs,
1712 __inout BA_ONCACHEPACKAGECOMPLETE_RESULTS* pResults
1713 )
1714 {
1715 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEPACKAGECOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1716 }
1717
1718 void OnCacheCompleteFallback(
1719 __in BA_ONCACHECOMPLETE_ARGS* pArgs,
1720 __inout BA_ONCACHECOMPLETE_RESULTS* pResults
1721 )
1722 {
1723 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHECOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1724 }
1725
1726 void OnExecuteBeginFallback(
1727 __in BA_ONEXECUTEBEGIN_ARGS* pArgs,
1728 __inout BA_ONEXECUTEBEGIN_RESULTS* pResults
1729 )
1730 {
1731 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONEXECUTEBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1732 }
1733
1734 void OnExecutePackageBeginFallback(
1735 __in BA_ONEXECUTEPACKAGEBEGIN_ARGS* pArgs,
1736 __inout BA_ONEXECUTEPACKAGEBEGIN_RESULTS* pResults
1737 )
1738 {
1739 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONEXECUTEPACKAGEBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1740 }
1741
1742 void OnExecutePatchTargetFallback(
1743 __in BA_ONEXECUTEPATCHTARGET_ARGS* pArgs,
1744 __inout BA_ONEXECUTEPATCHTARGET_RESULTS* pResults
1745 )
1746 {
1747 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONEXECUTEPATCHTARGET, pArgs, pResults, m_pvBAFunctionsProcContext);
1748 }
1749
1750 void OnExecuteProgressFallback(
1751 __in BA_ONEXECUTEPROGRESS_ARGS* pArgs,
1752 __inout BA_ONEXECUTEPROGRESS_RESULTS* pResults
1753 )
1754 {
1755 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONEXECUTEPROGRESS, pArgs, pResults, m_pvBAFunctionsProcContext);
1756 }
1757
1758 void OnExecuteMsiMessageFallback(
1759 __in BA_ONEXECUTEMSIMESSAGE_ARGS* pArgs,
1760 __inout BA_ONEXECUTEMSIMESSAGE_RESULTS* pResults
1761 )
1762 {
1763 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONEXECUTEMSIMESSAGE, pArgs, pResults, m_pvBAFunctionsProcContext);
1764 }
1765
1766 void OnExecuteFilesInUseFallback(
1767 __in BA_ONEXECUTEFILESINUSE_ARGS* pArgs,
1768 __inout BA_ONEXECUTEFILESINUSE_RESULTS* pResults
1769 )
1770 {
1771 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONEXECUTEFILESINUSE, pArgs, pResults, m_pvBAFunctionsProcContext);
1772 }
1773
1774 void OnExecutePackageCompleteFallback(
1775 __in BA_ONEXECUTEPACKAGECOMPLETE_ARGS* pArgs,
1776 __inout BA_ONEXECUTEPACKAGECOMPLETE_RESULTS* pResults
1777 )
1778 {
1779 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONEXECUTEPACKAGECOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1780 }
1781
1782 void OnExecuteCompleteFallback(
1783 __in BA_ONEXECUTECOMPLETE_ARGS* pArgs,
1784 __inout BA_ONEXECUTECOMPLETE_RESULTS* pResults
1785 )
1786 {
1787 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONEXECUTECOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1788 }
1789
1790 void OnUnregisterBeginFallback(
1791 __in BA_ONUNREGISTERBEGIN_ARGS* pArgs,
1792 __inout BA_ONUNREGISTERBEGIN_RESULTS* pResults
1793 )
1794 {
1795 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONUNREGISTERBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1796 }
1797
1798 void OnUnregisterCompleteFallback(
1799 __in BA_ONUNREGISTERCOMPLETE_ARGS* pArgs,
1800 __inout BA_ONUNREGISTERCOMPLETE_RESULTS* pResults
1801 )
1802 {
1803 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONUNREGISTERCOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1804 }
1805
1806 void OnApplyCompleteFallback(
1807 __in BA_ONAPPLYCOMPLETE_ARGS* pArgs,
1808 __inout BA_ONAPPLYCOMPLETE_RESULTS* pResults
1809 )
1810 {
1811 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONAPPLYCOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1812 }
1813
1814 void OnLaunchApprovedExeBeginFallback(
1815 __in BA_ONLAUNCHAPPROVEDEXEBEGIN_ARGS* pArgs,
1816 __inout BA_ONLAUNCHAPPROVEDEXEBEGIN_RESULTS* pResults
1817 )
1818 {
1819 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONLAUNCHAPPROVEDEXEBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1820 }
1821
1822 void OnLaunchApprovedExeCompleteFallback(
1823 __in BA_ONLAUNCHAPPROVEDEXECOMPLETE_ARGS* pArgs,
1824 __inout BA_ONLAUNCHAPPROVEDEXECOMPLETE_RESULTS* pResults
1825 )
1826 {
1827 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONLAUNCHAPPROVEDEXECOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1828 }
1829
1830 void OnPlanMsiPackageFallback(
1831 __in BA_ONPLANMSIPACKAGE_ARGS* pArgs,
1832 __inout BA_ONPLANMSIPACKAGE_RESULTS* pResults
1833 )
1834 {
1835 BURN_MSI_PROPERTY actionMsiProperty = pResults->actionMsiProperty;
1836 INSTALLUILEVEL uiLevel = pResults->uiLevel;
1837 BOOL fDisableExternalUiHandler = pResults->fDisableExternalUiHandler;
1838 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONPLANMSIPACKAGE, pArgs, pResults, m_pvBAFunctionsProcContext);
1839 BalLogId(BOOTSTRAPPER_LOG_LEVEL_STANDARD, MSG_WIXSTDBA_PLANNED_MSI_PACKAGE, m_hModule, pArgs->wzPackageId, actionMsiProperty, uiLevel, fDisableExternalUiHandler ? "yes" : "no", pResults->actionMsiProperty, pResults->uiLevel, pResults->fDisableExternalUiHandler ? "yes" : "no");
1840 }
1841
1842 void OnBeginMsiTransactionBeginFallback(
1843 __in BA_ONBEGINMSITRANSACTIONBEGIN_ARGS* pArgs,
1844 __inout BA_ONBEGINMSITRANSACTIONBEGIN_RESULTS* pResults
1845 )
1846 {
1847 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONBEGINMSITRANSACTIONBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1848 }
1849
1850 void OnBeginMsiTransactionCompleteFallback(
1851 __in BA_ONBEGINMSITRANSACTIONCOMPLETE_ARGS* pArgs,
1852 __inout BA_ONBEGINMSITRANSACTIONCOMPLETE_RESULTS* pResults
1853 )
1854 {
1855 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONBEGINMSITRANSACTIONCOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1856 }
1857
1858 void OnCommitMsiTransactionBeginFallback(
1859 __in BA_ONCOMMITMSITRANSACTIONBEGIN_ARGS* pArgs,
1860 __inout BA_ONCOMMITMSITRANSACTIONBEGIN_RESULTS* pResults
1861 )
1862 {
1863 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCOMMITMSITRANSACTIONBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1864 }
1865
1866 void OnCommitMsiTransactionCompleteFallback(
1867 __in BA_ONCOMMITMSITRANSACTIONCOMPLETE_ARGS* pArgs,
1868 __inout BA_ONCOMMITMSITRANSACTIONCOMPLETE_RESULTS* pResults
1869 )
1870 {
1871 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCOMMITMSITRANSACTIONCOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1872 }
1873
1874 void OnRollbackMsiTransactionBeginFallback(
1875 __in BA_ONROLLBACKMSITRANSACTIONBEGIN_ARGS* pArgs,
1876 __inout BA_ONROLLBACKMSITRANSACTIONBEGIN_RESULTS* pResults
1877 )
1878 {
1879 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONROLLBACKMSITRANSACTIONBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1880 }
1881
1882 void OnRollbackMsiTransactionCompleteFallback(
1883 __in BA_ONROLLBACKMSITRANSACTIONCOMPLETE_ARGS* pArgs,
1884 __inout BA_ONROLLBACKMSITRANSACTIONCOMPLETE_RESULTS* pResults
1885 )
1886 {
1887 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONROLLBACKMSITRANSACTIONCOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1888 }
1889
1890 void OnPauseAutomaticUpdatesBeginFallback(
1891 __in BA_ONPAUSEAUTOMATICUPDATESBEGIN_ARGS* pArgs,
1892 __inout BA_ONPAUSEAUTOMATICUPDATESBEGIN_RESULTS* pResults
1893 )
1894 {
1895 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONPAUSEAUTOMATICUPDATESBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1896 }
1897
1898 void OnPauseAutomaticUpdatesCompleteFallback(
1899 __in BA_ONPAUSEAUTOMATICUPDATESCOMPLETE_ARGS* pArgs,
1900 __inout BA_ONPAUSEAUTOMATICUPDATESCOMPLETE_RESULTS* pResults
1901 )
1902 {
1903 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONPAUSEAUTOMATICUPDATESCOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1904 }
1905
1906 void OnSystemRestorePointBeginFallback(
1907 __in BA_ONSYSTEMRESTOREPOINTBEGIN_ARGS* pArgs,
1908 __inout BA_ONSYSTEMRESTOREPOINTBEGIN_RESULTS* pResults
1909 )
1910 {
1911 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONSYSTEMRESTOREPOINTBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1912 }
1913
1914 void OnSystemRestorePointCompleteFallback(
1915 __in BA_ONSYSTEMRESTOREPOINTCOMPLETE_ARGS* pArgs,
1916 __inout BA_ONSYSTEMRESTOREPOINTCOMPLETE_RESULTS* pResults
1917 )
1918 {
1919 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONSYSTEMRESTOREPOINTCOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1920 }
1921
1922 void OnPlanForwardCompatibleBundleFallback(
1923 __in BA_ONPLANFORWARDCOMPATIBLEBUNDLE_ARGS* pArgs,
1924 __inout BA_ONPLANFORWARDCOMPATIBLEBUNDLE_RESULTS* pResults
1925 )
1926 {
1927 BOOL fIgnoreBundle = pResults->fIgnoreBundle;
1928 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONPLANFORWARDCOMPATIBLEBUNDLE, pArgs, pResults, m_pvBAFunctionsProcContext);
1929 BalLogId(BOOTSTRAPPER_LOG_LEVEL_STANDARD, MSG_WIXSTDBA_PLANNED_FORWARD_COMPATIBLE_BUNDLE, m_hModule, pArgs->wzBundleId, fIgnoreBundle ? "ignore" : "enable", pResults->fIgnoreBundle ? "ignore" : "enable");
1930 }
1931
1932 void OnCacheVerifyProgressFallback(
1933 __in BA_ONCACHEVERIFYPROGRESS_ARGS* pArgs,
1934 __inout BA_ONCACHEVERIFYPROGRESS_RESULTS* pResults
1935 )
1936 {
1937 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYPROGRESS, pArgs, pResults, m_pvBAFunctionsProcContext);
1938 }
1939
1940 void OnCacheContainerOrPayloadVerifyBeginFallback(
1941 __in BA_ONCACHECONTAINERORPAYLOADVERIFYBEGIN_ARGS* pArgs,
1942 __inout BA_ONCACHECONTAINERORPAYLOADVERIFYBEGIN_RESULTS* pResults
1943 )
1944 {
1945 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1946 }
1947
1948 void OnCacheContainerOrPayloadVerifyCompleteFallback(
1949 __in BA_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE_ARGS* pArgs,
1950 __inout BA_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE_RESULTS* pResults
1951 )
1952 {
1953 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1954 }
1955
1956 void OnCacheContainerOrPayloadVerifyProgressFallback(
1957 __in BA_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS_ARGS* pArgs,
1958 __inout BA_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS_RESULTS* pResults
1959 )
1960 {
1961 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS, pArgs, pResults, m_pvBAFunctionsProcContext);
1962 }
1963
1964 void OnCachePayloadExtractBeginFallback(
1965 __in BA_ONCACHEPAYLOADEXTRACTBEGIN_ARGS* pArgs,
1966 __inout BA_ONCACHEPAYLOADEXTRACTBEGIN_RESULTS* pResults
1967 )
1968 {
1969 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTBEGIN, pArgs, pResults, m_pvBAFunctionsProcContext);
1970 }
1971
1972 void OnCachePayloadExtractCompleteFallback(
1973 __in BA_ONCACHEPAYLOADEXTRACTCOMPLETE_ARGS* pArgs,
1974 __inout BA_ONCACHEPAYLOADEXTRACTCOMPLETE_RESULTS* pResults
1975 )
1976 {
1977 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE, pArgs, pResults, m_pvBAFunctionsProcContext);
1978 }
1979
1980 void OnCachePayloadExtractProgressFallback(
1981 __in BA_ONCACHEPAYLOADEXTRACTPROGRESS_ARGS* pArgs,
1982 __inout BA_ONCACHEPAYLOADEXTRACTPROGRESS_RESULTS* pResults
1983 )
1984 {
1985 m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS, pArgs, pResults, m_pvBAFunctionsProcContext);
1986 }
1987
1988 //
1989 // UiThreadProc - entrypoint for UI thread.
1990 //
1991 static DWORD WINAPI UiThreadProc(
1992 __in LPVOID pvContext
1993 )
1994 {
1995 HRESULT hr = S_OK;
1996 CWixStandardBootstrapperApplication* pThis = (CWixStandardBootstrapperApplication*)pvContext;
1997 BOOL fComInitialized = FALSE;
1998 BOOL fRet = FALSE;
1999 MSG msg = { };
2000
2001 // Initialize COM and theme.
2002 hr = ::CoInitialize(NULL);
2003 BalExitOnFailure(hr, "Failed to initialize COM.");
2004 fComInitialized = TRUE;
2005
2006 hr = ThemeInitialize(pThis->m_hModule);
2007 BalExitOnFailure(hr, "Failed to initialize theme manager.");
2008
2009 hr = pThis->InitializeData();
2010 BalExitOnFailure(hr, "Failed to initialize data in bootstrapper application.");
2011
2012 // Create main window.
2013 pThis->InitializeTaskbarButton();
2014 hr = pThis->CreateMainWindow();
2015 BalExitOnFailure(hr, "Failed to create main window.");
2016
2017 if (FAILED(pThis->m_hrFinal))
2018 {
2019 pThis->SetState(WIXSTDBA_STATE_FAILED, hr);
2020 ::PostMessageW(pThis->m_hWnd, WM_WIXSTDBA_SHOW_FAILURE, 0, 0);
2021 }
2022 else
2023 {
2024 // Okay, we're ready for packages now.
2025 pThis->SetState(WIXSTDBA_STATE_INITIALIZED, hr);
2026 ::PostMessageW(pThis->m_hWnd, BOOTSTRAPPER_ACTION_HELP == pThis->m_command.action ? WM_WIXSTDBA_SHOW_HELP : WM_WIXSTDBA_DETECT_PACKAGES, 0, 0);
2027 }
2028
2029 // message pump
2030 while (0 != (fRet = ::GetMessageW(&msg, NULL, 0, 0)))
2031 {
2032 if (-1 == fRet)
2033 {
2034 hr = E_UNEXPECTED;
2035 BalExitOnFailure(hr, "Unexpected return value from message pump.");
2036 }
2037 else if (!ThemeHandleKeyboardMessage(pThis->m_pTheme, msg.hwnd, &msg))
2038 {
2039 ::TranslateMessage(&msg);
2040 ::DispatchMessageW(&msg);
2041 }
2042 }
2043
2044 // Succeeded thus far, check to see if anything went wrong while actually
2045 // executing changes.
2046 if (FAILED(pThis->m_hrFinal))
2047 {
2048 hr = pThis->m_hrFinal;
2049 }
2050 else if (pThis->CheckCanceled())
2051 {
2052 hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
2053 }
2054
2055 LExit:
2056 // destroy main window
2057 pThis->DestroyMainWindow();
2058 pThis->UninitializeTaskbarButton();
2059
2060 // initiate engine shutdown
2061 DWORD dwQuit = HRESULT_CODE(hr);
2062 if (BOOTSTRAPPER_APPLY_RESTART_INITIATED == pThis->m_restartResult)
2063 {
2064 dwQuit = ERROR_SUCCESS_REBOOT_INITIATED;
2065 }
2066 else if (BOOTSTRAPPER_APPLY_RESTART_REQUIRED == pThis->m_restartResult)
2067 {
2068 dwQuit = ERROR_SUCCESS_REBOOT_REQUIRED;
2069 }
2070 pThis->m_pEngine->Quit(dwQuit);
2071
2072 ReleaseTheme(pThis->m_pTheme);
2073 ThemeUninitialize();
2074
2075 // uninitialize COM
2076 if (fComInitialized)
2077 {
2078 ::CoUninitialize();
2079 }
2080
2081 return hr;
2082 }
2083
2084
2085 //
2086 // InitializeData - initializes all the package and prerequisite information.
2087 //
2088 HRESULT InitializeData()
2089 {
2090 HRESULT hr = S_OK;
2091 LPWSTR sczModulePath = NULL;
2092 IXMLDOMDocument *pixdManifest = NULL;
2093
2094 hr = BalManifestLoad(m_hModule, &pixdManifest);
2095 BalExitOnFailure(hr, "Failed to load bootstrapper application manifest.");
2096
2097 hr = ParseOverridableVariablesFromXml(pixdManifest);
2098 BalExitOnFailure(hr, "Failed to read overridable variables.");
2099
2100 hr = ProcessCommandLine(&m_sczLanguage);
2101 ExitOnFailure(hr, "Unknown commandline parameters.");
2102
2103 hr = PathRelativeToModule(&sczModulePath, NULL, m_hModule);
2104 BalExitOnFailure(hr, "Failed to get module path.");
2105
2106 hr = LoadLocalization(sczModulePath, m_sczLanguage);
2107 ExitOnFailure(hr, "Failed to load localization.");
2108
2109 hr = LoadTheme(sczModulePath, m_sczLanguage);
2110 ExitOnFailure(hr, "Failed to load theme.");
2111
2112 hr = BalInfoParseFromXml(&m_Bundle, pixdManifest);
2113 BalExitOnFailure(hr, "Failed to load bundle information.");
2114
2115 hr = BalConditionsParseFromXml(&m_Conditions, pixdManifest, m_pWixLoc);
2116 BalExitOnFailure(hr, "Failed to load conditions from XML.");
2117
2118 hr = LoadBAFunctions(pixdManifest);
2119 BalExitOnFailure(hr, "Failed to load bootstrapper functions.");
2120
2121 GetBundleFileVersion();
2122 // don't fail if we couldn't get the version info; best-effort only
2123
2124 hr = InitializePackageInfo();
2125 BalExitOnFailure(hr, "Failed to initialize wixstdba package information.");
2126
2127 if (m_fPrereq)
2128 {
2129 hr = InitializePrerequisiteInformation();
2130 BalExitOnFailure(hr, "Failed to initialize prerequisite information.");
2131 }
2132 else
2133 {
2134 hr = ParseBootstrapperApplicationDataFromXml(pixdManifest);
2135 BalExitOnFailure(hr, "Failed to read bootstrapper application data.");
2136 }
2137
2138 if (BOOTSTRAPPER_ACTION_CACHE == m_plannedAction)
2139 {
2140 if (m_fSupportCacheOnly)
2141 {
2142 // Doesn't make sense to prompt the user if cache only is requested.
2143 if (BOOTSTRAPPER_DISPLAY_PASSIVE < m_command.display)
2144 {
2145 m_command.display = BOOTSTRAPPER_DISPLAY_PASSIVE;
2146 }
2147
2148 m_command.action = BOOTSTRAPPER_ACTION_CACHE;
2149 }
2150 else
2151 {
2152 BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Ignoring attempt to only cache a bundle that does not explicitly support it.");
2153 m_plannedAction = BOOTSTRAPPER_ACTION_UNKNOWN;
2154 }
2155 }
2156
2157 LExit:
2158 ReleaseObject(pixdManifest);
2159 ReleaseStr(sczModulePath);
2160
2161 return hr;
2162 }
2163
2164
2165 //
2166 // ProcessCommandLine - process the provided command line arguments.
2167 //
2168 HRESULT ProcessCommandLine(
2169 __inout LPWSTR* psczLanguage
2170 )
2171 {
2172 HRESULT hr = S_OK;
2173 int argc = 0;
2174 LPWSTR* argv = NULL;
2175 LPWSTR sczVariableName = NULL;
2176 LPWSTR sczVariableValue = NULL;
2177
2178 if (m_command.wzCommandLine && *m_command.wzCommandLine)
2179 {
2180 hr = AppParseCommandLine(m_command.wzCommandLine, &argc, &argv);
2181 ExitOnFailure(hr, "Failed to parse command line.");
2182
2183 for (int i = 0; i < argc; ++i)
2184 {
2185 if (argv[i][0] == L'-' || argv[i][0] == L'/')
2186 {
2187 if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"lang", -1))
2188 {
2189 if (i + 1 >= argc)
2190 {
2191 hr = E_INVALIDARG;
2192 BalExitOnFailure(hr, "Must specify a language.");
2193 }
2194
2195 ++i;
2196
2197 hr = StrAllocString(psczLanguage, &argv[i][0], 0);
2198 BalExitOnFailure(hr, "Failed to copy language.");
2199 }
2200 }
2201 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"cache", -1))
2202 {
2203 m_plannedAction = BOOTSTRAPPER_ACTION_CACHE;
2204 }
2205 else if (m_sdOverridableVariables)
2206 {
2207 const wchar_t* pwc = wcschr(argv[i], L'=');
2208 if (pwc)
2209 {
2210 hr = StrAllocString(&sczVariableName, argv[i], pwc - argv[i]);
2211 BalExitOnFailure(hr, "Failed to copy variable name.");
2212
2213 hr = DictKeyExists(m_sdOverridableVariables, sczVariableName);
2214 if (E_NOTFOUND == hr)
2215 {
2216 BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Ignoring attempt to set non-overridable variable: '%ls'.", sczVariableName);
2217 hr = S_OK;
2218 continue;
2219 }
2220 ExitOnFailure(hr, "Failed to check the dictionary of overridable variables.");
2221
2222 hr = StrAllocString(&sczVariableValue, ++pwc, 0);
2223 BalExitOnFailure(hr, "Failed to copy variable value.");
2224
2225 hr = m_pEngine->SetVariableString(sczVariableName, sczVariableValue, FALSE);
2226 BalExitOnFailure(hr, "Failed to set variable.");
2227 }
2228 else
2229 {
2230 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Ignoring unknown argument: %ls", argv[i]);
2231 }
2232 }
2233 }
2234 }
2235
2236 LExit:
2237 if (argv)
2238 {
2239 AppFreeCommandLineArgs(argv);
2240 }
2241
2242 ReleaseStr(sczVariableName);
2243 ReleaseStr(sczVariableValue);
2244
2245 return hr;
2246 }
2247
2248 HRESULT LoadLocalization(
2249 __in_z LPCWSTR wzModulePath,
2250 __in_z_opt LPCWSTR wzLanguage
2251 )
2252 {
2253 HRESULT hr = S_OK;
2254 LPWSTR sczLocPath = NULL;
2255 LPWSTR sczFormatted = NULL;
2256 LPCWSTR wzLocFileName = m_fPrereq ? L"mbapreq.wxl" : L"thm.wxl";
2257
2258 // Find and load .wxl file.
2259 hr = LocProbeForFile(wzModulePath, wzLocFileName, wzLanguage, &sczLocPath);
2260 BalExitOnFailure(hr, "Failed to probe for loc file: %ls in path: %ls", wzLocFileName, wzModulePath);
2261
2262 hr = LocLoadFromFile(sczLocPath, &m_pWixLoc);
2263 BalExitOnFailure(hr, "Failed to load loc file from path: %ls", sczLocPath);
2264
2265 // Set WixStdBALanguageId to .wxl language id.
2266 if (WIX_LOCALIZATION_LANGUAGE_NOT_SET != m_pWixLoc->dwLangId)
2267 {
2268 ::SetThreadLocale(m_pWixLoc->dwLangId);
2269
2270 hr = m_pEngine->SetVariableNumeric(WIXSTDBA_VARIABLE_LANGUAGE_ID, m_pWixLoc->dwLangId);
2271 BalExitOnFailure(hr, "Failed to set WixStdBALanguageId variable.");
2272 }
2273
2274 // Load ConfirmCancelMessage.
2275 hr = StrAllocString(&m_sczConfirmCloseMessage, L"#(loc.ConfirmCancelMessage)", 0);
2276 ExitOnFailure(hr, "Failed to initialize confirm message loc identifier.");
2277
2278 hr = LocLocalizeString(m_pWixLoc, &m_sczConfirmCloseMessage);
2279 BalExitOnFailure(hr, "Failed to localize confirm close message: %ls", m_sczConfirmCloseMessage);
2280
2281 hr = BalFormatString(m_sczConfirmCloseMessage, &sczFormatted);
2282 if (SUCCEEDED(hr))
2283 {
2284 ReleaseStr(m_sczConfirmCloseMessage);
2285 m_sczConfirmCloseMessage = sczFormatted;
2286 sczFormatted = NULL;
2287 }
2288
2289 LExit:
2290 ReleaseStr(sczFormatted);
2291 ReleaseStr(sczLocPath);
2292
2293 return hr;
2294 }
2295
2296
2297 HRESULT LoadTheme(
2298 __in_z LPCWSTR wzModulePath,
2299 __in_z_opt LPCWSTR wzLanguage
2300 )
2301 {
2302 HRESULT hr = S_OK;
2303 LPWSTR sczThemePath = NULL;
2304 LPCWSTR wzThemeFileName = m_fPrereq ? L"mbapreq.thm" : L"thm.xml";
2305
2306 hr = LocProbeForFile(wzModulePath, wzThemeFileName, wzLanguage, &sczThemePath);
2307 BalExitOnFailure(hr, "Failed to probe for theme file: %ls in path: %ls", wzThemeFileName, wzModulePath);
2308
2309 hr = ThemeLoadFromFile(sczThemePath, &m_pTheme);
2310 BalExitOnFailure(hr, "Failed to load theme from path: %ls", sczThemePath);
2311
2312 hr = ThemeRegisterVariableCallbacks(m_pTheme, EvaluateVariableConditionCallback, FormatVariableStringCallback, GetVariableNumericCallback, SetVariableNumericCallback, GetVariableStringCallback, SetVariableStringCallback, NULL);
2313 BalExitOnFailure(hr, "Failed to register variable theme callbacks.");
2314
2315 hr = ThemeLocalize(m_pTheme, m_pWixLoc);
2316 BalExitOnFailure(hr, "Failed to localize theme: %ls", sczThemePath);
2317
2318 LExit:
2319 ReleaseStr(sczThemePath);
2320
2321 return hr;
2322 }
2323
2324
2325 HRESULT ParseOverridableVariablesFromXml(
2326 __in IXMLDOMDocument* pixdManifest
2327 )
2328 {
2329 HRESULT hr = S_OK;
2330 IXMLDOMNode* pNode = NULL;
2331 IXMLDOMNodeList* pNodes = NULL;
2332 DWORD cNodes = 0;
2333 LPWSTR scz = NULL;
2334
2335 // Get the list of variables users can override on the command line.
2336 hr = XmlSelectNodes(pixdManifest, L"/BootstrapperApplicationData/WixStdbaOverridableVariable", &pNodes);
2337 if (S_FALSE == hr)
2338 {
2339 ExitFunction1(hr = S_OK);
2340 }
2341 ExitOnFailure(hr, "Failed to select overridable variable nodes.");
2342
2343 hr = pNodes->get_length((long*)&cNodes);
2344 ExitOnFailure(hr, "Failed to get overridable variable node count.");
2345
2346 if (cNodes)
2347 {
2348 hr = DictCreateStringList(&m_sdOverridableVariables, 32, DICT_FLAG_NONE);
2349 ExitOnFailure(hr, "Failed to create the string dictionary.");
2350
2351 for (DWORD i = 0; i < cNodes; ++i)
2352 {
2353 hr = XmlNextElement(pNodes, &pNode, NULL);
2354 ExitOnFailure(hr, "Failed to get next node.");
2355
2356 // @Name
2357 hr = XmlGetAttributeEx(pNode, L"Name", &scz);
2358 ExitOnFailure(hr, "Failed to get @Name.");
2359
2360 hr = DictAddKey(m_sdOverridableVariables, scz);
2361 ExitOnFailure(hr, "Failed to add \"%ls\" to the string dictionary.", scz);
2362
2363 // prepare next iteration
2364 ReleaseNullObject(pNode);
2365 }
2366 }
2367
2368 LExit:
2369 ReleaseObject(pNode);
2370 ReleaseObject(pNodes);
2371 ReleaseStr(scz);
2372 return hr;
2373 }
2374
2375
2376 HRESULT InitializePackageInfo()
2377 {
2378 HRESULT hr = S_OK;
2379 BAL_INFO_PACKAGE* pPackage = NULL;
2380
2381 for (DWORD i = 0; i < m_Bundle.packages.cPackages; ++i)
2382 {
2383 pPackage = &m_Bundle.packages.rgPackages[i];
2384
2385 hr = InitializePackageInfoForPackage(pPackage);
2386 BalExitOnFailure(hr, "Failed to initialize wixstdba package info for package: %ls.", pPackage->sczId);
2387 }
2388
2389 LExit:
2390 return hr;
2391 }
2392
2393
2394 HRESULT InitializePackageInfoForPackage(
2395 __in BAL_INFO_PACKAGE* pPackage
2396 )
2397 {
2398 HRESULT hr = S_OK;
2399
2400 pPackage->pvCustomData = MemAlloc(sizeof(WIXSTDBA_PACKAGE_INFO), TRUE);
2401 BalExitOnNull(pPackage->pvCustomData, hr, E_OUTOFMEMORY, "Failed to allocate memory for wixstdba package info.");
2402
2403 LExit:
2404 return hr;
2405 }
2406
2407
2408 HRESULT InitializePrerequisiteInformation()
2409 {
2410 HRESULT hr = S_OK;
2411 BAL_INFO_PACKAGE* pPackage = NULL;
2412
2413 for (DWORD i = 0; i < m_Bundle.packages.cPackages; ++i)
2414 {
2415 pPackage = &m_Bundle.packages.rgPackages[i];
2416 if (!pPackage->fPrereqPackage)
2417 {
2418 continue;
2419 }
2420
2421 if (pPackage->sczPrereqLicenseFile)
2422 {
2423 if (m_sczLicenseFile)
2424 {
2425 hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
2426 BalExitOnFailure(hr, "More than one license file specified in prerequisite info.");
2427 }
2428
2429 hr = StrAllocString(&m_sczLicenseFile, pPackage->sczPrereqLicenseFile, 0);
2430 BalExitOnFailure(hr, "Failed to copy license file location from prereq package.");
2431 }
2432
2433 if (pPackage->sczPrereqLicenseUrl)
2434 {
2435 if (m_sczLicenseUrl)
2436 {
2437 hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
2438 BalExitOnFailure(hr, "More than one license URL specified in prerequisite info.");
2439 }
2440
2441 hr = StrAllocString(&m_sczLicenseUrl, pPackage->sczPrereqLicenseUrl, 0);
2442 BalExitOnFailure(hr, "Failed to copy license URL from prereq package.");
2443 }
2444 }
2445
2446 LExit:
2447 return hr;
2448 }
2449
2450
2451 HRESULT ParseBootstrapperApplicationDataFromXml(
2452 __in IXMLDOMDocument* pixdManifest
2453 )
2454 {
2455 HRESULT hr = S_OK;
2456 IXMLDOMNode* pNode = NULL;
2457 DWORD dwBool = 0;
2458
2459 hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/WixStdbaInformation", &pNode);
2460 if (S_FALSE == hr)
2461 {
2462 hr = E_INVALIDARG;
2463 }
2464 BalExitOnFailure(hr, "BootstrapperApplication.xml manifest is missing wixstdba information.");
2465
2466 hr = XmlGetAttributeEx(pNode, L"LicenseFile", &m_sczLicenseFile);
2467 if (E_NOTFOUND == hr)
2468 {
2469 hr = S_OK;
2470 }
2471 BalExitOnFailure(hr, "Failed to get license file.");
2472
2473 hr = XmlGetAttributeEx(pNode, L"LicenseUrl", &m_sczLicenseUrl);
2474 if (E_NOTFOUND == hr)
2475 {
2476 hr = S_OK;
2477 }
2478 BalExitOnFailure(hr, "Failed to get license URL.");
2479
2480 ReleaseObject(pNode);
2481
2482 hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/WixStdbaOptions", &pNode);
2483 if (S_FALSE == hr)
2484 {
2485 ExitFunction1(hr = S_OK);
2486 }
2487 BalExitOnFailure(hr, "Failed to read wixstdba options from BootstrapperApplication.xml manifest.");
2488
2489 hr = XmlGetAttributeNumber(pNode, L"SuppressOptionsUI", &dwBool);
2490 if (S_FALSE == hr)
2491 {
2492 hr = S_OK;
2493 }
2494 else if (SUCCEEDED(hr) && dwBool)
2495 {
2496 hr = BalSetNumericVariable(WIXSTDBA_VARIABLE_SUPPRESS_OPTIONS_UI, 1);
2497 BalExitOnFailure(hr, "Failed to set '%ls' variable.", WIXSTDBA_VARIABLE_SUPPRESS_OPTIONS_UI);
2498 }
2499 BalExitOnFailure(hr, "Failed to get SuppressOptionsUI value.");
2500
2501 dwBool = 0;
2502 hr = XmlGetAttributeNumber(pNode, L"SuppressDowngradeFailure", &dwBool);
2503 if (S_FALSE == hr)
2504 {
2505 hr = S_OK;
2506 }
2507 else if (SUCCEEDED(hr))
2508 {
2509 m_fSuppressDowngradeFailure = 0 < dwBool;
2510 }
2511 BalExitOnFailure(hr, "Failed to get SuppressDowngradeFailure value.");
2512
2513 dwBool = 0;
2514 hr = XmlGetAttributeNumber(pNode, L"SuppressRepair", &dwBool);
2515 if (S_FALSE == hr)
2516 {
2517 hr = S_OK;
2518 }
2519 else if (SUCCEEDED(hr))
2520 {
2521 m_fSuppressRepair = 0 < dwBool;
2522 }
2523 BalExitOnFailure(hr, "Failed to get SuppressRepair value.");
2524
2525 hr = XmlGetAttributeNumber(pNode, L"ShowVersion", &dwBool);
2526 if (S_FALSE == hr)
2527 {
2528 hr = S_OK;
2529 }
2530 else if (SUCCEEDED(hr) && dwBool)
2531 {
2532 hr = BalSetNumericVariable(WIXSTDBA_VARIABLE_SHOW_VERSION, 1);
2533 BalExitOnFailure(hr, "Failed to set '%ls' variable.", WIXSTDBA_VARIABLE_SHOW_VERSION);
2534 }
2535 BalExitOnFailure(hr, "Failed to get ShowVersion value.");
2536
2537 hr = XmlGetAttributeNumber(pNode, L"SupportCacheOnly", &dwBool);
2538 if (S_FALSE == hr)
2539 {
2540 hr = S_OK;
2541 }
2542 else if (SUCCEEDED(hr))
2543 {
2544 m_fSupportCacheOnly = 0 < dwBool;
2545 }
2546 BalExitOnFailure(hr, "Failed to get SupportCacheOnly value.");
2547
2548 LExit:
2549 ReleaseObject(pNode);
2550 return hr;
2551 }
2552
2553 HRESULT GetPackageInfo(
2554 __in_z LPCWSTR wzPackageId,
2555 __out WIXSTDBA_PACKAGE_INFO** ppPackageInfo,
2556 __out BAL_INFO_PACKAGE** ppPackage
2557 )
2558 {
2559 HRESULT hr = E_NOTFOUND;
2560 WIXSTDBA_PACKAGE_INFO* pPackageInfo = NULL;
2561 BAL_INFO_PACKAGE* pPackage = NULL;
2562
2563 Assert(wzPackageId && *wzPackageId);
2564 Assert(ppPackage);
2565 Assert(ppPackageInfo);
2566
2567 hr = BalInfoFindPackageById(&m_Bundle.packages, wzPackageId, &pPackage);
2568 if (E_NOTFOUND != hr)
2569 {
2570 ExitOnFailure(hr, "Failed trying to find the requested package.");
2571
2572 pPackageInfo = reinterpret_cast<WIXSTDBA_PACKAGE_INFO*>(pPackage->pvCustomData);
2573 }
2574
2575 *ppPackageInfo = pPackageInfo;
2576 *ppPackage = pPackage;
2577
2578 LExit:
2579 return hr;
2580 }
2581
2582
2583 //
2584 // Get the file version of the bootstrapper and record in bootstrapper log file
2585 //
2586 HRESULT GetBundleFileVersion()
2587 {
2588 HRESULT hr = S_OK;
2589 ULARGE_INTEGER uliVersion = { };
2590 LPWSTR sczCurrentPath = NULL;
2591 VERUTIL_VERSION* pVersion = NULL;
2592
2593 hr = PathForCurrentProcess(&sczCurrentPath, NULL);
2594 BalExitOnFailure(hr, "Failed to get bundle path.");
2595
2596 hr = FileVersion(sczCurrentPath, &uliVersion.HighPart, &uliVersion.LowPart);
2597 BalExitOnFailure(hr, "Failed to get bundle file version.");
2598
2599 hr = VerVersionFromQword(uliVersion.QuadPart, &pVersion);
2600 BalExitOnFailure(hr, "Failed to create bundle file version.");
2601
2602 hr = m_pEngine->SetVariableVersion(WIXSTDBA_VARIABLE_BUNDLE_FILE_VERSION, pVersion->sczVersion);
2603 BalExitOnFailure(hr, "Failed to set WixBundleFileVersion variable.");
2604
2605 LExit:
2606 ReleaseVerutilVersion(pVersion);
2607 ReleaseStr(sczCurrentPath);
2608
2609 return hr;
2610 }
2611
2612
2613 //
2614 // CreateMainWindow - creates the main install window.
2615 //
2616 HRESULT CreateMainWindow()
2617 {
2618 HRESULT hr = S_OK;
2619 HICON hIcon = reinterpret_cast<HICON>(m_pTheme->hIcon);
2620 WNDCLASSW wc = { };
2621 DWORD dwWindowStyle = 0;
2622 int x = CW_USEDEFAULT;
2623 int y = CW_USEDEFAULT;
2624 POINT ptCursor = { };
2625
2626 // If the theme did not provide an icon, try using the icon from the bundle engine.
2627 if (!hIcon)
2628 {
2629 HMODULE hBootstrapperEngine = ::GetModuleHandleW(NULL);
2630 if (hBootstrapperEngine)
2631 {
2632 hIcon = ::LoadIconW(hBootstrapperEngine, MAKEINTRESOURCEW(1));
2633 }
2634 }
2635
2636 // Register the window class and create the window.
2637 wc.lpfnWndProc = CWixStandardBootstrapperApplication::WndProc;
2638 wc.hInstance = m_hModule;
2639 wc.hIcon = hIcon;
2640 wc.hCursor = ::LoadCursorW(NULL, (LPCWSTR)IDC_ARROW);
2641 wc.hbrBackground = m_pTheme->rgFonts[m_pTheme->dwFontId].hBackground;
2642 wc.lpszMenuName = NULL;
2643 wc.lpszClassName = WIXSTDBA_WINDOW_CLASS;
2644 if (!::RegisterClassW(&wc))
2645 {
2646 ExitWithLastError(hr, "Failed to register window.");
2647 }
2648
2649 m_fRegistered = TRUE;
2650
2651 // Calculate the window style based on the theme style and command display value.
2652 dwWindowStyle = m_pTheme->dwStyle;
2653 if (BOOTSTRAPPER_DISPLAY_NONE >= m_command.display)
2654 {
2655 dwWindowStyle &= ~WS_VISIBLE;
2656 }
2657
2658 // Don't show the window if there is a splash screen (it will be made visible when the splash screen is hidden)
2659 if (::IsWindow(m_command.hwndSplashScreen))
2660 {
2661 dwWindowStyle &= ~WS_VISIBLE;
2662 }
2663
2664 // Center the window on the monitor with the mouse.
2665 if (::GetCursorPos(&ptCursor))
2666 {
2667 x = ptCursor.x;
2668 y = ptCursor.y;
2669 }
2670
2671 hr = ThemeCreateParentWindow(m_pTheme, 0, wc.lpszClassName, m_pTheme->sczCaption, dwWindowStyle, x, y, HWND_DESKTOP, m_hModule, this, THEME_WINDOW_INITIAL_POSITION_CENTER_MONITOR_FROM_COORDINATES, &m_hWnd);
2672 ExitOnFailure(hr, "Failed to create window.");
2673
2674 hr = S_OK;
2675
2676 LExit:
2677 return hr;
2678 }
2679
2680
2681 //
2682 // InitializeTaskbarButton - initializes taskbar button for progress.
2683 //
2684 void InitializeTaskbarButton()
2685 {
2686 HRESULT hr = S_OK;
2687
2688 hr = ::CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_ALL, __uuidof(ITaskbarList3), reinterpret_cast<LPVOID*>(&m_pTaskbarList));
2689 if (REGDB_E_CLASSNOTREG == hr) // not supported before Windows 7
2690 {
2691 ExitFunction1(hr = S_OK);
2692 }
2693 BalExitOnFailure(hr, "Failed to create ITaskbarList3. Continuing.");
2694
2695 m_uTaskbarButtonCreatedMessage = ::RegisterWindowMessageW(L"TaskbarButtonCreated");
2696 BalExitOnNullWithLastError(m_uTaskbarButtonCreatedMessage, hr, "Failed to get TaskbarButtonCreated message. Continuing.");
2697
2698 LExit:
2699 return;
2700 }
2701
2702 //
2703 // DestroyMainWindow - clean up all the window registration.
2704 //
2705 void DestroyMainWindow()
2706 {
2707 if (::IsWindow(m_hWnd))
2708 {
2709 ::DestroyWindow(m_hWnd);
2710 m_hWnd = NULL;
2711 m_fTaskbarButtonOK = FALSE;
2712 }
2713
2714 if (m_fRegistered)
2715 {
2716 ::UnregisterClassW(WIXSTDBA_WINDOW_CLASS, m_hModule);
2717 m_fRegistered = FALSE;
2718 }
2719 }
2720
2721
2722 //
2723 // UninitializeTaskbarButton - clean up the taskbar registration.
2724 //
2725 void UninitializeTaskbarButton()
2726 {
2727 m_fTaskbarButtonOK = FALSE;
2728 ReleaseNullObject(m_pTaskbarList);
2729 }
2730
2731
2732 static LRESULT CallDefaultWndProc(
2733 __in CWixStandardBootstrapperApplication* pBA,
2734 __in HWND hWnd,
2735 __in UINT uMsg,
2736 __in WPARAM wParam,
2737 __in LPARAM lParam
2738 )
2739 {
2740 LRESULT lres = NULL;
2741 THEME* pTheme = NULL;
2742 HRESULT hr = S_OK;
2743 BA_FUNCTIONS_WNDPROC_ARGS wndProcArgs = { };
2744 BA_FUNCTIONS_WNDPROC_RESULTS wndProcResults = { };
2745
2746 if (pBA)
2747 {
2748 pTheme = pBA->m_pTheme;
2749
2750 if (pBA->m_pfnBAFunctionsProc)
2751 {
2752 wndProcArgs.cbSize = sizeof(wndProcArgs);
2753 wndProcArgs.pTheme = pTheme;
2754 wndProcArgs.hWnd = hWnd;
2755 wndProcArgs.uMsg = uMsg;
2756 wndProcArgs.wParam = wParam;
2757 wndProcArgs.lParam = lParam;
2758 wndProcResults.cbSize = sizeof(wndProcResults);
2759
2760 hr = pBA->m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_WNDPROC, &wndProcArgs, &wndProcResults, pBA->m_pvBAFunctionsProcContext);
2761 if (E_NOTIMPL != hr)
2762 {
2763 lres = wndProcResults.lres;
2764 ExitFunction();
2765 }
2766 }
2767 }
2768
2769 lres = ThemeDefWindowProc(pTheme, hWnd, uMsg, wParam, lParam);
2770
2771 LExit:
2772 return lres;
2773 }
2774
2775 //
2776 // WndProc - standard windows message handler.
2777 //
2778 static LRESULT CALLBACK WndProc(
2779 __in HWND hWnd,
2780 __in UINT uMsg,
2781 __in WPARAM wParam,
2782 __in LPARAM lParam
2783 )
2784 {
2785#pragma warning(suppress:4312)
2786 CWixStandardBootstrapperApplication* pBA = reinterpret_cast<CWixStandardBootstrapperApplication*>(::GetWindowLongPtrW(hWnd, GWLP_USERDATA));
2787 BOOL fCancel = FALSE;
2788
2789 switch (uMsg)
2790 {
2791 case WM_NCCREATE:
2792 {
2793 LPCREATESTRUCT lpcs = reinterpret_cast<LPCREATESTRUCT>(lParam);
2794 pBA = reinterpret_cast<CWixStandardBootstrapperApplication*>(lpcs->lpCreateParams);
2795#pragma warning(suppress:4244)
2796 ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(pBA));
2797 }
2798 break;
2799
2800 case WM_NCDESTROY:
2801 {
2802 LRESULT lres = CallDefaultWndProc(pBA, hWnd, uMsg, wParam, lParam);
2803 ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, 0);
2804 ::PostQuitMessage(0);
2805 return lres;
2806 }
2807
2808 case WM_CREATE:
2809 if (!pBA->OnCreate(hWnd))
2810 {
2811 return -1;
2812 }
2813 break;
2814
2815 case WM_QUERYENDSESSION:
2816 fCancel = true;
2817 pBA->OnSystemShutdown(static_cast<DWORD>(lParam), &fCancel);
2818 return !fCancel;
2819
2820 case WM_CLOSE:
2821 // If the user chose not to close, do *not* let the default window proc handle the message.
2822 if (!pBA->OnClose())
2823 {
2824 return 0;
2825 }
2826 break;
2827
2828 case WM_WIXSTDBA_SHOW_HELP:
2829 pBA->OnShowHelp();
2830 return 0;
2831
2832 case WM_WIXSTDBA_DETECT_PACKAGES:
2833 pBA->OnDetect();
2834 return 0;
2835
2836 case WM_WIXSTDBA_PLAN_PACKAGES:
2837 pBA->OnPlan(static_cast<BOOTSTRAPPER_ACTION>(lParam));
2838 return 0;
2839
2840 case WM_WIXSTDBA_APPLY_PACKAGES:
2841 pBA->OnApply();
2842 return 0;
2843
2844 case WM_WIXSTDBA_CHANGE_STATE:
2845 pBA->OnChangeState(static_cast<WIXSTDBA_STATE>(lParam));
2846 return 0;
2847
2848 case WM_WIXSTDBA_SHOW_FAILURE:
2849 pBA->OnShowFailure();
2850 return 0;
2851
2852 case WM_COMMAND:
2853 switch (HIWORD(wParam))
2854 {
2855 case BN_CLICKED:
2856 switch (LOWORD(wParam))
2857 {
2858 case WIXSTDBA_CONTROL_EULA_ACCEPT_CHECKBOX:
2859 pBA->OnClickAcceptCheckbox();
2860 return 0;
2861
2862 case WIXSTDBA_CONTROL_INSTALL_BUTTON:
2863 pBA->OnClickInstallButton();
2864 return 0;
2865
2866 case WIXSTDBA_CONTROL_REPAIR_BUTTON:
2867 pBA->OnClickRepairButton();
2868 return 0;
2869
2870 case WIXSTDBA_CONTROL_UNINSTALL_BUTTON:
2871 pBA->OnClickUninstallButton();
2872 return 0;
2873
2874 case WIXSTDBA_CONTROL_LAUNCH_BUTTON:
2875 pBA->OnClickLaunchButton();
2876 return 0;
2877
2878 case WIXSTDBA_CONTROL_SUCCESS_RESTART_BUTTON: __fallthrough;
2879 case WIXSTDBA_CONTROL_FAILURE_RESTART_BUTTON:
2880 pBA->OnClickRestartButton();
2881 return 0;
2882
2883 case WIXSTDBA_CONTROL_PROGRESS_CANCEL_BUTTON:
2884 pBA->OnClickCloseButton();
2885 return 0;
2886 }
2887 break;
2888 }
2889 break;
2890
2891 case WM_NOTIFY:
2892 if (lParam)
2893 {
2894 LPNMHDR pnmhdr = reinterpret_cast<LPNMHDR>(lParam);
2895 switch (pnmhdr->code)
2896 {
2897 case NM_CLICK: __fallthrough;
2898 case NM_RETURN:
2899 switch (static_cast<DWORD>(pnmhdr->idFrom))
2900 {
2901 case WIXSTDBA_CONTROL_EULA_LINK:
2902 pBA->OnClickEulaLink();
2903 return 1;
2904 case WIXSTDBA_CONTROL_FAILURE_LOGFILE_LINK:
2905 pBA->OnClickLogFileLink();
2906 return 1;
2907 }
2908 }
2909 }
2910 break;
2911 }
2912
2913 if (pBA && pBA->m_pTaskbarList && uMsg == pBA->m_uTaskbarButtonCreatedMessage)
2914 {
2915 pBA->m_fTaskbarButtonOK = TRUE;
2916 return 0;
2917 }
2918
2919 return CallDefaultWndProc(pBA, hWnd, uMsg, wParam, lParam);
2920 }
2921
2922
2923 //
2924 // OnCreate - finishes loading the theme.
2925 //
2926 BOOL OnCreate(
2927 __in HWND /*hWnd*/
2928 )
2929 {
2930 HRESULT hr = S_OK;
2931 LPWSTR sczLicenseFormatted = NULL;
2932 LPWSTR sczLicensePath = NULL;
2933 LPWSTR sczLicenseDirectory = NULL;
2934 LPWSTR sczLicenseFilename = NULL;
2935 BA_FUNCTIONS_ONTHEMELOADED_ARGS themeLoadedArgs = { };
2936 BA_FUNCTIONS_ONTHEMELOADED_RESULTS themeLoadedResults = { };
2937
2938 hr = ThemeLoadControls(m_pTheme, vrgInitControls, countof(vrgInitControls));
2939 BalExitOnFailure(hr, "Failed to load theme controls.");
2940
2941 C_ASSERT(COUNT_WIXSTDBA_PAGE == countof(vrgwzPageNames));
2942 C_ASSERT(countof(m_rgdwPageIds) == countof(vrgwzPageNames));
2943
2944 ThemeGetPageIds(m_pTheme, vrgwzPageNames, m_rgdwPageIds, countof(m_rgdwPageIds));
2945
2946 // Load the RTF EULA control with text if the control exists.
2947 if (ThemeControlExists(m_pTheme, WIXSTDBA_CONTROL_EULA_RICHEDIT))
2948 {
2949 hr = (m_sczLicenseFile && *m_sczLicenseFile) ? S_OK : E_INVALIDDATA;
2950 if (SUCCEEDED(hr))
2951 {
2952 hr = StrAllocString(&sczLicenseFormatted, m_sczLicenseFile, 0);
2953 if (SUCCEEDED(hr))
2954 {
2955 hr = LocLocalizeString(m_pWixLoc, &sczLicenseFormatted);
2956 if (SUCCEEDED(hr))
2957 {
2958 // Assume there is no hidden variables to be formatted
2959 // so don't worry about securely freeing it.
2960 hr = BalFormatString(sczLicenseFormatted, &sczLicenseFormatted);
2961 if (SUCCEEDED(hr))
2962 {
2963 hr = PathRelativeToModule(&sczLicensePath, sczLicenseFormatted, m_hModule);
2964 if (SUCCEEDED(hr))
2965 {
2966 hr = PathGetDirectory(sczLicensePath, &sczLicenseDirectory);
2967 if (SUCCEEDED(hr))
2968 {
2969 hr = StrAllocString(&sczLicenseFilename, PathFile(sczLicenseFormatted), 0);
2970 if (SUCCEEDED(hr))
2971 {
2972 hr = LocProbeForFile(sczLicenseDirectory, sczLicenseFilename, m_sczLanguage, &sczLicensePath);
2973 if (SUCCEEDED(hr))
2974 {
2975 hr = ThemeLoadRichEditFromFile(m_pTheme, WIXSTDBA_CONTROL_EULA_RICHEDIT, sczLicensePath, m_hModule);
2976 }
2977 }
2978 }
2979 }
2980 }
2981 }
2982 }
2983 }
2984
2985 if (FAILED(hr))
2986 {
2987 BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Failed to load file into license richedit control from path '%ls' manifest value: %ls", sczLicensePath, m_sczLicenseFile);
2988 hr = S_OK;
2989 }
2990 }
2991
2992 if (m_pfnBAFunctionsProc)
2993 {
2994 themeLoadedArgs.cbSize = sizeof(themeLoadedArgs);
2995 themeLoadedArgs.pTheme = m_pTheme;
2996 themeLoadedArgs.pWixLoc = m_pWixLoc;
2997 themeLoadedResults.cbSize = sizeof(themeLoadedResults);
2998 hr = m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONTHEMELOADED, &themeLoadedArgs, &themeLoadedResults, m_pvBAFunctionsProcContext);
2999 BalExitOnFailure(hr, "BAFunctions OnThemeLoaded failed.");
3000 }
3001
3002 LExit:
3003 ReleaseStr(sczLicenseFilename);
3004 ReleaseStr(sczLicenseDirectory);
3005 ReleaseStr(sczLicensePath);
3006 ReleaseStr(sczLicenseFormatted);
3007
3008 return SUCCEEDED(hr);
3009 }
3010
3011
3012 //
3013 // OnShowFailure - display the failure page.
3014 //
3015 void OnShowFailure()
3016 {
3017 SetState(WIXSTDBA_STATE_FAILED, S_OK);
3018
3019 // If the UI should be visible, display it now and hide the splash screen
3020 if (BOOTSTRAPPER_DISPLAY_NONE < m_command.display)
3021 {
3022 ::ShowWindow(m_pTheme->hwndParent, SW_SHOW);
3023 }
3024
3025 m_pEngine->CloseSplashScreen();
3026
3027 return;
3028 }
3029
3030
3031 //
3032 // OnShowHelp - display the help page.
3033 //
3034 void OnShowHelp()
3035 {
3036 SetState(WIXSTDBA_STATE_HELP, S_OK);
3037
3038 // If the UI should be visible, display it now and hide the splash screen
3039 if (BOOTSTRAPPER_DISPLAY_NONE < m_command.display)
3040 {
3041 ::ShowWindow(m_pTheme->hwndParent, SW_SHOW);
3042 }
3043
3044 m_pEngine->CloseSplashScreen();
3045
3046 return;
3047 }
3048
3049
3050 //
3051 // OnDetect - start the processing of packages.
3052 //
3053 void OnDetect()
3054 {
3055 HRESULT hr = S_OK;
3056
3057 SetState(WIXSTDBA_STATE_DETECTING, hr);
3058
3059 // If the UI should be visible, display it now and hide the splash screen
3060 if (BOOTSTRAPPER_DISPLAY_NONE < m_command.display)
3061 {
3062 ::ShowWindow(m_pTheme->hwndParent, SW_SHOW);
3063 }
3064
3065 m_pEngine->CloseSplashScreen();
3066
3067 // Tell the core we're ready for the packages to be processed now.
3068 hr = m_pEngine->Detect();
3069 BalExitOnFailure(hr, "Failed to start detecting chain.");
3070
3071 LExit:
3072 if (FAILED(hr))
3073 {
3074 SetState(WIXSTDBA_STATE_DETECTING, hr);
3075 }
3076
3077 return;
3078 }
3079
3080
3081 //
3082 // OnPlan - plan the detected changes.
3083 //
3084 void OnPlan(
3085 __in BOOTSTRAPPER_ACTION action
3086 )
3087 {
3088 HRESULT hr = S_OK;
3089
3090 m_plannedAction = action;
3091
3092 // If we are going to apply a downgrade, bail.
3093 if (m_fDowngrading && BOOTSTRAPPER_ACTION_UNINSTALL < action)
3094 {
3095 if (m_fSuppressDowngradeFailure)
3096 {
3097 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "A newer version of this product is installed but downgrade failure has been suppressed; continuing...");
3098 }
3099 else
3100 {
3101 hr = HRESULT_FROM_WIN32(ERROR_PRODUCT_VERSION);
3102 BalExitOnFailure(hr, "Cannot install a product when a newer version is installed.");
3103 }
3104 }
3105
3106 SetState(WIXSTDBA_STATE_PLANNING, hr);
3107
3108 hr = m_pEngine->Plan(action);
3109 BalExitOnFailure(hr, "Failed to start planning packages.");
3110
3111 LExit:
3112 if (FAILED(hr))
3113 {
3114 SetState(WIXSTDBA_STATE_PLANNING, hr);
3115 }
3116
3117 return;
3118 }
3119
3120
3121 //
3122 // OnApply - apply the packages.
3123 //
3124 void OnApply()
3125 {
3126 HRESULT hr = S_OK;
3127
3128 SetState(WIXSTDBA_STATE_APPLYING, hr);
3129 SetProgressState(hr);
3130 SetTaskbarButtonProgress(0);
3131
3132 hr = m_pEngine->Apply(m_hWnd);
3133 BalExitOnFailure(hr, "Failed to start applying packages.");
3134
3135 ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_PROGRESS_CANCEL_BUTTON, TRUE); // ensure the cancel button is enabled before starting.
3136
3137 LExit:
3138 if (FAILED(hr))
3139 {
3140 SetState(WIXSTDBA_STATE_APPLYING, hr);
3141 }
3142
3143 return;
3144 }
3145
3146
3147 //
3148 // OnChangeState - change state.
3149 //
3150 void OnChangeState(
3151 __in WIXSTDBA_STATE state
3152 )
3153 {
3154 WIXSTDBA_STATE stateOld = m_state;
3155 DWORD dwOldPageId = 0;
3156 DWORD dwNewPageId = 0;
3157 LPWSTR sczText = NULL;
3158 LPWSTR sczUnformattedText = NULL;
3159 LPWSTR sczControlState = NULL;
3160 LPWSTR sczControlName = NULL;
3161
3162 m_state = state;
3163
3164 // If our install is at the end (success or failure) and we're not showing full UI or
3165 // we successfully installed the prerequisite then exit (prompt for restart if required).
3166 if ((WIXSTDBA_STATE_APPLIED <= m_state && BOOTSTRAPPER_DISPLAY_FULL > m_command.display) ||
3167 (WIXSTDBA_STATE_APPLIED == m_state && m_fPrereq))
3168 {
3169 // If a restart was required but we were not automatically allowed to
3170 // accept the reboot then do the prompt.
3171 if (m_fRestartRequired && !m_fAllowRestart)
3172 {
3173 StrAllocFromError(&sczUnformattedText, HRESULT_FROM_WIN32(ERROR_SUCCESS_REBOOT_REQUIRED), NULL);
3174
3175 int nResult = ::MessageBoxW(m_hWnd, sczUnformattedText ? sczUnformattedText : L"The requested operation is successful. Changes will not be effective until the system is rebooted.", m_pTheme->sczCaption, MB_ICONEXCLAMATION | MB_OKCANCEL);
3176 m_fAllowRestart = (IDOK == nResult);
3177 }
3178
3179 // Quietly exit.
3180 ::PostMessageW(m_hWnd, WM_CLOSE, 0, 0);
3181 }
3182 else // try to change the pages.
3183 {
3184 DeterminePageId(stateOld, &dwOldPageId);
3185 DeterminePageId(m_state, &dwNewPageId);
3186
3187 if (dwOldPageId != dwNewPageId)
3188 {
3189 // Enable disable controls per-page.
3190 if (m_rgdwPageIds[WIXSTDBA_PAGE_INSTALL] == dwNewPageId) // on the "Install" page, ensure the install button is enabled/disabled correctly.
3191 {
3192 LONGLONG llElevated = 0;
3193 if (m_Bundle.fPerMachine)
3194 {
3195 BalGetNumericVariable(WIXBUNDLE_VARIABLE_ELEVATED, &llElevated);
3196 }
3197 ThemeControlElevates(m_pTheme, WIXSTDBA_CONTROL_INSTALL_BUTTON, (m_Bundle.fPerMachine && !llElevated));
3198
3199 // If the EULA control exists, show it only if a license URL is provided as well.
3200 if (ThemeControlExists(m_pTheme, WIXSTDBA_CONTROL_EULA_LINK))
3201 {
3202 BOOL fEulaLink = (m_sczLicenseUrl && *m_sczLicenseUrl);
3203 ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_EULA_LINK, fEulaLink);
3204 ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_EULA_ACCEPT_CHECKBOX, fEulaLink);
3205 }
3206
3207 BOOL fAcceptedLicense = !ThemeControlExists(m_pTheme, WIXSTDBA_CONTROL_EULA_ACCEPT_CHECKBOX) || !ThemeControlEnabled(m_pTheme, WIXSTDBA_CONTROL_EULA_ACCEPT_CHECKBOX) || ThemeIsControlChecked(m_pTheme, WIXSTDBA_CONTROL_EULA_ACCEPT_CHECKBOX);
3208 ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_INSTALL_BUTTON, fAcceptedLicense);
3209 }
3210 else if (m_rgdwPageIds[WIXSTDBA_PAGE_MODIFY] == dwNewPageId)
3211 {
3212 ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_REPAIR_BUTTON, !m_fSuppressRepair);
3213 }
3214 else if (m_rgdwPageIds[WIXSTDBA_PAGE_SUCCESS] == dwNewPageId) // on the "Success" page, check if the restart or launch button should be enabled.
3215 {
3216 BOOL fShowRestartButton = FALSE;
3217 BOOL fLaunchTargetExists = FALSE;
3218 if (m_fRestartRequired)
3219 {
3220 if (BOOTSTRAPPER_RESTART_PROMPT == m_command.restart)
3221 {
3222 fShowRestartButton = TRUE;
3223 }
3224 }
3225 else if (ThemeControlExists(m_pTheme, WIXSTDBA_CONTROL_LAUNCH_BUTTON))
3226 {
3227 fLaunchTargetExists = BalVariableExists(WIXSTDBA_VARIABLE_LAUNCH_TARGET_PATH);
3228 }
3229
3230 ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_LAUNCH_BUTTON, fLaunchTargetExists && BOOTSTRAPPER_ACTION_UNINSTALL < m_plannedAction);
3231 ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_SUCCESS_RESTART_BUTTON, fShowRestartButton);
3232 }
3233 else if (m_rgdwPageIds[WIXSTDBA_PAGE_FAILURE] == dwNewPageId) // on the "Failure" page, show error message and check if the restart button should be enabled.
3234 {
3235 BOOL fShowLogLink = (m_Bundle.sczLogVariable && *m_Bundle.sczLogVariable); // if there is a log file variable then we'll assume the log file exists.
3236 BOOL fShowErrorMessage = FALSE;
3237 BOOL fShowRestartButton = FALSE;
3238
3239 if (FAILED(m_hrFinal))
3240 {
3241 // If we know the failure message, use that.
3242 if (m_sczFailedMessage && *m_sczFailedMessage)
3243 {
3244 StrAllocString(&sczUnformattedText, m_sczFailedMessage, 0);
3245 }
3246 else if (E_MBAHOST_NET452_ON_WIN7RTM == m_hrFinal)
3247 {
3248 HRESULT hr = StrAllocString(&sczUnformattedText, L"#(loc.NET452WIN7RTMErrorMessage)", 0);
3249 if (FAILED(hr))
3250 {
3251 BalLogError(hr, "Failed to initialize NET452WIN7RTMErrorMessage loc identifier.");
3252 }
3253 else
3254 {
3255 hr = LocLocalizeString(m_pWixLoc, &sczUnformattedText);
3256 if (FAILED(hr))
3257 {
3258 BalLogError(hr, "Failed to localize NET452WIN7RTMErrorMessage: %ls", sczUnformattedText);
3259 ReleaseNullStr(sczUnformattedText);
3260 }
3261 }
3262 }
3263 else if (E_DNCHOST_SCD_RUNTIME_FAILURE == m_hrFinal)
3264 {
3265 HRESULT hr = StrAllocString(&sczUnformattedText, L"#(loc.SCDRUNTIMEFAILUREErrorMessage)", 0);
3266 if (FAILED(hr))
3267 {
3268 BalLogError(hr, "Failed to initialize SCDRUNTIMEFAILUREErrorMessage loc identifier.");
3269 }
3270 else
3271 {
3272 hr = LocLocalizeString(m_pWixLoc, &sczUnformattedText);
3273 if (FAILED(hr))
3274 {
3275 BalLogError(hr, "Failed to localize SCDRUNTIMEFAILUREErrorMessage: %ls", sczUnformattedText);
3276 ReleaseNullStr(sczUnformattedText);
3277 }
3278 }
3279 }
3280 else // try to get the error message from the error code.
3281 {
3282 StrAllocFromError(&sczUnformattedText, m_hrFinal, NULL);
3283 if (!sczUnformattedText || !*sczUnformattedText)
3284 {
3285 StrAllocFromError(&sczUnformattedText, E_FAIL, NULL);
3286 }
3287 }
3288
3289 if (E_WIXSTDBA_CONDITION_FAILED == m_hrFinal)
3290 {
3291 if (sczUnformattedText)
3292 {
3293 StrAllocString(&sczText, sczUnformattedText, 0);
3294 }
3295 }
3296 else if (E_MBAHOST_NET452_ON_WIN7RTM == m_hrFinal)
3297 {
3298 if (sczUnformattedText)
3299 {
3300 BalFormatString(sczUnformattedText, &sczText);
3301 }
3302 }
3303 else if (E_DNCHOST_SCD_RUNTIME_FAILURE == m_hrFinal)
3304 {
3305 if (sczUnformattedText)
3306 {
3307 BalFormatString(sczUnformattedText, &sczText);
3308 }
3309 }
3310 else
3311 {
3312 StrAllocFormatted(&sczText, L"0x%08x - %ls", m_hrFinal, sczUnformattedText);
3313 }
3314
3315 ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_FAILURE_MESSAGE_TEXT, sczText);
3316 fShowErrorMessage = TRUE;
3317 }
3318
3319 if (m_fRestartRequired)
3320 {
3321 if (BOOTSTRAPPER_RESTART_PROMPT == m_command.restart)
3322 {
3323 fShowRestartButton = TRUE;
3324 }
3325 }
3326
3327 ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_FAILURE_LOGFILE_LINK, fShowLogLink);
3328 ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_FAILURE_MESSAGE_TEXT, fShowErrorMessage);
3329 ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_FAILURE_RESTART_BUTTON, fShowRestartButton);
3330 }
3331
3332 HRESULT hr = ThemeShowPage(m_pTheme, dwOldPageId, SW_HIDE);
3333 if (FAILED(hr))
3334 {
3335 BalLogError(hr, "Failed to hide page: %u", dwOldPageId);
3336 }
3337
3338 hr = ThemeShowPage(m_pTheme, dwNewPageId, SW_SHOW);
3339 if (FAILED(hr))
3340 {
3341 BalLogError(hr, "Failed to show page: %u", dwOldPageId);
3342 }
3343
3344 // On the install page set the focus to the install button or the next enabled control if install is disabled.
3345 if (m_rgdwPageIds[WIXSTDBA_PAGE_INSTALL] == dwNewPageId)
3346 {
3347 ThemeSetFocus(m_pTheme, WIXSTDBA_CONTROL_INSTALL_BUTTON);
3348 }
3349 }
3350 }
3351
3352 ReleaseStr(sczText);
3353 ReleaseStr(sczUnformattedText);
3354 ReleaseStr(sczControlState);
3355 ReleaseStr(sczControlName);
3356 }
3357
3358
3359 //
3360 // OnClose - called when the window is trying to be closed.
3361 //
3362 BOOL OnClose()
3363 {
3364 BOOL fClose = FALSE;
3365 BOOL fCancel = FALSE;
3366
3367 // If we've already succeeded or failed or showing the help page, just close (prompts are annoying if the bootstrapper is done).
3368 if (WIXSTDBA_STATE_APPLIED <= m_state || WIXSTDBA_STATE_HELP == m_state)
3369 {
3370 fClose = TRUE;
3371 }
3372 else // prompt the user or force the cancel if there is no UI.
3373 {
3374 ::EnterCriticalSection(&m_csShowingInternalUiThisPackage);
3375 fClose = PromptCancel(
3376 m_hWnd,
3377 BOOTSTRAPPER_DISPLAY_FULL != m_command.display || m_fShowingInternalUiThisPackage,
3378 m_sczConfirmCloseMessage ? m_sczConfirmCloseMessage : L"Are you sure you want to cancel?",
3379 m_pTheme->sczCaption);
3380 ::LeaveCriticalSection(&m_csShowingInternalUiThisPackage);
3381
3382 fCancel = fClose;
3383 }
3384
3385 // If we're doing progress then we never close, we just cancel to let rollback occur.
3386 if (WIXSTDBA_STATE_APPLYING <= m_state && WIXSTDBA_STATE_APPLIED > m_state)
3387 {
3388 // If we canceled, disable cancel button since clicking it again is silly.
3389 if (fClose)
3390 {
3391 ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_PROGRESS_CANCEL_BUTTON, FALSE);
3392 }
3393
3394 fClose = FALSE;
3395 }
3396
3397 if (fClose)
3398 {
3399 DWORD dwCurrentPageId = 0;
3400 DeterminePageId(m_state, &dwCurrentPageId);
3401
3402 // Hide the current page to let thmutil do its thing with variables.
3403 ThemeShowPageEx(m_pTheme, dwCurrentPageId, SW_HIDE, fCancel ? THEME_SHOW_PAGE_REASON_CANCEL : THEME_SHOW_PAGE_REASON_DEFAULT);
3404 }
3405
3406 return fClose;
3407 }
3408
3409
3410 //
3411 // OnClickAcceptCheckbox - allow the install to continue.
3412 //
3413 void OnClickAcceptCheckbox()
3414 {
3415 BOOL fAcceptedLicense = ThemeIsControlChecked(m_pTheme, WIXSTDBA_CONTROL_EULA_ACCEPT_CHECKBOX);
3416 ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_INSTALL_BUTTON, fAcceptedLicense);
3417 }
3418
3419
3420 //
3421 // OnClickInstallButton - start the install by planning the packages.
3422 //
3423 void OnClickInstallButton()
3424 {
3425 this->OnPlan(BOOTSTRAPPER_ACTION_INSTALL);
3426 }
3427
3428
3429 //
3430 // OnClickRepairButton - start the repair.
3431 //
3432 void OnClickRepairButton()
3433 {
3434 this->OnPlan(BOOTSTRAPPER_ACTION_REPAIR);
3435 }
3436
3437
3438 //
3439 // OnClickUninstallButton - start the uninstall.
3440 //
3441 void OnClickUninstallButton()
3442 {
3443 this->OnPlan(BOOTSTRAPPER_ACTION_UNINSTALL);
3444 }
3445
3446
3447 //
3448 // OnClickCloseButton - close the application.
3449 //
3450 void OnClickCloseButton()
3451 {
3452 ::SendMessageW(m_hWnd, WM_CLOSE, 0, 0);
3453 }
3454
3455
3456 //
3457 // OnClickEulaLink - show the end user license agreement.
3458 //
3459 void OnClickEulaLink()
3460 {
3461 HRESULT hr = S_OK;
3462 LPWSTR sczLicenseUrl = NULL;
3463 LPWSTR sczLicensePath = NULL;
3464 LPWSTR sczLicenseDirectory = NULL;
3465 LPWSTR sczLicenseFilename = NULL;
3466 URI_PROTOCOL protocol = URI_PROTOCOL_UNKNOWN;
3467
3468 hr = StrAllocString(&sczLicenseUrl, m_sczLicenseUrl, 0);
3469 BalExitOnFailure(hr, "Failed to copy license URL: %ls", m_sczLicenseUrl);
3470
3471 hr = LocLocalizeString(m_pWixLoc, &sczLicenseUrl);
3472 BalExitOnFailure(hr, "Failed to localize license URL: %ls", m_sczLicenseUrl);
3473
3474 // Assume there is no hidden variables to be formatted
3475 // so don't worry about securely freeing it.
3476 hr = BalFormatString(sczLicenseUrl, &sczLicenseUrl);
3477 BalExitOnFailure(hr, "Failed to get formatted license URL: %ls", m_sczLicenseUrl);
3478
3479 hr = UriProtocol(sczLicenseUrl, &protocol);
3480 if (FAILED(hr) || URI_PROTOCOL_UNKNOWN == protocol)
3481 {
3482 // Probe for localized license file
3483 hr = PathRelativeToModule(&sczLicensePath, sczLicenseUrl, m_hModule);
3484 if (SUCCEEDED(hr))
3485 {
3486 hr = PathGetDirectory(sczLicensePath, &sczLicenseDirectory);
3487 if (SUCCEEDED(hr))
3488 {
3489 hr = LocProbeForFile(sczLicenseDirectory, PathFile(sczLicenseUrl), m_sczLanguage, &sczLicensePath);
3490 }
3491 }
3492 }
3493
3494 hr = ShelExecUnelevated(sczLicensePath ? sczLicensePath : sczLicenseUrl, NULL, L"open", NULL, SW_SHOWDEFAULT);
3495 BalExitOnFailure(hr, "Failed to launch URL to EULA.");
3496
3497 LExit:
3498 ReleaseStr(sczLicensePath);
3499 ReleaseStr(sczLicenseUrl);
3500 ReleaseStr(sczLicenseDirectory);
3501 ReleaseStr(sczLicenseFilename);
3502
3503 return;
3504 }
3505
3506
3507 //
3508 // OnClickLaunchButton - launch the app from the success page.
3509 //
3510 void OnClickLaunchButton()
3511 {
3512 HRESULT hr = S_OK;
3513 LPWSTR sczUnformattedLaunchTarget = NULL;
3514 LPWSTR sczLaunchTarget = NULL;
3515 LPWSTR sczLaunchTargetElevatedId = NULL;
3516 LPWSTR sczUnformattedArguments = NULL;
3517 LPWSTR sczArguments = NULL;
3518 LPWSTR sczUnformattedLaunchFolder = NULL;
3519 LPWSTR sczLaunchFolder = NULL;
3520 int nCmdShow = SW_SHOWNORMAL;
3521
3522 hr = BalGetStringVariable(WIXSTDBA_VARIABLE_LAUNCH_TARGET_PATH, &sczUnformattedLaunchTarget);
3523 BalExitOnFailure(hr, "Failed to get launch target variable '%ls'.", WIXSTDBA_VARIABLE_LAUNCH_TARGET_PATH);
3524
3525 hr = BalFormatString(sczUnformattedLaunchTarget, &sczLaunchTarget);
3526 BalExitOnFailure(hr, "Failed to format launch target variable: %ls", sczUnformattedLaunchTarget);
3527
3528 if (BalVariableExists(WIXSTDBA_VARIABLE_LAUNCH_TARGET_ELEVATED_ID))
3529 {
3530 hr = BalGetStringVariable(WIXSTDBA_VARIABLE_LAUNCH_TARGET_ELEVATED_ID, &sczLaunchTargetElevatedId);
3531 BalExitOnFailure(hr, "Failed to get launch target elevated id '%ls'.", WIXSTDBA_VARIABLE_LAUNCH_TARGET_ELEVATED_ID);
3532 }
3533
3534 if (BalVariableExists(WIXSTDBA_VARIABLE_LAUNCH_ARGUMENTS))
3535 {
3536 hr = BalGetStringVariable(WIXSTDBA_VARIABLE_LAUNCH_ARGUMENTS, &sczUnformattedArguments);
3537 BalExitOnFailure(hr, "Failed to get launch arguments '%ls'.", WIXSTDBA_VARIABLE_LAUNCH_ARGUMENTS);
3538 }
3539
3540 if (BalVariableExists(WIXSTDBA_VARIABLE_LAUNCH_HIDDEN))
3541 {
3542 nCmdShow = SW_HIDE;
3543 }
3544
3545 if (BalVariableExists(WIXSTDBA_VARIABLE_LAUNCH_WORK_FOLDER))
3546 {
3547 hr = BalGetStringVariable(WIXSTDBA_VARIABLE_LAUNCH_WORK_FOLDER, &sczUnformattedLaunchFolder);
3548 BalExitOnFailure(hr, "Failed to get launch working directory variable '%ls'.", WIXSTDBA_VARIABLE_LAUNCH_WORK_FOLDER);
3549 }
3550
3551 if (sczLaunchTargetElevatedId && !m_fTriedToLaunchElevated)
3552 {
3553 m_fTriedToLaunchElevated = TRUE;
3554 hr = m_pEngine->LaunchApprovedExe(m_hWnd, sczLaunchTargetElevatedId, sczUnformattedArguments, 0);
3555 if (FAILED(hr))
3556 {
3557 BalLogError(hr, "Failed to launch elevated target: %ls", sczLaunchTargetElevatedId);
3558
3559 //try with ShelExec next time
3560 OnClickLaunchButton();
3561 }
3562 }
3563 else
3564 {
3565 if (sczUnformattedArguments)
3566 {
3567 hr = BalFormatString(sczUnformattedArguments, &sczArguments);
3568 BalExitOnFailure(hr, "Failed to format launch arguments variable: %ls", sczUnformattedArguments);
3569 }
3570
3571 if (sczUnformattedLaunchFolder)
3572 {
3573 hr = BalFormatString(sczUnformattedLaunchFolder, &sczLaunchFolder);
3574 BalExitOnFailure(hr, "Failed to format launch working directory variable: %ls", sczUnformattedLaunchFolder);
3575 }
3576
3577 hr = ShelExec(sczLaunchTarget, sczArguments, L"open", sczLaunchFolder, nCmdShow, m_hWnd, NULL);
3578 BalExitOnFailure(hr, "Failed to launch target: %ls", sczLaunchTarget);
3579
3580 ::PostMessageW(m_hWnd, WM_CLOSE, 0, 0);
3581 }
3582
3583 LExit:
3584 StrSecureZeroFreeString(sczLaunchFolder);
3585 ReleaseStr(sczUnformattedLaunchFolder);
3586 StrSecureZeroFreeString(sczArguments);
3587 ReleaseStr(sczUnformattedArguments);
3588 ReleaseStr(sczLaunchTargetElevatedId);
3589 StrSecureZeroFreeString(sczLaunchTarget);
3590 ReleaseStr(sczUnformattedLaunchTarget);
3591
3592 return;
3593 }
3594
3595
3596 //
3597 // OnClickRestartButton - allows the restart and closes the app.
3598 //
3599 void OnClickRestartButton()
3600 {
3601 AssertSz(m_fRestartRequired, "Restart must be requested to be able to click on the restart button.");
3602
3603 m_fAllowRestart = TRUE;
3604 ::SendMessageW(m_hWnd, WM_CLOSE, 0, 0);
3605
3606 return;
3607 }
3608
3609
3610 //
3611 // OnClickLogFileLink - show the log file.
3612 //
3613 void OnClickLogFileLink()
3614 {
3615 HRESULT hr = S_OK;
3616 LPWSTR sczLogFile = NULL;
3617
3618 hr = BalGetStringVariable(m_Bundle.sczLogVariable, &sczLogFile);
3619 BalExitOnFailure(hr, "Failed to get log file variable '%ls'.", m_Bundle.sczLogVariable);
3620
3621 hr = ShelExecUnelevated(L"notepad.exe", sczLogFile, L"open", NULL, SW_SHOWDEFAULT);
3622 BalExitOnFailure(hr, "Failed to open log file target: %ls", sczLogFile);
3623
3624 LExit:
3625 ReleaseStr(sczLogFile);
3626
3627 return;
3628 }
3629
3630
3631 //
3632 // SetState
3633 //
3634 void SetState(
3635 __in WIXSTDBA_STATE state,
3636 __in HRESULT hrStatus
3637 )
3638 {
3639 if (FAILED(hrStatus))
3640 {
3641 m_hrFinal = hrStatus;
3642 }
3643
3644 if (FAILED(m_hrFinal))
3645 {
3646 state = WIXSTDBA_STATE_FAILED;
3647 }
3648
3649 if (m_state < state)
3650 {
3651 ::PostMessageW(m_hWnd, WM_WIXSTDBA_CHANGE_STATE, 0, state);
3652 }
3653 }
3654
3655
3656 void DeterminePageId(
3657 __in WIXSTDBA_STATE state,
3658 __out DWORD* pdwPageId
3659 )
3660 {
3661 if (BOOTSTRAPPER_DISPLAY_PASSIVE == m_command.display)
3662 {
3663 switch (state)
3664 {
3665 case WIXSTDBA_STATE_INITIALIZED:
3666 *pdwPageId = BOOTSTRAPPER_ACTION_HELP == m_command.action ? m_rgdwPageIds[WIXSTDBA_PAGE_HELP] : m_rgdwPageIds[WIXSTDBA_PAGE_LOADING];
3667 break;
3668
3669 case WIXSTDBA_STATE_HELP:
3670 *pdwPageId = m_rgdwPageIds[WIXSTDBA_PAGE_HELP];
3671 break;
3672
3673 case WIXSTDBA_STATE_DETECTING:
3674 *pdwPageId = m_rgdwPageIds[WIXSTDBA_PAGE_LOADING] ? m_rgdwPageIds[WIXSTDBA_PAGE_LOADING] : m_rgdwPageIds[WIXSTDBA_PAGE_PROGRESS_PASSIVE] ? m_rgdwPageIds[WIXSTDBA_PAGE_PROGRESS_PASSIVE] : m_rgdwPageIds[WIXSTDBA_PAGE_PROGRESS];
3675 break;
3676
3677 case WIXSTDBA_STATE_DETECTED: __fallthrough;
3678 case WIXSTDBA_STATE_PLANNING: __fallthrough;
3679 case WIXSTDBA_STATE_PLANNED: __fallthrough;
3680 case WIXSTDBA_STATE_APPLYING: __fallthrough;
3681 case WIXSTDBA_STATE_CACHING: __fallthrough;
3682 case WIXSTDBA_STATE_CACHED: __fallthrough;
3683 case WIXSTDBA_STATE_EXECUTING: __fallthrough;
3684 case WIXSTDBA_STATE_EXECUTED:
3685 *pdwPageId = m_rgdwPageIds[WIXSTDBA_PAGE_PROGRESS_PASSIVE] ? m_rgdwPageIds[WIXSTDBA_PAGE_PROGRESS_PASSIVE] : m_rgdwPageIds[WIXSTDBA_PAGE_PROGRESS];
3686 break;
3687
3688 default:
3689 *pdwPageId = 0;
3690 break;
3691 }
3692 }
3693 else if (BOOTSTRAPPER_DISPLAY_FULL == m_command.display)
3694 {
3695 switch (state)
3696 {
3697 case WIXSTDBA_STATE_INITIALIZING:
3698 *pdwPageId = 0;
3699 break;
3700
3701 case WIXSTDBA_STATE_INITIALIZED:
3702 *pdwPageId = BOOTSTRAPPER_ACTION_HELP == m_command.action ? m_rgdwPageIds[WIXSTDBA_PAGE_HELP] : m_rgdwPageIds[WIXSTDBA_PAGE_LOADING];
3703 break;
3704
3705 case WIXSTDBA_STATE_HELP:
3706 *pdwPageId = m_rgdwPageIds[WIXSTDBA_PAGE_HELP];
3707 break;
3708
3709 case WIXSTDBA_STATE_DETECTING:
3710 *pdwPageId = m_rgdwPageIds[WIXSTDBA_PAGE_LOADING];
3711 break;
3712
3713 case WIXSTDBA_STATE_DETECTED:
3714 switch (m_command.action)
3715 {
3716 case BOOTSTRAPPER_ACTION_INSTALL:
3717 *pdwPageId = m_rgdwPageIds[WIXSTDBA_PAGE_INSTALL];
3718 break;
3719
3720 case BOOTSTRAPPER_ACTION_MODIFY: __fallthrough;
3721 case BOOTSTRAPPER_ACTION_REPAIR: __fallthrough;
3722 case BOOTSTRAPPER_ACTION_UNINSTALL:
3723 *pdwPageId = m_rgdwPageIds[WIXSTDBA_PAGE_MODIFY];
3724 break;
3725 }
3726 break;
3727
3728 case WIXSTDBA_STATE_PLANNING: __fallthrough;
3729 case WIXSTDBA_STATE_PLANNED: __fallthrough;
3730 case WIXSTDBA_STATE_APPLYING: __fallthrough;
3731 case WIXSTDBA_STATE_CACHING: __fallthrough;
3732 case WIXSTDBA_STATE_CACHED: __fallthrough;
3733 case WIXSTDBA_STATE_EXECUTING: __fallthrough;
3734 case WIXSTDBA_STATE_EXECUTED:
3735 *pdwPageId = m_rgdwPageIds[WIXSTDBA_PAGE_PROGRESS];
3736 break;
3737
3738 case WIXSTDBA_STATE_APPLIED:
3739 *pdwPageId = m_rgdwPageIds[WIXSTDBA_PAGE_SUCCESS];
3740 break;
3741
3742 case WIXSTDBA_STATE_FAILED:
3743 *pdwPageId = m_rgdwPageIds[WIXSTDBA_PAGE_FAILURE];
3744 break;
3745 }
3746 }
3747 }
3748
3749
3750 HRESULT EvaluateConditions()
3751 {
3752 HRESULT hr = S_OK;
3753 BOOL fResult = FALSE;
3754
3755 for (DWORD i = 0; i < m_Conditions.cConditions; ++i)
3756 {
3757 BAL_CONDITION* pCondition = m_Conditions.rgConditions + i;
3758
3759 hr = BalConditionEvaluate(pCondition, m_pEngine, &fResult, &m_sczFailedMessage);
3760 BalExitOnFailure(hr, "Failed to evaluate condition.");
3761
3762 if (!fResult)
3763 {
3764 hr = E_WIXSTDBA_CONDITION_FAILED;
3765 BalExitOnFailure(hr, "%ls", m_sczFailedMessage);
3766 }
3767 }
3768
3769 ReleaseNullStrSecure(m_sczFailedMessage);
3770
3771 LExit:
3772 return hr;
3773 }
3774
3775 void UpdateCacheProgress(
3776 __in DWORD dwOverallPercentage
3777 )
3778 {
3779 WCHAR wzProgress[5] = { };
3780
3781 ::StringCchPrintfW(wzProgress, countof(wzProgress), L"%u%%", dwOverallPercentage);
3782 ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_CACHE_PROGRESS_TEXT, wzProgress);
3783
3784 ThemeSetProgressControl(m_pTheme, WIXSTDBA_CONTROL_CACHE_PROGRESS_BAR, dwOverallPercentage);
3785
3786 m_dwCalculatedCacheProgress = dwOverallPercentage * WIXSTDBA_ACQUIRE_PERCENTAGE / 100;
3787 ThemeSetProgressControl(m_pTheme, WIXSTDBA_CONTROL_OVERALL_CALCULATED_PROGRESS_BAR, m_dwCalculatedCacheProgress + m_dwCalculatedExecuteProgress);
3788
3789 SetTaskbarButtonProgress(m_dwCalculatedCacheProgress + m_dwCalculatedExecuteProgress);
3790 }
3791
3792
3793 void SetTaskbarButtonProgress(
3794 __in DWORD dwOverallPercentage
3795 )
3796 {
3797 HRESULT hr = S_OK;
3798
3799 if (m_fTaskbarButtonOK)
3800 {
3801 hr = m_pTaskbarList->SetProgressValue(m_hWnd, dwOverallPercentage, 100UL);
3802 BalExitOnFailure(hr, "Failed to set taskbar button progress to: %d%%.", dwOverallPercentage);
3803 }
3804
3805 LExit:
3806 return;
3807 }
3808
3809
3810 void SetTaskbarButtonState(
3811 __in TBPFLAG tbpFlags
3812 )
3813 {
3814 HRESULT hr = S_OK;
3815
3816 if (m_fTaskbarButtonOK)
3817 {
3818 hr = m_pTaskbarList->SetProgressState(m_hWnd, tbpFlags);
3819 BalExitOnFailure(hr, "Failed to set taskbar button state.", tbpFlags);
3820 }
3821
3822 LExit:
3823 return;
3824 }
3825
3826
3827 void SetProgressState(
3828 __in HRESULT hrStatus
3829 )
3830 {
3831 TBPFLAG flag = TBPF_NORMAL;
3832
3833 if (IsCanceled() || HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT) == hrStatus)
3834 {
3835 flag = TBPF_PAUSED;
3836 }
3837 else if (IsRollingBack() || FAILED(hrStatus))
3838 {
3839 flag = TBPF_ERROR;
3840 }
3841
3842 SetTaskbarButtonState(flag);
3843 }
3844
3845
3846 HRESULT LoadBAFunctions(
3847 __in IXMLDOMDocument* pixdManifest
3848 )
3849 {
3850 HRESULT hr = S_OK;
3851 IXMLDOMNode* pBAFunctionsNode = NULL;
3852 IXMLDOMNode* pPayloadNode = NULL;
3853 LPWSTR sczPayloadId = NULL;
3854 LPWSTR sczPayloadXPath = NULL;
3855 LPWSTR sczBafName = NULL;
3856 LPWSTR sczBafPath = NULL;
3857 BA_FUNCTIONS_CREATE_ARGS bafCreateArgs = { };
3858 BA_FUNCTIONS_CREATE_RESULTS bafCreateResults = { };
3859
3860 hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/WixBalBAFunctions", &pBAFunctionsNode);
3861 BalExitOnFailure(hr, "Failed to read WixBalBAFunctions node from BootstrapperApplicationData.xml.");
3862
3863 if (S_FALSE == hr)
3864 {
3865 ExitFunction();
3866 }
3867
3868 hr = XmlGetAttributeEx(pBAFunctionsNode, L"PayloadId", &sczPayloadId);
3869 BalExitOnFailure(hr, "Failed to get BAFunctions PayloadId.");
3870
3871 hr = StrAllocFormatted(&sczPayloadXPath, L"/BootstrapperApplicationData/WixPayloadProperties[@Payload='%ls']", sczPayloadId);
3872 BalExitOnFailure(hr, "Failed to format BAFunctions payload XPath.");
3873
3874 hr = XmlSelectSingleNode(pixdManifest, sczPayloadXPath, &pPayloadNode);
3875 if (S_FALSE == hr)
3876 {
3877 hr = E_NOTFOUND;
3878 }
3879 BalExitOnFailure(hr, "Failed to find WixPayloadProperties node for BAFunctions PayloadId: %ls.", sczPayloadId);
3880
3881 hr = XmlGetAttributeEx(pPayloadNode, L"Name", &sczBafName);
3882 BalExitOnFailure(hr, "Failed to get BAFunctions Name.");
3883
3884 hr = PathRelativeToModule(&sczBafPath, sczBafName, m_hModule);
3885 BalExitOnFailure(hr, "Failed to get path to BAFunctions DLL.");
3886
3887 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: LoadBAFunctions() - BAFunctions DLL %ls", sczBafPath);
3888
3889 m_hBAFModule = ::LoadLibraryExW(sczBafPath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
3890 BalExitOnNullWithLastError(m_hBAFModule, hr, "WIXSTDBA: LoadBAFunctions() - Failed to load DLL %ls", sczBafPath);
3891
3892 PFN_BA_FUNCTIONS_CREATE pfnBAFunctionsCreate = reinterpret_cast<PFN_BA_FUNCTIONS_CREATE>(::GetProcAddress(m_hBAFModule, "BAFunctionsCreate"));
3893 BalExitOnNullWithLastError(pfnBAFunctionsCreate, hr, "Failed to get BAFunctionsCreate entry-point from: %ls", sczBafPath);
3894
3895 bafCreateArgs.cbSize = sizeof(bafCreateArgs);
3896 bafCreateArgs.qwBAFunctionsAPIVersion = MAKEQWORDVERSION(0, 0, 0, 2); // TODO: need to decide whether to keep this, and if so when to update it.
3897 bafCreateArgs.pBootstrapperCreateArgs = &m_createArgs;
3898
3899 bafCreateResults.cbSize = sizeof(bafCreateResults);
3900
3901 hr = pfnBAFunctionsCreate(&bafCreateArgs, &bafCreateResults);
3902 BalExitOnFailure(hr, "Failed to create BAFunctions.");
3903
3904 m_pfnBAFunctionsProc = bafCreateResults.pfnBAFunctionsProc;
3905 m_pvBAFunctionsProcContext = bafCreateResults.pvBAFunctionsProcContext;
3906
3907 LExit:
3908 if (m_hBAFModule && !m_pfnBAFunctionsProc)
3909 {
3910 ::FreeLibrary(m_hBAFModule);
3911 m_hBAFModule = NULL;
3912 }
3913 ReleaseStr(sczBafPath);
3914 ReleaseStr(sczBafName);
3915 ReleaseStr(sczPayloadXPath);
3916 ReleaseStr(sczPayloadId);
3917 ReleaseObject(pBAFunctionsNode);
3918 ReleaseObject(pPayloadNode);
3919
3920 return hr;
3921 }
3922
3923
3924public:
3925 //
3926 // Constructor - initialize member variables.
3927 //
3928 CWixStandardBootstrapperApplication(
3929 __in HMODULE hModule,
3930 __in BOOL fPrereq,
3931 __in HRESULT hrHostInitialization,
3932 __in IBootstrapperEngine* pEngine,
3933 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs
3934 ) : CBalBaseBootstrapperApplication(pEngine, pArgs, 3, 3000)
3935 {
3936 m_hModule = hModule;
3937 memcpy_s(&m_command, sizeof(m_command), pArgs->pCommand, sizeof(BOOTSTRAPPER_COMMAND));
3938 memcpy_s(&m_createArgs, sizeof(m_createArgs), pArgs, sizeof(BOOTSTRAPPER_CREATE_ARGS));
3939 m_createArgs.pCommand = &m_command;
3940
3941 if (fPrereq)
3942 {
3943 // Pre-req BA should only show help or do an install (to launch the Managed BA which can then do the right action).
3944 if (BOOTSTRAPPER_ACTION_HELP != m_command.action)
3945 {
3946 m_command.action = BOOTSTRAPPER_ACTION_INSTALL;
3947 }
3948 }
3949 else // maybe modify the action state if the bundle is or is not already installed.
3950 {
3951 LONGLONG llInstalled = 0;
3952 HRESULT hr = BalGetNumericVariable(L"WixBundleInstalled", &llInstalled);
3953 if (SUCCEEDED(hr) && BOOTSTRAPPER_RESUME_TYPE_REBOOT != m_command.resumeType && 0 < llInstalled && BOOTSTRAPPER_ACTION_INSTALL == m_command.action)
3954 {
3955 m_command.action = BOOTSTRAPPER_ACTION_MODIFY;
3956 }
3957 else if (0 == llInstalled && (BOOTSTRAPPER_ACTION_MODIFY == m_command.action || BOOTSTRAPPER_ACTION_REPAIR == m_command.action))
3958 {
3959 m_command.action = BOOTSTRAPPER_ACTION_INSTALL;
3960 }
3961 }
3962
3963 m_plannedAction = BOOTSTRAPPER_ACTION_UNKNOWN;
3964
3965 // When resuming from restart doing some install-like operation, try to find the package that forced the
3966 // restart. We'll use this information during planning.
3967 m_sczAfterForcedRestartPackage = NULL;
3968
3969 if (BOOTSTRAPPER_RESUME_TYPE_REBOOT == m_command.resumeType && BOOTSTRAPPER_ACTION_UNINSTALL < m_command.action)
3970 {
3971 // Ensure the forced restart package variable is null when it is an empty string.
3972 HRESULT hr = BalGetStringVariable(L"WixBundleForcedRestartPackage", &m_sczAfterForcedRestartPackage);
3973 if (FAILED(hr) || !m_sczAfterForcedRestartPackage || !*m_sczAfterForcedRestartPackage)
3974 {
3975 ReleaseNullStr(m_sczAfterForcedRestartPackage);
3976 }
3977 }
3978
3979 m_pWixLoc = NULL;
3980 memset(&m_Bundle, 0, sizeof(m_Bundle));
3981 memset(&m_Conditions, 0, sizeof(m_Conditions));
3982 m_sczConfirmCloseMessage = NULL;
3983 m_sczFailedMessage = NULL;
3984
3985 m_sczLanguage = NULL;
3986 m_pTheme = NULL;
3987 memset(m_rgdwPageIds, 0, sizeof(m_rgdwPageIds));
3988 m_hUiThread = NULL;
3989 m_fRegistered = FALSE;
3990 m_hWnd = NULL;
3991
3992 m_state = WIXSTDBA_STATE_INITIALIZING;
3993 m_hrFinal = hrHostInitialization;
3994
3995 m_fDowngrading = FALSE;
3996 m_restartResult = BOOTSTRAPPER_APPLY_RESTART_NONE;
3997 m_fRestartRequired = FALSE;
3998 m_fAllowRestart = FALSE;
3999
4000 m_sczLicenseFile = NULL;
4001 m_sczLicenseUrl = NULL;
4002 m_fSuppressDowngradeFailure = FALSE;
4003 m_fSuppressRepair = FALSE;
4004 m_fSupportCacheOnly = FALSE;
4005
4006 m_sdOverridableVariables = NULL;
4007 m_pTaskbarList = NULL;
4008 m_uTaskbarButtonCreatedMessage = UINT_MAX;
4009 m_fTaskbarButtonOK = FALSE;
4010 ::InitializeCriticalSection(&m_csShowingInternalUiThisPackage);
4011 m_fShowingInternalUiThisPackage = FALSE;
4012 m_fTriedToLaunchElevated = FALSE;
4013
4014 m_fPrereq = fPrereq;
4015 m_fPrereqInstalled = FALSE;
4016 m_fPrereqAlreadyInstalled = FALSE;
4017
4018 pEngine->AddRef();
4019 m_pEngine = pEngine;
4020
4021 m_hBAFModule = NULL;
4022 m_pfnBAFunctionsProc = NULL;
4023 m_pvBAFunctionsProcContext = NULL;
4024 }
4025
4026
4027 //
4028 // Destructor - release member variables.
4029 //
4030 ~CWixStandardBootstrapperApplication()
4031 {
4032 AssertSz(!::IsWindow(m_hWnd), "Window should have been destroyed before destructor.");
4033 AssertSz(!m_pTaskbarList, "Taskbar should have been released before destructor.");
4034 AssertSz(!m_pTheme, "Theme should have been released before destructor.");
4035
4036 for (DWORD i = 0; i < m_Bundle.packages.cPackages; ++i)
4037 {
4038 ReleaseMem(m_Bundle.packages.rgPackages[i].pvCustomData);
4039 }
4040
4041 ::DeleteCriticalSection(&m_csShowingInternalUiThisPackage);
4042 ReleaseDict(m_sdOverridableVariables);
4043 ReleaseStr(m_sczFailedMessage);
4044 ReleaseStr(m_sczConfirmCloseMessage);
4045 BalConditionsUninitialize(&m_Conditions);
4046 BalInfoUninitialize(&m_Bundle);
4047 LocFree(m_pWixLoc);
4048
4049 ReleaseStr(m_sczLanguage);
4050 ReleaseStr(m_sczLicenseFile);
4051 ReleaseStr(m_sczLicenseUrl);
4052 ReleaseStr(m_sczAfterForcedRestartPackage);
4053 ReleaseNullObject(m_pEngine);
4054
4055 if (m_hBAFModule)
4056 {
4057 PFN_BA_FUNCTIONS_DESTROY pfnBAFunctionsDestroy = reinterpret_cast<PFN_BA_FUNCTIONS_DESTROY>(::GetProcAddress(m_hBAFModule, "BAFunctionsDestroy"));
4058 if (pfnBAFunctionsDestroy)
4059 {
4060 pfnBAFunctionsDestroy();
4061 }
4062
4063 ::FreeLibrary(m_hBAFModule);
4064 m_hBAFModule = NULL;
4065 }
4066 }
4067
4068private:
4069 HMODULE m_hModule;
4070 BOOTSTRAPPER_CREATE_ARGS m_createArgs;
4071 BOOTSTRAPPER_COMMAND m_command;
4072 IBootstrapperEngine* m_pEngine;
4073 BOOTSTRAPPER_ACTION m_plannedAction;
4074
4075 LPWSTR m_sczAfterForcedRestartPackage;
4076
4077 WIX_LOCALIZATION* m_pWixLoc;
4078 BAL_INFO_BUNDLE m_Bundle;
4079 BAL_CONDITIONS m_Conditions;
4080 LPWSTR m_sczFailedMessage;
4081 LPWSTR m_sczConfirmCloseMessage;
4082
4083 LPWSTR m_sczLanguage;
4084 THEME* m_pTheme;
4085 DWORD m_rgdwPageIds[countof(vrgwzPageNames)];
4086 HANDLE m_hUiThread;
4087 BOOL m_fRegistered;
4088 HWND m_hWnd;
4089
4090 WIXSTDBA_STATE m_state;
4091 HRESULT m_hrFinal;
4092
4093 BOOL m_fStartedExecution;
4094 DWORD m_dwCalculatedCacheProgress;
4095 DWORD m_dwCalculatedExecuteProgress;
4096
4097 BOOL m_fDowngrading;
4098 BOOTSTRAPPER_APPLY_RESTART m_restartResult;
4099 BOOL m_fRestartRequired;
4100 BOOL m_fAllowRestart;
4101
4102 LPWSTR m_sczLicenseFile;
4103 LPWSTR m_sczLicenseUrl;
4104 BOOL m_fSuppressDowngradeFailure;
4105 BOOL m_fSuppressRepair;
4106 BOOL m_fSupportCacheOnly;
4107
4108 STRINGDICT_HANDLE m_sdOverridableVariables;
4109
4110 BOOL m_fPrereq;
4111 BOOL m_fPrereqInstalled;
4112 BOOL m_fPrereqAlreadyInstalled;
4113
4114 ITaskbarList3* m_pTaskbarList;
4115 UINT m_uTaskbarButtonCreatedMessage;
4116 BOOL m_fTaskbarButtonOK;
4117 CRITICAL_SECTION m_csShowingInternalUiThisPackage;
4118 BOOL m_fShowingInternalUiThisPackage;
4119 BOOL m_fTriedToLaunchElevated;
4120
4121 HMODULE m_hBAFModule;
4122 PFN_BA_FUNCTIONS_PROC m_pfnBAFunctionsProc;
4123 LPVOID m_pvBAFunctionsProcContext;
4124};
4125
4126
4127//
4128// CreateBootstrapperApplication - creates a new IBootstrapperApplication object.
4129//
4130HRESULT CreateBootstrapperApplication(
4131 __in HMODULE hModule,
4132 __in BOOL fPrereq,
4133 __in HRESULT hrHostInitialization,
4134 __in IBootstrapperEngine* pEngine,
4135 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
4136 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults,
4137 __out IBootstrapperApplication** ppApplication
4138 )
4139{
4140 HRESULT hr = S_OK;
4141 CWixStandardBootstrapperApplication* pApplication = NULL;
4142
4143 if (BOOTSTRAPPER_DISPLAY_UNKNOWN == pArgs->pCommand->display)
4144 {
4145 BalExitOnFailure(hr = E_INVALIDARG, "Engine requested Unknown display type.");
4146 }
4147
4148 pApplication = new CWixStandardBootstrapperApplication(hModule, fPrereq, hrHostInitialization, pEngine, pArgs);
4149 ExitOnNull(pApplication, hr, E_OUTOFMEMORY, "Failed to create new standard bootstrapper application object.");
4150
4151 pResults->pfnBootstrapperApplicationProc = BalBaseBootstrapperApplicationProc;
4152 pResults->pvBootstrapperApplicationProcContext = pApplication;
4153 *ppApplication = pApplication;
4154 pApplication = NULL;
4155
4156LExit:
4157 ReleaseObject(pApplication);
4158 return hr;
4159}
4160
4161
4162static HRESULT DAPI EvaluateVariableConditionCallback(
4163 __in_z LPCWSTR wzCondition,
4164 __out BOOL* pf,
4165 __in_opt LPVOID /*pvContext*/
4166 )
4167{
4168 return BalEvaluateCondition(wzCondition, pf);
4169}
4170
4171
4172static HRESULT DAPI FormatVariableStringCallback(
4173 __in_z LPCWSTR wzFormat,
4174 __inout LPWSTR* psczOut,
4175 __in_opt LPVOID /*pvContext*/
4176 )
4177{
4178 return BalFormatString(wzFormat, psczOut);
4179}
4180
4181
4182static HRESULT DAPI GetVariableNumericCallback(
4183 __in_z LPCWSTR wzVariable,
4184 __out LONGLONG* pllValue,
4185 __in_opt LPVOID /*pvContext*/
4186 )
4187{
4188 return BalGetNumericVariable(wzVariable, pllValue);
4189}
4190
4191
4192static HRESULT DAPI SetVariableNumericCallback(
4193 __in_z LPCWSTR wzVariable,
4194 __in LONGLONG llValue,
4195 __in_opt LPVOID /*pvContext*/
4196 )
4197{
4198 return BalSetNumericVariable(wzVariable, llValue);
4199}
4200
4201
4202static HRESULT DAPI GetVariableStringCallback(
4203 __in_z LPCWSTR wzVariable,
4204 __inout LPWSTR* psczValue,
4205 __in_opt LPVOID /*pvContext*/
4206 )
4207{
4208 return BalGetStringVariable(wzVariable, psczValue);
4209}
4210
4211
4212static HRESULT DAPI SetVariableStringCallback(
4213 __in_z LPCWSTR wzVariable,
4214 __in_z_opt LPCWSTR wzValue,
4215 __in BOOL fFormatted,
4216 __in_opt LPVOID /*pvContext*/
4217 )
4218{
4219 return BalSetStringVariable(wzVariable, wzValue, fFormatted);
4220}
4221
4222static LPCSTR LoggingRequestStateToString(
4223 __in BOOTSTRAPPER_REQUEST_STATE requestState
4224 )
4225{
4226 switch (requestState)
4227 {
4228 case BOOTSTRAPPER_REQUEST_STATE_NONE:
4229 return "None";
4230 case BOOTSTRAPPER_REQUEST_STATE_FORCE_ABSENT:
4231 return "ForceAbsent";
4232 case BOOTSTRAPPER_REQUEST_STATE_ABSENT:
4233 return "Absent";
4234 case BOOTSTRAPPER_REQUEST_STATE_CACHE:
4235 return "Cache";
4236 case BOOTSTRAPPER_REQUEST_STATE_PRESENT:
4237 return "Present";
4238 case BOOTSTRAPPER_REQUEST_STATE_REPAIR:
4239 return "Repair";
4240 default:
4241 return "Invalid";
4242 }
4243}
4244
4245static LPCSTR LoggingMsiFeatureStateToString(
4246 __in BOOTSTRAPPER_FEATURE_STATE featureState
4247 )
4248{
4249 switch (featureState)
4250 {
4251 case BOOTSTRAPPER_FEATURE_STATE_UNKNOWN:
4252 return "Unknown";
4253 case BOOTSTRAPPER_FEATURE_STATE_ABSENT:
4254 return "Absent";
4255 case BOOTSTRAPPER_FEATURE_STATE_ADVERTISED:
4256 return "Advertised";
4257 case BOOTSTRAPPER_FEATURE_STATE_LOCAL:
4258 return "Local";
4259 case BOOTSTRAPPER_FEATURE_STATE_SOURCE:
4260 return "Source";
4261 default:
4262 return "Invalid";
4263 }
4264}
diff --git a/src/ext/Bal/wixstdba/packages.config b/src/ext/Bal/wixstdba/packages.config
new file mode 100644
index 00000000..071284ac
--- /dev/null
+++ b/src/ext/Bal/wixstdba/packages.config
@@ -0,0 +1,10 @@
1<?xml version="1.0" encoding="utf-8"?>
2<packages>
3 <package id="Microsoft.Build.Tasks.Git" version="1.0.0" targetFramework="native" developmentDependency="true" />
4 <package id="Microsoft.SourceLink.Common" version="1.0.0" targetFramework="native" developmentDependency="true" />
5 <package id="Microsoft.SourceLink.GitHub" version="1.0.0" targetFramework="native" developmentDependency="true" />
6 <package id="Nerdbank.GitVersioning" version="3.3.37" targetFramework="native" developmentDependency="true" />
7 <package id="WixToolset.BalUtil" version="4.0.58" targetFramework="native" />
8 <package id="WixToolset.BootstrapperCore.Native" version="4.0.141" targetFramework="native" />
9 <package id="WixToolset.DUtil" version="4.0.72" targetFramework="native" />
10</packages> \ No newline at end of file
diff --git a/src/ext/Bal/wixstdba/precomp.cpp b/src/ext/Bal/wixstdba/precomp.cpp
new file mode 100644
index 00000000..37664a1c
--- /dev/null
+++ b/src/ext/Bal/wixstdba/precomp.cpp
@@ -0,0 +1,3 @@
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#include "precomp.h"
diff --git a/src/ext/Bal/wixstdba/precomp.h b/src/ext/Bal/wixstdba/precomp.h
new file mode 100644
index 00000000..547183bd
--- /dev/null
+++ b/src/ext/Bal/wixstdba/precomp.h
@@ -0,0 +1,58 @@
1#pragma once
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#include <windows.h>
6
7#pragma warning(push)
8#pragma warning(disable:4458) // declaration of 'xxx' hides class member
9#include <gdiplus.h>
10#pragma warning(pop)
11
12#include <msiquery.h>
13#include <objbase.h>
14#include <shlobj.h>
15#include <shlwapi.h>
16#include <stdlib.h>
17#include <strsafe.h>
18#include <stddef.h>
19
20#include "dutil.h"
21#include "apputil.h"
22#include "memutil.h"
23#include "dictutil.h"
24#include "dirutil.h"
25#include "fileutil.h"
26#include "locutil.h"
27#include "logutil.h"
28#include "pathutil.h"
29#include "resrutil.h"
30#include "shelutil.h"
31#include "strutil.h"
32#include "thmutil.h"
33#include "verutil.h"
34#include "uriutil.h"
35#include "xmlutil.h"
36
37#include "BootstrapperEngine.h"
38#include "BootstrapperApplication.h"
39#include "IBootstrapperEngine.h"
40#include "IBootstrapperApplication.h"
41
42#include "balutil.h"
43#include "balinfo.h"
44#include "balcondition.h"
45
46#include "BAFunctions.h"
47
48#include "wixstdba.messages.h"
49
50HRESULT CreateBootstrapperApplication(
51 __in HMODULE hModule,
52 __in BOOL fPrereq,
53 __in HRESULT hrHostInitialization,
54 __in IBootstrapperEngine* pEngine,
55 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
56 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults,
57 __out IBootstrapperApplication** ppApplication
58 );
diff --git a/src/ext/Bal/wixstdba/resource.h b/src/ext/Bal/wixstdba/resource.h
new file mode 100644
index 00000000..149a8ff4
--- /dev/null
+++ b/src/ext/Bal/wixstdba/resource.h
@@ -0,0 +1,15 @@
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#define IDC_STATIC -1
4
5
6// Next default values for new objects
7//
8#ifdef APSTUDIO_INVOKED
9#ifndef APSTUDIO_READONLY_SYMBOLS
10#define _APS_NEXT_RESOURCE_VALUE 102
11#define _APS_NEXT_COMMAND_VALUE 40001
12#define _APS_NEXT_CONTROL_VALUE 1003
13#define _APS_NEXT_SYMED_VALUE 101
14#endif
15#endif
diff --git a/src/ext/Bal/wixstdba/wixstdba.cpp b/src/ext/Bal/wixstdba/wixstdba.cpp
new file mode 100644
index 00000000..a96f1738
--- /dev/null
+++ b/src/ext/Bal/wixstdba/wixstdba.cpp
@@ -0,0 +1,144 @@
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#include "precomp.h"
4
5static HINSTANCE vhInstance = NULL;
6static IBootstrapperApplication* vpApplication = NULL;
7
8static void CALLBACK WixstdbaTraceError(
9 __in_z LPCSTR szFile,
10 __in int iLine,
11 __in REPORT_LEVEL rl,
12 __in UINT source,
13 __in HRESULT hrError,
14 __in_z __format_string LPCSTR szFormat,
15 __in va_list args
16 );
17
18extern "C" BOOL WINAPI DllMain(
19 IN HINSTANCE hInstance,
20 IN DWORD dwReason,
21 IN LPVOID /* pvReserved */
22 )
23{
24 switch(dwReason)
25 {
26 case DLL_PROCESS_ATTACH:
27 ::DisableThreadLibraryCalls(hInstance);
28 vhInstance = hInstance;
29 break;
30
31 case DLL_PROCESS_DETACH:
32 vhInstance = NULL;
33 break;
34 }
35
36 return TRUE;
37}
38
39
40extern "C" HRESULT WINAPI BootstrapperApplicationCreate(
41 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
42 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
43 )
44{
45 HRESULT hr = S_OK;
46 IBootstrapperEngine* pEngine = NULL;
47
48 DutilInitialize(&WixstdbaTraceError);
49
50 hr = BalInitializeFromCreateArgs(pArgs, &pEngine);
51 ExitOnFailure(hr, "Failed to initialize Bal.");
52
53 hr = CreateBootstrapperApplication(vhInstance, FALSE, S_OK, pEngine, pArgs, pResults, &vpApplication);
54 BalExitOnFailure(hr, "Failed to create bootstrapper application interface.");
55
56LExit:
57 ReleaseObject(pEngine);
58
59 return hr;
60}
61
62
63extern "C" void WINAPI BootstrapperApplicationDestroy()
64{
65 ReleaseNullObject(vpApplication);
66 BalUninitialize();
67 DutilUninitialize();
68}
69
70
71extern "C" HRESULT WINAPI DncPrereqBootstrapperApplicationCreate(
72 __in HRESULT hrHostInitialization,
73 __in IBootstrapperEngine* pEngine,
74 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
75 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
76 )
77{
78 HRESULT hr = S_OK;
79
80 DutilInitialize(&WixstdbaTraceError);
81
82 BalInitialize(pEngine);
83
84 hr = CreateBootstrapperApplication(vhInstance, TRUE, hrHostInitialization, pEngine, pArgs, pResults, &vpApplication);
85 BalExitOnFailure(hr, "Failed to create .NET Core prerequisite bootstrapper application interface.");
86
87LExit:
88 return hr;
89}
90
91
92extern "C" void WINAPI DncPrereqBootstrapperApplicationDestroy()
93{
94 ReleaseNullObject(vpApplication);
95 BalUninitialize();
96 DutilUninitialize();
97}
98
99
100extern "C" HRESULT WINAPI MbaPrereqBootstrapperApplicationCreate(
101 __in HRESULT hrHostInitialization,
102 __in IBootstrapperEngine* pEngine,
103 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
104 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
105 )
106{
107 HRESULT hr = S_OK;
108
109 DutilInitialize(&WixstdbaTraceError);
110
111 BalInitialize(pEngine);
112
113 hr = CreateBootstrapperApplication(vhInstance, TRUE, hrHostInitialization, pEngine, pArgs, pResults, &vpApplication);
114 BalExitOnFailure(hr, "Failed to create managed prerequisite bootstrapper application interface.");
115
116LExit:
117 return hr;
118}
119
120
121extern "C" void WINAPI MbaPrereqBootstrapperApplicationDestroy()
122{
123 ReleaseNullObject(vpApplication);
124 BalUninitialize();
125 DutilUninitialize();
126}
127
128static void CALLBACK WixstdbaTraceError(
129 __in_z LPCSTR /*szFile*/,
130 __in int /*iLine*/,
131 __in REPORT_LEVEL /*rl*/,
132 __in UINT source,
133 __in HRESULT hrError,
134 __in_z __format_string LPCSTR szFormat,
135 __in va_list args
136 )
137{
138 // BalLogError currently uses the Exit... macros,
139 // so if expanding the scope need to ensure this doesn't get called recursively.
140 if (DUTIL_SOURCE_THMUTIL == source)
141 {
142 BalLogErrorArgs(hrError, szFormat, args);
143 }
144}
diff --git a/src/ext/Bal/wixstdba/wixstdba.def b/src/ext/Bal/wixstdba/wixstdba.def
new file mode 100644
index 00000000..ba9980d3
--- /dev/null
+++ b/src/ext/Bal/wixstdba/wixstdba.def
@@ -0,0 +1,10 @@
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
4EXPORTS
5 BootstrapperApplicationCreate
6 BootstrapperApplicationDestroy
7 DncPrereqBootstrapperApplicationCreate
8 DncPrereqBootstrapperApplicationDestroy
9 MbaPrereqBootstrapperApplicationCreate
10 MbaPrereqBootstrapperApplicationDestroy
diff --git a/src/ext/Bal/wixstdba/wixstdba.mc b/src/ext/Bal/wixstdba/wixstdba.mc
new file mode 100644
index 00000000..688b1da1
--- /dev/null
+++ b/src/ext/Bal/wixstdba/wixstdba.mc
@@ -0,0 +1,73 @@
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
4MessageIdTypedef=DWORD
5
6LanguageNames=(English=0x409:MSG00409)
7
8
9; // message definitions
10
11; // MessageId=#
12; // Severity=Success
13; // SymbolicName=MSG_SUCCESS
14; // Language=English
15; // Success %1.
16; // .
17;
18; // MessageId=#
19; // Severity=Warning
20; // SymbolicName=MSG_WARNING
21; // Language=English
22; // Warning %1.
23; // .
24;
25; // MessageId=#
26; // Severity=Error
27; // SymbolicName=MSG_ERROR
28; // Language=English
29; // Error %1.
30; // .
31
32MessageId=1
33Severity=Success
34SymbolicName=MSG_WIXSTDBA_PLANNED_FORWARD_COMPATIBLE_BUNDLE
35Language=English
36WIXSTDBA: Planned forward compatible bundle: %1!ls!, wixstdba requested: %2!hs!, bafunctions requested: %3!hs!
37.
38
39MessageId=2
40Severity=Success
41SymbolicName=MSG_WIXSTDBA_PLANNED_PACKAGE
42Language=English
43WIXSTDBA: Planned package: %1!ls!, wixstdba requested: %2!hs!, bafunctions requested: %3!hs!
44.
45
46MessageId=3
47Severity=Success
48SymbolicName=MSG_WIXSTDBA_PLANNED_RELATED_BUNDLE
49Language=English
50WIXSTDBA: Planned related bundle: %1!ls!, wixstdba requested: %2!hs!, bafunctions requested: %3!hs!
51.
52
53MessageId=5
54Severity=Success
55SymbolicName=MSG_WIXSTDBA_PLANNED_TARGET_MSI_PACKAGE
56Language=English
57WIXSTDBA: Planned target MSI package: %1!ls!, productCode: %2!ls!, wixstdba requested: %3!hs!, bafunctions requested: %4!hs!
58.
59
60MessageId=6
61Severity=Success
62SymbolicName=MSG_WIXSTDBA_PLANNED_MSI_FEATURE
63Language=English
64WIXSTDBA: Planned MSI feature: %2!ls! for %1!ls!, wixstdba requested: %3!hs!, bafunctions requested: %4!hs!
65.
66
67MessageId=7
68Severity=Success
69SymbolicName=MSG_WIXSTDBA_PLANNED_MSI_PACKAGE
70Language=English
71WIXSTDBA: Planned MSI package: %1!ls!, wixstdba requested: actionMsiProperty=%2!d!;uiLevel=%3!d!;disableExternalUiHandler=%4!hs!, bafunctions requested: actionMsiProperty=%5!d!;uiLevel=%6!d!;disableExternalUiHandler=%7!hs!
72.
73
diff --git a/src/ext/Bal/wixstdba/wixstdba.vcxproj b/src/ext/Bal/wixstdba/wixstdba.vcxproj
new file mode 100644
index 00000000..06b1c8d8
--- /dev/null
+++ b/src/ext/Bal/wixstdba/wixstdba.vcxproj
@@ -0,0 +1,101 @@
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 DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 <Import Project="..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" />
6 <Import Project="..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props" Condition="Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" />
7 <Import Project="..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props" Condition="Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" />
8 <Import Project="..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props" Condition="Exists('..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props')" />
9 <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props')" />
10 <Import Project="..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props')" />
11
12 <ItemGroup Label="ProjectConfigurations">
13 <ProjectConfiguration Include="Debug|ARM64">
14 <Configuration>Debug</Configuration>
15 <Platform>ARM64</Platform>
16 </ProjectConfiguration>
17 <ProjectConfiguration Include="Release|ARM64">
18 <Configuration>Release</Configuration>
19 <Platform>ARM64</Platform>
20 </ProjectConfiguration>
21 <ProjectConfiguration Include="Debug|Win32">
22 <Configuration>Debug</Configuration>
23 <Platform>Win32</Platform>
24 </ProjectConfiguration>
25 <ProjectConfiguration Include="Release|Win32">
26 <Configuration>Release</Configuration>
27 <Platform>Win32</Platform>
28 </ProjectConfiguration>
29 <ProjectConfiguration Include="Debug|x64">
30 <Configuration>Debug</Configuration>
31 <Platform>x64</Platform>
32 </ProjectConfiguration>
33 <ProjectConfiguration Include="Release|x64">
34 <Configuration>Release</Configuration>
35 <Platform>x64</Platform>
36 </ProjectConfiguration>
37 </ItemGroup>
38
39 <PropertyGroup Label="Globals">
40 <ProjectGuid>{41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}</ProjectGuid>
41 <ConfigurationType>DynamicLibrary</ConfigurationType>
42 <PlatformToolset>v142</PlatformToolset>
43 <CharacterSet>Unicode</CharacterSet>
44 <TargetName>WixStdBA</TargetName>
45 <ProjectModuleDefinitionFile>wixstdba.def</ProjectModuleDefinitionFile>
46 </PropertyGroup>
47
48 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
49 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
50
51 <PropertyGroup>
52 <ProjectAdditionalLinkLibraries>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;wininet.lib;wixstdba.res</ProjectAdditionalLinkLibraries>
53 </PropertyGroup>
54
55 <ItemGroup>
56 <ClCompile Include="precomp.cpp">
57 <PrecompiledHeader>Create</PrecompiledHeader>
58 </ClCompile>
59 <ClCompile Include="WixStandardBootstrapperApplication.cpp" />
60 <ClCompile Include="wixstdba.cpp" />
61 </ItemGroup>
62 <ItemGroup>
63 <ClInclude Include="precomp.h" />
64 <ClInclude Include="resource.h" />
65 </ItemGroup>
66 <ItemGroup>
67 <None Include="wixstdba.def" />
68 </ItemGroup>
69 <ItemGroup>
70 <None Include="packages.config" />
71 </ItemGroup>
72 <ItemGroup>
73 <CustomBuild Include="wixstdba.mc">
74 <Message>Compiling message file...</Message>
75 <Command>mc.exe -h "$(IntDir)." -r "$(IntDir)." -A -c -z wixstdba.messages "$(InputDir)wixstdba.mc"
76rc.exe -fo "$(OutDir)wixstdba.res" "$(IntDir)wixstdba.messages.rc"</Command>
77 <Outputs>$(IntDir)wixstdba.messages.h;$(IntDir)wixstdba.messages.rc</Outputs>
78 </CustomBuild>
79 </ItemGroup>
80
81 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
82 <Import Project="..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets" Condition="Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets')" />
83 <Import Project="..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets" Condition="Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets')" />
84 <Import Project="..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets" Condition="Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" />
85 <Import Project="..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets')" />
86 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
87 <PropertyGroup>
88 <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
89 </PropertyGroup>
90 <Error Condition="!Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props'))" />
91 <Error Condition="!Exists('..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets'))" />
92 <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props'))" />
93 <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets'))" />
94 <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props'))" />
95 <Error Condition="!Exists('..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets'))" />
96 <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.3.3.37\build\Nerdbank.GitVersioning.targets'))" />
97 <Error Condition="!Exists('..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BalUtil.4.0.58\build\WixToolset.BalUtil.props'))" />
98 <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.141\build\WixToolset.BootstrapperCore.Native.props'))" />
99 <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.72\build\WixToolset.DUtil.props'))" />
100 </Target>
101</Project> \ No newline at end of file