aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.editorconfig37
-rw-r--r--Bal.wixext.sln61
-rw-r--r--appveyor.cmd13
-rw-r--r--appveyor.yml40
-rw-r--r--nuget.config18
-rw-r--r--src/Cpp.Build.props100
-rw-r--r--src/Directory.Build.props26
-rw-r--r--src/Directory.Build.targets48
-rw-r--r--src/FindLocalWix.props8
-rw-r--r--src/mbahost/host.vcxproj51
-rw-r--r--src/mbahost/mbahost.cpp (renamed from src/mbahost/host.cpp)8
-rw-r--r--src/mbahost/mbahost.def (renamed from src/mbahost/host.def)0
-rw-r--r--src/mbahost/mbahost.vcxproj64
-rw-r--r--src/mbahost/packages.config7
-rw-r--r--src/mbahost/precomp.cpp3
-rw-r--r--src/wixext/BalBinder.cs125
-rw-r--r--src/wixext/BalCompiler.cs266
-rw-r--r--src/wixext/BalErrors.cs55
-rw-r--r--src/wixext/BalExtensionData.cs45
-rw-r--r--src/wixext/BalExtensionFactory.cs18
-rw-r--r--src/wixext/BalWarnings.cs31
-rw-r--r--src/wixext/BalWindowsInstallerBackendBinderExtension.cs146
-rw-r--r--src/wixext/Tuples/BalTupleDefinitions.cs55
-rw-r--r--src/wixext/Tuples/WixBalBAFunctionsTuple.cs47
-rw-r--r--src/wixext/Tuples/WixBalConditionTuple.cs55
-rw-r--r--src/wixext/Tuples/WixMbaPrereqInformationTuple.cs63
-rw-r--r--src/wixext/Tuples/WixStdbaOptionsTuple.cs79
-rw-r--r--src/wixext/Tuples/WixStdbaOverridableVariableTuple.cs47
-rw-r--r--src/wixext/WixBalExtension.csproj47
-rw-r--r--src/wixext/WixToolset.Bal.wixext.csproj30
-rw-r--r--src/wixext/WixToolset.Bal.wixext.targets11
-rw-r--r--src/wixext/messages.xml43
-rw-r--r--src/wixlib/BalExtension.wixproj39
-rw-r--r--src/wixlib/bal.wixproj62
-rw-r--r--src/wixlib/packages.config5
-rw-r--r--src/wixstdba/packages.config7
-rw-r--r--src/wixstdba/precomp.cpp3
-rw-r--r--src/wixstdba/precomp.h5
-rw-r--r--src/wixstdba/wixstdba.vcxproj41
-rw-r--r--version.json11
40 files changed, 1329 insertions, 491 deletions
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000..1d72e683
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,37 @@
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\.editorconfig
4# then update all of the repos.
5
6root = true
7
8[*]
9charset = utf-8
10indent_style = space
11indent_size = 4
12trim_trailing_whitespace = true
13
14[*.{cs,vb}]
15dotnet_sort_system_directives_first = true
16
17[*.cs]
18csharp_indent_case_contents = true : error
19csharp_indent_switch_labels = true : error
20csharp_new_line_before_open_brace = all
21csharp_prefer_braces = true : error
22csharp_style_expression_bodied_methods = when_on_single_line : suggestion
23csharp_style_expression_bodied_constructors = when_on_single_line : suggestion
24csharp_style_expression_bodied_operators = when_on_single_line : suggestion
25csharp_style_expression_bodied_properties = when_on_single_line : suggestion
26csharp_style_expression_bodied_indexers = when_on_single_line : suggestion
27csharp_style_expression_bodied_accessors = when_on_single_line : suggestion
28csharp_style_var_elsewhere = true : suggestion
29csharp_style_var_for_built_in_types = true : suggestion
30csharp_style_var_when_type_is_apparent = true : suggestion
31dotnet_style_qualification_for_event = true : error
32dotnet_style_qualification_for_field = true : error
33dotnet_style_qualification_for_method = true : error
34dotnet_style_qualification_for_property = true : error
35
36[*.targets]
37indent_size = 2
diff --git a/Bal.wixext.sln b/Bal.wixext.sln
new file mode 100644
index 00000000..8ec796c3
--- /dev/null
+++ b/Bal.wixext.sln
@@ -0,0 +1,61 @@
1
2Microsoft Visual Studio Solution File, Format Version 12.00
3# Visual Studio 15
4VisualStudioVersion = 15.0.28010.2016
5MinimumVisualStudioVersion = 10.0.40219.1
6Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mbahost", "src\mbahost\mbahost.vcxproj", "{12C87C77-3547-44F8-8134-29BC915CB19D}"
7EndProject
8Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wixstdba", "src\wixstdba\wixstdba.vcxproj", "{41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}"
9EndProject
10Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "bal", "src\wixlib\bal.wixproj", "{3444D952-F21C-496F-AB6B-56435BFD0787}"
11EndProject
12Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Bal.wixext", "src\wixext\WixToolset.Bal.wixext.csproj", "{BF720A63-9D7B-456E-B60C-8122852D9FED}"
13EndProject
14Global
15 GlobalSection(SolutionConfigurationPlatforms) = preSolution
16 Debug|Any CPU = Debug|Any CPU
17 Debug|x86 = Debug|x86
18 Release|Any CPU = Release|Any CPU
19 Release|x86 = Release|x86
20 EndGlobalSection
21 GlobalSection(ProjectConfigurationPlatforms) = postSolution
22 {12C87C77-3547-44F8-8134-29BC915CB19D}.Debug|Any CPU.ActiveCfg = Debug|Win32
23 {12C87C77-3547-44F8-8134-29BC915CB19D}.Debug|Any CPU.Build.0 = Debug|Win32
24 {12C87C77-3547-44F8-8134-29BC915CB19D}.Debug|x86.ActiveCfg = Debug|Win32
25 {12C87C77-3547-44F8-8134-29BC915CB19D}.Debug|x86.Build.0 = Debug|Win32
26 {12C87C77-3547-44F8-8134-29BC915CB19D}.Release|Any CPU.ActiveCfg = Release|Win32
27 {12C87C77-3547-44F8-8134-29BC915CB19D}.Release|Any CPU.Build.0 = Release|Win32
28 {12C87C77-3547-44F8-8134-29BC915CB19D}.Release|x86.ActiveCfg = Release|Win32
29 {12C87C77-3547-44F8-8134-29BC915CB19D}.Release|x86.Build.0 = Release|Win32
30 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Debug|Any CPU.ActiveCfg = Debug|Win32
31 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Debug|Any CPU.Build.0 = Debug|Win32
32 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Debug|x86.ActiveCfg = Debug|Win32
33 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Debug|x86.Build.0 = Debug|Win32
34 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Release|Any CPU.ActiveCfg = Release|Win32
35 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Release|Any CPU.Build.0 = Release|Win32
36 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Release|x86.ActiveCfg = Release|Win32
37 {41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}.Release|x86.Build.0 = Release|Win32
38 {3444D952-F21C-496F-AB6B-56435BFD0787}.Debug|Any CPU.ActiveCfg = Debug|x86
39 {3444D952-F21C-496F-AB6B-56435BFD0787}.Debug|Any CPU.Build.0 = Debug|x86
40 {3444D952-F21C-496F-AB6B-56435BFD0787}.Debug|x86.ActiveCfg = Debug|x86
41 {3444D952-F21C-496F-AB6B-56435BFD0787}.Debug|x86.Build.0 = Debug|x86
42 {3444D952-F21C-496F-AB6B-56435BFD0787}.Release|Any CPU.ActiveCfg = Release|x86
43 {3444D952-F21C-496F-AB6B-56435BFD0787}.Release|Any CPU.Build.0 = Release|x86
44 {3444D952-F21C-496F-AB6B-56435BFD0787}.Release|x86.ActiveCfg = Release|x86
45 {3444D952-F21C-496F-AB6B-56435BFD0787}.Release|x86.Build.0 = Release|x86
46 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Debug|Any CPU.Build.0 = Debug|Any CPU
48 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Debug|x86.ActiveCfg = Debug|Any CPU
49 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Debug|x86.Build.0 = Debug|Any CPU
50 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Release|Any CPU.ActiveCfg = Release|Any CPU
51 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Release|Any CPU.Build.0 = Release|Any CPU
52 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Release|x86.ActiveCfg = Release|Any CPU
53 {BF720A63-9D7B-456E-B60C-8122852D9FED}.Release|x86.Build.0 = Release|Any CPU
54 EndGlobalSection
55 GlobalSection(SolutionProperties) = preSolution
56 HideSolutionNode = FALSE
57 EndGlobalSection
58 GlobalSection(ExtensibilityGlobals) = postSolution
59 SolutionGuid = {74046961-48BF-467A-A6C2-F886C75CE0BE}
60 EndGlobalSection
61EndGlobal
diff --git a/appveyor.cmd b/appveyor.cmd
new file mode 100644
index 00000000..c75d03ea
--- /dev/null
+++ b/appveyor.cmd
@@ -0,0 +1,13 @@
1@setlocal
2@pushd %~dp0
3
4nuget restore
5
6msbuild -p:Configuration=Release -t:Restore
7
8msbuild -p:Configuration=Release
9
10msbuild -p:Configuration=Release -t:Pack src\wixext\WixToolset.Bal.wixext.csproj
11
12@popd
13@endlocal \ No newline at end of file
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 00000000..c1df03cc
--- /dev/null
+++ b/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 2017
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/nuget.config b/nuget.config
new file mode 100644
index 00000000..91504dac
--- /dev/null
+++ b/nuget.config
@@ -0,0 +1,18 @@
1<?xml version="1.0" encoding="utf-8"?>
2<configuration>
3 <packageSources>
4 <clear />
5 <add key="wixtoolset-data" value="https://ci.appveyor.com/nuget/wixtoolset-data" />
6 <add key="wixtoolset-extensibility" value="https://ci.appveyor.com/nuget/wixtoolset-extensibility" />
7 <add key="wixtoolset-core" value="https://ci.appveyor.com/nuget/wixtoolset-core" />
8 <add key="wixtoolset-core-native" value="https://ci.appveyor.com/nuget/wixtoolset-core-native" />
9 <add key="wixtoolset-dtf" value="https://ci.appveyor.com/nuget/wixtoolset-dtf" />
10 <add key="wixtoolset-balutil" value="https://ci.appveyor.com/nuget/wixtoolset-balutil" />
11 <add key="wixtoolset-dutil" value="https://ci.appveyor.com/nuget/wixtoolset-dutil" />
12 <add key="wixtoolset-wcautil" value="https://ci.appveyor.com/nuget/wixtoolset-wcautil" />
13 <add key="wixtoolset-tools" value="https://ci.appveyor.com/nuget/wixtoolset-tools" />
14 <add key="wixbuildtools" value="https://ci.appveyor.com/nuget/wixbuildtools" />
15 <add key="localNuget" value="C:\src\mynewwix4\localNuget" />
16 <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
17 </packageSources>
18</configuration> \ No newline at end of file
diff --git a/src/Cpp.Build.props b/src/Cpp.Build.props
new file mode 100644
index 00000000..296b36ca
--- /dev/null
+++ b/src/Cpp.Build.props
@@ -0,0 +1,100 @@
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 </PropertyGroup>
10
11 <ItemDefinitionGroup>
12 <ClCompile>
13 <DisableSpecificWarnings>$(DisableSpecificCompilerWarnings)</DisableSpecificWarnings>
14 <WarningLevel>Level4</WarningLevel>
15 <AdditionalIncludeDirectories>$(ProjectDir)inc;$(MSBuildProjectDirectory);$(IntDir);$(SqlCESdkIncludePath);$(ProjectAdditionalIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
16 <PreprocessorDefinitions>WIN32;_WINDOWS;_WIN32_MSI=500;_WIN32_WINNT=0x0501;$(ArmPreprocessorDefinitions);$(UnicodePreprocessorDefinitions);_CRT_STDIO_LEGACY_WIDE_SPECIFIERS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
17 <PrecompiledHeader>Use</PrecompiledHeader>
18 <PrecompiledHeaderFile>precomp.h</PrecompiledHeaderFile>
19 <CallingConvention>StdCall</CallingConvention>
20 <TreatWarningAsError>true</TreatWarningAsError>
21 <ExceptionHandling>false</ExceptionHandling>
22 <AdditionalOptions>-YlprecompDefine</AdditionalOptions>
23 <AdditionalOptions Condition=" $(PlatformToolset.StartsWith('v14')) ">/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
24 <MultiProcessorCompilation Condition=" $(NUMBER_OF_PROCESSORS) &gt; 4 ">true</MultiProcessorCompilation>
25 </ClCompile>
26 <ResourceCompile>
27 <PreprocessorDefinitions>$(ArmPreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
28 <AdditionalIncludeDirectories>$(ProjectAdditionalResourceIncludeDirectories);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
29 </ResourceCompile>
30 <Lib>
31 <AdditionalLibraryDirectories>$(OutDir);$(AdditionalMultiTargetLibraryPath);$(ProjectAdditionalLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
32 </Lib>
33 <Link>
34 <SubSystem>$(ProjectSubSystem)</SubSystem>
35 <ModuleDefinitionFile>$(ProjectModuleDefinitionFile)</ModuleDefinitionFile>
36 <NoEntryPoint>$(ResourceOnlyDll)</NoEntryPoint>
37 <GenerateDebugInformation>true</GenerateDebugInformation>
38 <AdditionalDependencies>$(ProjectAdditionalLinkLibraries);advapi32.lib;comdlg32.lib;user32.lib;oleaut32.lib;gdi32.lib;shell32.lib;ole32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
39 <AdditionalLibraryDirectories>$(OutDir);$(AdditionalMultiTargetLibraryPath);$(ArmLibraryDirectories);$(ProjectAdditionalLinkLibraryDirectories);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
40 <AdditionalOptions Condition=" $(PlatformToolset.StartsWith('v14')) ">/IGNORE:4099 %(AdditionalOptions)</AdditionalOptions>
41 </Link>
42 </ItemDefinitionGroup>
43
44 <ItemDefinitionGroup Condition=" '$(Platform)'=='Win32' and '$(PlatformToolset)'!='v100'">
45 <ClCompile>
46 <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
47 </ClCompile>
48 </ItemDefinitionGroup>
49 <ItemDefinitionGroup Condition=" '$(Platform)'=='arm' ">
50 <ClCompile>
51 <CallingConvention>CDecl</CallingConvention>
52 </ClCompile>
53 </ItemDefinitionGroup>
54 <ItemDefinitionGroup Condition=" '$(ConfigurationType)'=='StaticLibrary' ">
55 <ClCompile>
56 <DebugInformationFormat>OldStyle</DebugInformationFormat>
57 <OmitDefaultLibName>true</OmitDefaultLibName>
58 <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
59 </ClCompile>
60 </ItemDefinitionGroup>
61 <ItemDefinitionGroup Condition=" '$(Configuration)'=='Debug' ">
62 <ClCompile>
63 <Optimization>Disabled</Optimization>
64 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
65 <PreprocessorDefinitions>_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
66 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
67 </ClCompile>
68 </ItemDefinitionGroup>
69 <ItemDefinitionGroup Condition=" '$(Configuration)'=='Debug' and '$(CLRSupport)'=='true' ">
70 <ClCompile>
71 <BasicRuntimeChecks></BasicRuntimeChecks>
72 <RuntimeLibrary>MultiThreadedDebugDll</RuntimeLibrary>
73 </ClCompile>
74 </ItemDefinitionGroup>
75 <ItemDefinitionGroup Condition=" '$(Configuration)'=='Release' ">
76 <ClCompile>
77 <Optimization>MinSpace</Optimization>
78 <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
79 <FunctionLevelLinking>true</FunctionLevelLinking>
80 <IntrinsicFunctions>true</IntrinsicFunctions>
81 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
82 </ClCompile>
83 <Link>
84 <EnableCOMDATFolding>true</EnableCOMDATFolding>
85 <OptimizeReferences>true</OptimizeReferences>
86 </Link>
87 </ItemDefinitionGroup>
88 <ItemDefinitionGroup Condition=" '$(Configuration)'=='Release' and '$(CLRSupport)'=='true' ">
89 <ClCompile>
90 <BasicRuntimeChecks></BasicRuntimeChecks>
91 <RuntimeLibrary>MultiThreadedDll</RuntimeLibrary>
92 </ClCompile>
93 </ItemDefinitionGroup>
94 <ItemDefinitionGroup Condition=" '$(CLRSupport)'=='true' ">
95 <Link>
96 <KeyFile>$(LinkKeyFile)</KeyFile>
97 <DelaySign>$(LinkDelaySign)</DelaySign>
98 </Link>
99 </ItemDefinitionGroup>
100</Project>
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
new file mode 100644
index 00000000..e853e22d
--- /dev/null
+++ b/src/Directory.Build.props
@@ -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 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
12 <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName>
13 <BaseOutputPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\))</BaseOutputPath>
14 <BaseIntermediateOutputPath>$(BaseOutputPath)obj\$(ProjectName)\</BaseIntermediateOutputPath>
15 <OutputPath>$(BaseOutputPath)$(Configuration)\</OutputPath>
16
17 <Authors>WiX Toolset Team</Authors>
18 <Company>WiX Toolset</Company>
19 <Copyright>Copyright (c) .NET Foundation and contributors. All rights reserved.</Copyright>
20 <PackageLicenseExpression>MS-RL</PackageLicenseExpression>
21 <Product>WiX Toolset</Product>
22 </PropertyGroup>
23
24 <Import Project="Cpp.Build.props" Condition=" '$(MSBuildProjectExtension)'=='.vcxproj' " />
25 <Import Project="Custom.Build.props" Condition=" Exists('Custom.Build.props') " />
26</Project>
diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets
new file mode 100644
index 00000000..dac7452a
--- /dev/null
+++ b/src/Directory.Build.targets
@@ -0,0 +1,48 @@
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 <ReplacePackageReferences>true</ReplacePackageReferences>
14 <TheSolutionPath Condition=" '$(NCrunch)'=='' ">$(SolutionPath)</TheSolutionPath>
15 <TheSolutionPath Condition=" '$(NCrunch)'=='1' ">$(NCrunchOriginalSolutionPath)</TheSolutionPath>
16 </PropertyGroup>
17
18 <Choose>
19 <When Condition="$(ReplacePackageReferences) AND '$(TheSolutionPath)' != '' AND '$(TheSolutionPath)' != '*undefined*' AND Exists('$(TheSolutionPath)')">
20
21 <PropertyGroup>
22 <SolutionFileContent>$([System.IO.File]::ReadAllText($(TheSolutionPath)))</SolutionFileContent>
23 <SmartSolutionDir>$([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) ))</SmartSolutionDir>
24 <RegexPattern>(?&lt;="[PackageName]", ")(.*)(?=", ")</RegexPattern>
25 </PropertyGroup>
26
27 <ItemGroup>
28 <!-- Keep the identity of the PackageReference -->
29 <SmartPackageReference Include="@(PackageReference)">
30 <PackageName>%(Identity)</PackageName>
31 <InSolution>$(SolutionFileContent.Contains('\%(Identity).csproj'))</InSolution>
32 </SmartPackageReference>
33
34 <!-- Filter them by mapping them to another ItemGroup using the WithMetadataValue item function -->
35 <PackageInSolution Include="@(SmartPackageReference->WithMetadataValue('InSolution', True))">
36 <Pattern>$(RegexPattern.Replace('[PackageName]','%(PackageName)') )</Pattern>
37 <SmartPath>$([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)'))</SmartPath>
38 </PackageInSolution>
39
40 <ProjectReference Include="@(PackageInSolution->'$(SmartSolutionDir)\%(SmartPath)' )"/>
41
42 <!-- Remove the package references that are now referenced as projects -->
43 <PackageReference Remove="@(PackageInSolution->'%(PackageName)' )"/>
44 </ItemGroup>
45
46 </When>
47 </Choose>
48</Project>
diff --git a/src/FindLocalWix.props b/src/FindLocalWix.props
new file mode 100644
index 00000000..a784e352
--- /dev/null
+++ b/src/FindLocalWix.props
@@ -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
4<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 <PropertyGroup>
6 <WixTargetsPath Condition=" '$(Configuration)' == 'Debug' And Exists('$(MSBuildThisFileDirectory)..\..\Tools\README.md') ">$(MSBuildThisFileDirectory)..\..\Tools\build\Debug\net461\wix.targets</WixTargetsPath>
7 </PropertyGroup>
8</Project>
diff --git a/src/mbahost/host.vcxproj b/src/mbahost/host.vcxproj
deleted file mode 100644
index a4c3ea16..00000000
--- a/src/mbahost/host.vcxproj
+++ /dev/null
@@ -1,51 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
5<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
6 <ItemGroup Label="ProjectConfigurations">
7 <ProjectConfiguration Include="Debug|Win32">
8 <Configuration>Debug</Configuration>
9 <Platform>Win32</Platform>
10 </ProjectConfiguration>
11 <ProjectConfiguration Include="Release|Win32">
12 <Configuration>Release</Configuration>
13 <Platform>Win32</Platform>
14 </ProjectConfiguration>
15 </ItemGroup>
16
17 <PropertyGroup Label="Globals">
18 <ProjectGuid>{12C87C77-3547-44F8-8134-29BC915CB19D}</ProjectGuid>
19 <ConfigurationType>DynamicLibrary</ConfigurationType>
20 <CharacterSet>Unicode</CharacterSet>
21 <TargetName>mbahost</TargetName>
22 <ProjectModuleDefinitionFile>host.def</ProjectModuleDefinitionFile>
23 </PropertyGroup>
24
25 <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.props" />
26
27 <PropertyGroup>
28 <ProjectAdditionalIncludeDirectories>$(WixRoot)src\libs\dutil\inc;$(WixRoot)src\burn\inc;$(WixRoot)src\libs\balutil\inc;$(BaseIntermediateOutputPath)\core</ProjectAdditionalIncludeDirectories>
29 <ProjectAdditionalLinkLibraries>dutil.lib;balutil.lib;shlwapi.lib</ProjectAdditionalLinkLibraries>
30 </PropertyGroup>
31
32 <ItemGroup>
33 <ClCompile Include="host.cpp" />
34 </ItemGroup>
35 <ItemGroup>
36 <ClInclude Include="IBootstrapperApplicationFactory.h" />
37 <ClInclude Include="precomp.h" />
38 </ItemGroup>
39 <ItemGroup>
40 <None Include="host.def" />
41 </ItemGroup>
42 <ItemGroup>
43 <ResourceCompile Include="host.rc" />
44 </ItemGroup>
45
46 <ItemGroup>
47 <ProjectReference Include="..\core\core.csproj" />
48 </ItemGroup>
49
50 <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" />
51</Project>
diff --git a/src/mbahost/host.cpp b/src/mbahost/mbahost.cpp
index 694db357..d3737c06 100644
--- a/src/mbahost/host.cpp
+++ b/src/mbahost/mbahost.cpp
@@ -1,7 +1,7 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. 1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2 2
3#include "precomp.h" 3#include "precomp.h"
4#include <BootstrapperCore.h> // includes the generated assembly name macros. 4#include <WixToolset.BootstrapperCore.h> // includes the generated assembly name macros.
5#include "BalBaseBootstrapperApplicationProc.h" 5#include "BalBaseBootstrapperApplicationProc.h"
6 6
7static const DWORD NET452_RELEASE = 379893; 7static const DWORD NET452_RELEASE = 379893;
@@ -185,7 +185,7 @@ static HRESULT GetAppDomain(
185 hr = GetAppBase(&sczAppBase); 185 hr = GetAppBase(&sczAppBase);
186 ExitOnFailure(hr, "Failed to get the host base path."); 186 ExitOnFailure(hr, "Failed to get the host base path.");
187 187
188 hr = PathConcat(sczAppBase, L"BootstrapperCore.config", &sczConfigPath); 188 hr = PathConcat(sczAppBase, L"WixToolset.BootstrapperCore.config", &sczConfigPath);
189 ExitOnFailure(hr, "Failed to get the full path to the application configuration file."); 189 ExitOnFailure(hr, "Failed to get the full path to the application configuration file.");
190 190
191 // Check that the supported framework is installed. 191 // Check that the supported framework is installed.
@@ -554,10 +554,10 @@ static HRESULT CreateManagedBootstrapperApplicationFactory(
554 554
555 ::VariantInit(&vtBAFactory); 555 ::VariantInit(&vtBAFactory);
556 556
557 bstrAssemblyName = ::SysAllocString(MUX_ASSEMBLY_FULL_NAME); 557 bstrAssemblyName = ::SysAllocString(MBA_ASSEMBLY_FULL_NAME);
558 ExitOnNull(bstrAssemblyName, hr, E_OUTOFMEMORY, "Failed to allocate the full assembly name for the bootstrapper application factory."); 558 ExitOnNull(bstrAssemblyName, hr, E_OUTOFMEMORY, "Failed to allocate the full assembly name for the bootstrapper application factory.");
559 559
560 bstrTypeName = ::SysAllocString(L"WixToolset.Bootstrapper.BootstrapperApplicationFactory"); 560 bstrTypeName = ::SysAllocString(L"WixToolset.BootstrapperCore.BootstrapperApplicationFactory");
561 ExitOnNull(bstrTypeName, hr, E_OUTOFMEMORY, "Failed to allocate the full type name for the BA factory."); 561 ExitOnNull(bstrTypeName, hr, E_OUTOFMEMORY, "Failed to allocate the full type name for the BA factory.");
562 562
563 hr = pAppDomain->CreateInstance(bstrAssemblyName, bstrTypeName, &pObj); 563 hr = pAppDomain->CreateInstance(bstrAssemblyName, bstrTypeName, &pObj);
diff --git a/src/mbahost/host.def b/src/mbahost/mbahost.def
index 4488df94..4488df94 100644
--- a/src/mbahost/host.def
+++ b/src/mbahost/mbahost.def
diff --git a/src/mbahost/mbahost.vcxproj b/src/mbahost/mbahost.vcxproj
new file mode 100644
index 00000000..d40333ab
--- /dev/null
+++ b/src/mbahost/mbahost.vcxproj
@@ -0,0 +1,64 @@
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.4\build\WixToolset.BalUtil.props" Condition="Exists('..\..\packages\WixToolset.BalUtil.4.0.4\build\WixToolset.BalUtil.props')" />
6 <Import Project="..\..\packages\WixToolset.BootstrapperCore.4.0.3\build\WixToolset.BootstrapperCore.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.4.0.1\build\WixToolset.BootstrapperCore.props')" />
7 <Import Project="..\..\packages\WixToolset.DUtil.4.0.13\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.13\build\WixToolset.DUtil.props')" />
8
9 <ItemGroup Label="ProjectConfigurations">
10 <ProjectConfiguration Include="Debug|Win32">
11 <Configuration>Debug</Configuration>
12 <Platform>Win32</Platform>
13 </ProjectConfiguration>
14 <ProjectConfiguration Include="Release|Win32">
15 <Configuration>Release</Configuration>
16 <Platform>Win32</Platform>
17 </ProjectConfiguration>
18 </ItemGroup>
19
20 <PropertyGroup Label="Globals">
21 <ProjectGuid>{12C87C77-3547-44F8-8134-29BC915CB19D}</ProjectGuid>
22 <ConfigurationType>DynamicLibrary</ConfigurationType>
23 <PlatformToolset>v141</PlatformToolset>
24 <CharacterSet>Unicode</CharacterSet>
25 <TargetName>mbahost</TargetName>
26 <ProjectModuleDefinitionFile>mbahost.def</ProjectModuleDefinitionFile>
27 </PropertyGroup>
28
29 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
30 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
31
32 <PropertyGroup>
33 <ProjectAdditionalLinkLibraries>shlwapi.lib</ProjectAdditionalLinkLibraries>
34 </PropertyGroup>
35
36 <ItemGroup>
37 <ClCompile Include="mbahost.cpp" />
38 <ClCompile Include="precomp.cpp">
39 <PrecompiledHeader>Create</PrecompiledHeader>
40 </ClCompile>
41 </ItemGroup>
42 <ItemGroup>
43 <ClInclude Include="precomp.h" />
44 </ItemGroup>
45 <ItemGroup>
46 <None Include="mbahost.def" />
47 </ItemGroup>
48
49 <ItemGroup>
50 <None Include="packages.config" />
51 </ItemGroup>
52
53 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
54 <Import Project="..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" />
55 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
56 <PropertyGroup>
57 <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>
58 </PropertyGroup>
59 <Error Condition="!Exists('..\..\packages\WixToolset.BalUtil.4.0.4\build\WixToolset.BalUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BalUtil.4.0.4\build\WixToolset.BalUtil.props'))" />
60 <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.4.0.3\build\WixToolset.BootstrapperCore.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.4.0.3\build\WixToolset.BootstrapperCore.props'))" />
61 <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.13\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.13\build\WixToolset.DUtil.props'))" />
62 <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" />
63 </Target>
64</Project>
diff --git a/src/mbahost/packages.config b/src/mbahost/packages.config
new file mode 100644
index 00000000..41ba2f12
--- /dev/null
+++ b/src/mbahost/packages.config
@@ -0,0 +1,7 @@
1<?xml version="1.0" encoding="utf-8"?>
2<packages>
3 <package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="native" developmentDependency="true" />
4 <package id="WixToolset.BootstrapperCore" version="4.0.3" targetFramework="native" />
5 <package id="WixToolset.BalUtil" version="4.0.4" targetFramework="native" />
6 <package id="WixToolset.DUtil" version="4.0.13" targetFramework="native" />
7</packages> \ No newline at end of file
diff --git a/src/mbahost/precomp.cpp b/src/mbahost/precomp.cpp
new file mode 100644
index 00000000..37664a1c
--- /dev/null
+++ b/src/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/wixext/BalBinder.cs b/src/wixext/BalBinder.cs
deleted file mode 100644
index 30f7ab44..00000000
--- a/src/wixext/BalBinder.cs
+++ /dev/null
@@ -1,125 +0,0 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Extensions
4{
5 using System;
6 using System.Collections.Generic;
7 using System.Linq;
8 using System.Text;
9 using WixToolset;
10 using WixToolset.Data;
11 using WixToolset.Data.Rows;
12 using WixToolset.Extensibility;
13
14 public class BalBinder : BinderExtension
15 {
16 public override void Finish(Output output)
17 {
18 // Only process Bundles.
19 if (OutputType.Bundle != output.Type)
20 {
21 return;
22 }
23
24 Table baTable = output.Tables["WixBootstrapperApplication"];
25 Row baRow = baTable.Rows[0];
26 string baId = (string)baRow[0];
27 if (null == baId)
28 {
29 return;
30 }
31
32 bool isStdBA = baId.StartsWith("WixStandardBootstrapperApplication");
33 bool isMBA = baId.StartsWith("ManagedBootstrapperApplicationHost");
34
35 if (isStdBA || isMBA)
36 {
37 VerifyBAFunctions(output);
38 }
39
40 if (isMBA)
41 {
42 VerifyPrereqPackages(output);
43 }
44 }
45
46 private void VerifyBAFunctions(Output output)
47 {
48 Row baFunctionsRow = null;
49 Table baFunctionsTable = output.Tables["WixBalBAFunctions"];
50 foreach (Row row in baFunctionsTable.RowsAs<Row>())
51 {
52 if (null == baFunctionsRow)
53 {
54 baFunctionsRow = row;
55 }
56 else
57 {
58 this.Core.OnMessage(BalErrors.MultipleBAFunctions(row.SourceLineNumbers));
59 }
60 }
61
62 Table payloadPropertiesTable = output.Tables["WixPayloadProperties"];
63 IEnumerable<WixPayloadPropertiesRow> payloadPropertiesRows = payloadPropertiesTable.RowsAs<WixPayloadPropertiesRow>();
64 if (null == baFunctionsRow)
65 {
66 foreach (WixPayloadPropertiesRow payloadPropertiesRow in payloadPropertiesRows)
67 {
68 // TODO: Make core WiX canonicalize Name (this won't catch '.\bafunctions.dll').
69 if (String.Equals(payloadPropertiesRow.Name, "bafunctions.dll", StringComparison.OrdinalIgnoreCase))
70 {
71 this.Core.OnMessage(BalWarnings.UnmarkedBAFunctionsDLL(payloadPropertiesRow.SourceLineNumbers));
72 }
73 }
74 }
75 else
76 {
77 // TODO: May need to revisit this depending on the outcome of #5273.
78 string payloadId = (string)baFunctionsRow[0];
79 WixPayloadPropertiesRow bundlePayloadRow = payloadPropertiesRows.Single(x => payloadId == x.Id);
80 if (Compiler.BurnUXContainerId != bundlePayloadRow.Container)
81 {
82 this.Core.OnMessage(BalErrors.BAFunctionsPayloadRequiredInUXContainer(baFunctionsRow.SourceLineNumbers));
83 }
84 }
85 }
86
87 private void VerifyPrereqPackages(Output output)
88 {
89 Table prereqInfoTable = output.Tables["WixMbaPrereqInformation"];
90 if (null == prereqInfoTable || prereqInfoTable.Rows.Count == 0)
91 {
92 this.Core.OnMessage(BalErrors.MissingPrereq());
93 return;
94 }
95
96 bool foundLicenseFile = false;
97 bool foundLicenseUrl = false;
98
99 foreach (Row prereqInfoRow in prereqInfoTable.Rows)
100 {
101 if (null != prereqInfoRow[1])
102 {
103 if (foundLicenseFile || foundLicenseUrl)
104 {
105 this.Core.OnMessage(BalErrors.MultiplePrereqLicenses(prereqInfoRow.SourceLineNumbers));
106 return;
107 }
108
109 foundLicenseFile = true;
110 }
111
112 if (null != prereqInfoRow[2])
113 {
114 if (foundLicenseFile || foundLicenseUrl)
115 {
116 this.Core.OnMessage(BalErrors.MultiplePrereqLicenses(prereqInfoRow.SourceLineNumbers));
117 return;
118 }
119
120 foundLicenseUrl = true;
121 }
122 }
123 }
124 }
125}
diff --git a/src/wixext/BalCompiler.cs b/src/wixext/BalCompiler.cs
index 38ca9e3c..5b54ef58 100644
--- a/src/wixext/BalCompiler.cs
+++ b/src/wixext/BalCompiler.cs
@@ -1,21 +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. 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 2
3namespace WixToolset.Extensions 3namespace WixToolset.Bal
4{ 4{
5 using System; 5 using System;
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using System.Xml.Linq; 7 using System.Xml.Linq;
8 using WixToolset.Bal.Tuples;
8 using WixToolset.Data; 9 using WixToolset.Data;
9 using WixToolset.Data.Rows; 10 using WixToolset.Data.Tuples;
10 using WixToolset.Extensibility; 11 using WixToolset.Extensibility;
11 12
12 /// <summary> 13 /// <summary>
13 /// The compiler for the WiX Toolset Bal Extension. 14 /// The compiler for the WiX Toolset Bal Extension.
14 /// </summary> 15 /// </summary>
15 public sealed class BalCompiler : CompilerExtension 16 public sealed class BalCompiler : BaseCompilerExtension
16 { 17 {
17 private SourceLineNumber addedConditionLineNumber; 18 private SourceLineNumber addedConditionLineNumber;
18 private Dictionary<string, Row> prereqInfoRows; 19 private Dictionary<string, WixMbaPrereqInformationTuple> prereqInfoRows;
19 20
20 /// <summary> 21 /// <summary>
21 /// Instantiate a new BalCompiler. 22 /// Instantiate a new BalCompiler.
@@ -23,17 +24,20 @@ namespace WixToolset.Extensions
23 public BalCompiler() 24 public BalCompiler()
24 { 25 {
25 this.addedConditionLineNumber = null; 26 this.addedConditionLineNumber = null;
26 prereqInfoRows = new Dictionary<string, Row>(); 27 this.prereqInfoRows = new Dictionary<string, WixMbaPrereqInformationTuple>();
27 this.Namespace = "http://wixtoolset.org/schemas/v4/wxs/bal";
28 } 28 }
29 29
30 public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/bal";
31
30 /// <summary> 32 /// <summary>
31 /// Processes an element for the Compiler. 33 /// Processes an element for the Compiler.
32 /// </summary> 34 /// </summary>
35 /// <param name="intermediate"></param>
36 /// <param name="section"></param>
33 /// <param name="parentElement">Parent element of element to process.</param> 37 /// <param name="parentElement">Parent element of element to process.</param>
34 /// <param name="element">Element to process.</param> 38 /// <param name="element">Element to process.</param>
35 /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> 39 /// <param name="context">Extra information about the context in which this element is being parsed.</param>
36 public override void ParseElement(XElement parentElement, XElement element, IDictionary<string, string> context) 40 public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context)
37 { 41 {
38 switch (parentElement.Name.LocalName) 42 switch (parentElement.Name.LocalName)
39 { 43 {
@@ -42,10 +46,10 @@ namespace WixToolset.Extensions
42 switch (element.Name.LocalName) 46 switch (element.Name.LocalName)
43 { 47 {
44 case "Condition": 48 case "Condition":
45 this.ParseConditionElement(element); 49 this.ParseConditionElement(intermediate, section, element);
46 break; 50 break;
47 default: 51 default:
48 this.Core.UnexpectedElement(parentElement, element); 52 this.ParseHelper.UnexpectedElement(parentElement, element);
49 break; 53 break;
50 } 54 }
51 break; 55 break;
@@ -53,18 +57,18 @@ namespace WixToolset.Extensions
53 switch (element.Name.LocalName) 57 switch (element.Name.LocalName)
54 { 58 {
55 case "WixStandardBootstrapperApplication": 59 case "WixStandardBootstrapperApplication":
56 this.ParseWixStandardBootstrapperApplicationElement(element); 60 this.ParseWixStandardBootstrapperApplicationElement(intermediate, section, element);
57 break; 61 break;
58 case "WixManagedBootstrapperApplicationHost": 62 case "WixManagedBootstrapperApplicationHost":
59 this.ParseWixManagedBootstrapperApplicationHostElement(element); 63 this.ParseWixManagedBootstrapperApplicationHostElement(intermediate, section, element);
60 break; 64 break;
61 default: 65 default:
62 this.Core.UnexpectedElement(parentElement, element); 66 this.ParseHelper.UnexpectedElement(parentElement, element);
63 break; 67 break;
64 } 68 }
65 break; 69 break;
66 default: 70 default:
67 this.Core.UnexpectedElement(parentElement, element); 71 this.ParseHelper.UnexpectedElement(parentElement, element);
68 break; 72 break;
69 } 73 }
70 } 74 }
@@ -76,10 +80,10 @@ namespace WixToolset.Extensions
76 /// <param name="parentElement">Parent element of element to process.</param> 80 /// <param name="parentElement">Parent element of element to process.</param>
77 /// <param name="attribute">Attribute to process.</param> 81 /// <param name="attribute">Attribute to process.</param>
78 /// <param name="context">Extra information about the context in which this element is being parsed.</param> 82 /// <param name="context">Extra information about the context in which this element is being parsed.</param>
79 public override void ParseAttribute(XElement parentElement, XAttribute attribute, IDictionary<string, string> context) 83 public override void ParseAttribute(Intermediate intermediate, IntermediateSection section, XElement parentElement, XAttribute attribute, IDictionary<string, string> context)
80 { 84 {
81 SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(parentElement); 85 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(parentElement);
82 Row row; 86 WixMbaPrereqInformationTuple prereqInfo;
83 87
84 switch (parentElement.Name.LocalName) 88 switch (parentElement.Name.LocalName)
85 { 89 {
@@ -90,7 +94,7 @@ namespace WixToolset.Extensions
90 string packageId; 94 string packageId;
91 if (!context.TryGetValue("PackageId", out packageId) || String.IsNullOrEmpty(packageId)) 95 if (!context.TryGetValue("PackageId", out packageId) || String.IsNullOrEmpty(packageId))
92 { 96 {
93 this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, parentElement.Name.LocalName, "Id", attribute.Name.LocalName)); 97 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, parentElement.Name.LocalName, "Id", attribute.Name.LocalName));
94 } 98 }
95 else 99 else
96 { 100 {
@@ -98,80 +102,80 @@ namespace WixToolset.Extensions
98 { 102 {
99 case "PrereqLicenseFile": 103 case "PrereqLicenseFile":
100 104
101 if (!prereqInfoRows.TryGetValue(packageId, out row)) 105 if (!this.prereqInfoRows.TryGetValue(packageId, out prereqInfo))
102 { 106 {
103 // at the time the extension attribute is parsed, the compiler might not yet have 107 // at the time the extension attribute is parsed, the compiler might not yet have
104 // parsed the PrereqPackage attribute, so we need to get it directly from the parent element. 108 // parsed the PrereqPackage attribute, so we need to get it directly from the parent element.
105 XAttribute prereqPackage = parentElement.Attribute(this.Namespace + "PrereqPackage"); 109 XAttribute prereqPackage = parentElement.Attribute(this.Namespace + "PrereqPackage");
106 110
107 if (null != prereqPackage && YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, prereqPackage)) 111 if (null != prereqPackage && YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, prereqPackage))
108 { 112 {
109 row = this.Core.CreateRow(sourceLineNumbers, "WixMbaPrereqInformation"); 113 prereqInfo = (WixMbaPrereqInformationTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixMbaPrereqInformation");
110 row[0] = packageId; 114 prereqInfo.PackageId = packageId;
111 115
112 prereqInfoRows.Add(packageId, row); 116 this.prereqInfoRows.Add(packageId, prereqInfo);
113 } 117 }
114 else 118 else
115 { 119 {
116 this.Core.OnMessage(BalErrors.AttributeRequiresPrereqPackage(sourceLineNumbers, parentElement.Name.LocalName, "PrereqLicenseFile")); 120 this.Messaging.Write(BalErrors.AttributeRequiresPrereqPackage(sourceLineNumbers, parentElement.Name.LocalName, "PrereqLicenseFile"));
117 break; 121 break;
118 } 122 }
119 } 123 }
120 124
121 if (null != row[2]) 125 if (null != prereqInfo.LicenseUrl)
122 { 126 {
123 this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, parentElement.Name.LocalName, "PrereqLicenseFile", "PrereqLicenseUrl")); 127 this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, parentElement.Name.LocalName, "PrereqLicenseFile", "PrereqLicenseUrl"));
124 } 128 }
125 else 129 else
126 { 130 {
127 row[1] = this.Core.GetAttributeValue(sourceLineNumbers, attribute); 131 prereqInfo.LicenseFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attribute);
128 } 132 }
129 break; 133 break;
130 case "PrereqLicenseUrl": 134 case "PrereqLicenseUrl":
131 135
132 if (!prereqInfoRows.TryGetValue(packageId, out row)) 136 if (!this.prereqInfoRows.TryGetValue(packageId, out prereqInfo))
133 { 137 {
134 // at the time the extension attribute is parsed, the compiler might not yet have 138 // at the time the extension attribute is parsed, the compiler might not yet have
135 // parsed the PrereqPackage attribute, so we need to get it directly from the parent element. 139 // parsed the PrereqPackage attribute, so we need to get it directly from the parent element.
136 XAttribute prereqPackage = parentElement.Attribute(this.Namespace + "PrereqPackage"); 140 XAttribute prereqPackage = parentElement.Attribute(this.Namespace + "PrereqPackage");
137 141
138 if (null != prereqPackage && YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, prereqPackage)) 142 if (null != prereqPackage && YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, prereqPackage))
139 { 143 {
140 row = this.Core.CreateRow(sourceLineNumbers, "WixMbaPrereqInformation"); 144 prereqInfo = (WixMbaPrereqInformationTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixMbaPrereqInformation");
141 row[0] = packageId; 145 prereqInfo.PackageId = packageId;
142 146
143 prereqInfoRows.Add(packageId, row); 147 this.prereqInfoRows.Add(packageId, prereqInfo);
144 } 148 }
145 else 149 else
146 { 150 {
147 this.Core.OnMessage(BalErrors.AttributeRequiresPrereqPackage(sourceLineNumbers, parentElement.Name.LocalName, "PrereqLicenseUrl")); 151 this.Messaging.Write(BalErrors.AttributeRequiresPrereqPackage(sourceLineNumbers, parentElement.Name.LocalName, "PrereqLicenseUrl"));
148 break; 152 break;
149 } 153 }
150 } 154 }
151 155
152 if (null != row[1]) 156 if (null != prereqInfo.LicenseFile)
153 { 157 {
154 this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, parentElement.Name.LocalName, "PrereqLicenseUrl", "PrereqLicenseFile")); 158 this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, parentElement.Name.LocalName, "PrereqLicenseUrl", "PrereqLicenseFile"));
155 } 159 }
156 else 160 else
157 { 161 {
158 row[2] = this.Core.GetAttributeValue(sourceLineNumbers, attribute); 162 prereqInfo.LicenseUrl = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attribute);
159 } 163 }
160 break; 164 break;
161 case "PrereqPackage": 165 case "PrereqPackage":
162 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attribute)) 166 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attribute))
163 { 167 {
164 if (!prereqInfoRows.TryGetValue(packageId, out row)) 168 if (!this.prereqInfoRows.TryGetValue(packageId, out prereqInfo))
165 { 169 {
166 row = this.Core.CreateRow(sourceLineNumbers, "WixMbaPrereqInformation"); 170 prereqInfo = (WixMbaPrereqInformationTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixMbaPrereqInformation");
167 row[0] = packageId; 171 prereqInfo.PackageId = packageId;
168 172
169 prereqInfoRows.Add(packageId, row); 173 this.prereqInfoRows.Add(packageId, prereqInfo);
170 } 174 }
171 } 175 }
172 break; 176 break;
173 default: 177 default:
174 this.Core.UnexpectedAttribute(parentElement, attribute); 178 this.ParseHelper.UnexpectedAttribute(parentElement, attribute);
175 break; 179 break;
176 } 180 }
177 } 181 }
@@ -180,21 +184,21 @@ namespace WixToolset.Extensions
180 string payloadId; 184 string payloadId;
181 if (!context.TryGetValue("Id", out payloadId) || String.IsNullOrEmpty(payloadId)) 185 if (!context.TryGetValue("Id", out payloadId) || String.IsNullOrEmpty(payloadId))
182 { 186 {
183 this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, parentElement.Name.LocalName, "Id", attribute.Name.LocalName)); 187 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, parentElement.Name.LocalName, "Id", attribute.Name.LocalName));
184 } 188 }
185 else 189 else
186 { 190 {
187 switch (attribute.Name.LocalName) 191 switch (attribute.Name.LocalName)
188 { 192 {
189 case "BAFunctions": 193 case "BAFunctions":
190 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attribute)) 194 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attribute))
191 { 195 {
192 row = this.Core.CreateRow(sourceLineNumbers, "WixBalBAFunctions"); 196 var tuple = (WixBalBAFunctionsTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixBalBAFunctions");
193 row[0] = payloadId; 197 tuple.PayloadId = payloadId;
194 } 198 }
195 break; 199 break;
196 default: 200 default:
197 this.Core.UnexpectedAttribute(parentElement, attribute); 201 this.ParseHelper.UnexpectedAttribute(parentElement, attribute);
198 break; 202 break;
199 } 203 }
200 } 204 }
@@ -205,21 +209,21 @@ namespace WixToolset.Extensions
205 XAttribute variableName = parentElement.Attribute("Name"); 209 XAttribute variableName = parentElement.Attribute("Name");
206 if (null == variableName) 210 if (null == variableName)
207 { 211 {
208 this.Core.OnMessage(WixErrors.ExpectedParentWithAttribute(sourceLineNumbers, "Variable", "Overridable", "Name")); 212 this.Messaging.Write(ErrorMessages.ExpectedParentWithAttribute(sourceLineNumbers, "Variable", "Overridable", "Name"));
209 } 213 }
210 else 214 else
211 { 215 {
212 switch (attribute.Name.LocalName) 216 switch (attribute.Name.LocalName)
213 { 217 {
214 case "Overridable": 218 case "Overridable":
215 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attribute)) 219 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attribute))
216 { 220 {
217 row = this.Core.CreateRow(sourceLineNumbers, "WixStdbaOverridableVariable"); 221 var tuple = (WixStdbaOverridableVariableTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixStdbaOverridableVariable");
218 row[0] = variableName; 222 tuple.Name = variableName.Value;
219 } 223 }
220 break; 224 break;
221 default: 225 default:
222 this.Core.UnexpectedAttribute(parentElement, attribute); 226 this.ParseHelper.UnexpectedAttribute(parentElement, attribute);
223 break; 227 break;
224 } 228 }
225 } 229 }
@@ -231,10 +235,10 @@ namespace WixToolset.Extensions
231 /// Parses a Condition element for Bundles. 235 /// Parses a Condition element for Bundles.
232 /// </summary> 236 /// </summary>
233 /// <param name="node">The element to parse.</param> 237 /// <param name="node">The element to parse.</param>
234 private void ParseConditionElement(XElement node) 238 private void ParseConditionElement(Intermediate intermediate, IntermediateSection section, XElement node)
235 { 239 {
236 SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); 240 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
237 string condition = this.Core.GetConditionInnerText(node); // condition is the inner text of the element. 241 string condition = this.ParseHelper.GetConditionInnerText(node); // condition is the inner text of the element.
238 string message = null; 242 string message = null;
239 243
240 foreach (XAttribute attrib in node.Attributes()) 244 foreach (XAttribute attrib in node.Attributes())
@@ -244,37 +248,37 @@ namespace WixToolset.Extensions
244 switch (attrib.Name.LocalName) 248 switch (attrib.Name.LocalName)
245 { 249 {
246 case "Message": 250 case "Message":
247 message = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 251 message = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
248 break; 252 break;
249 default: 253 default:
250 this.Core.UnexpectedAttribute(node, attrib); 254 this.ParseHelper.UnexpectedAttribute(node, attrib);
251 break; 255 break;
252 } 256 }
253 } 257 }
254 else 258 else
255 { 259 {
256 this.Core.ParseExtensionAttribute(node, attrib); 260 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
257 } 261 }
258 } 262 }
259 263
260 this.Core.ParseForExtensionElements(node); 264 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node);
261 265
262 // Error check the values. 266 // Error check the values.
263 if (String.IsNullOrEmpty(condition)) 267 if (String.IsNullOrEmpty(condition))
264 { 268 {
265 this.Core.OnMessage(WixErrors.ConditionExpected(sourceLineNumbers, node.Name.LocalName)); 269 this.Messaging.Write(ErrorMessages.ConditionExpected(sourceLineNumbers, node.Name.LocalName));
266 } 270 }
267 271
268 if (null == message) 272 if (null == message)
269 { 273 {
270 this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Message")); 274 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Message"));
271 } 275 }
272 276
273 if (!this.Core.EncounteredError) 277 if (!this.Messaging.EncounteredError)
274 { 278 {
275 Row row = this.Core.CreateRow(sourceLineNumbers, "WixBalCondition"); 279 var tuple = (WixBalConditionTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixBalCondition");
276 row[0] = condition; 280 tuple.Condition = condition;
277 row[1] = message; 281 tuple.Message = message;
278 282
279 if (null == this.addedConditionLineNumber) 283 if (null == this.addedConditionLineNumber)
280 { 284 {
@@ -287,9 +291,9 @@ namespace WixToolset.Extensions
287 /// Parses a WixStandardBootstrapperApplication element for Bundles. 291 /// Parses a WixStandardBootstrapperApplication element for Bundles.
288 /// </summary> 292 /// </summary>
289 /// <param name="node">The element to parse.</param> 293 /// <param name="node">The element to parse.</param>
290 private void ParseWixStandardBootstrapperApplicationElement(XElement node) 294 private void ParseWixStandardBootstrapperApplicationElement(Intermediate intermediate, IntermediateSection section, XElement node)
291 { 295 {
292 SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); 296 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
293 string launchTarget = null; 297 string launchTarget = null;
294 string launchTargetElevatedId = null; 298 string launchTargetElevatedId = null;
295 string launchArguments = null; 299 string launchArguments = null;
@@ -314,101 +318,101 @@ namespace WixToolset.Extensions
314 switch (attrib.Name.LocalName) 318 switch (attrib.Name.LocalName)
315 { 319 {
316 case "LaunchTarget": 320 case "LaunchTarget":
317 launchTarget = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 321 launchTarget = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
318 break; 322 break;
319 case "LaunchTargetElevatedId": 323 case "LaunchTargetElevatedId":
320 launchTargetElevatedId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 324 launchTargetElevatedId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
321 break; 325 break;
322 case "LaunchArguments": 326 case "LaunchArguments":
323 launchArguments = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 327 launchArguments = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
324 break; 328 break;
325 case "LaunchHidden": 329 case "LaunchHidden":
326 launchHidden = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 330 launchHidden = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
327 break; 331 break;
328 case "LaunchWorkingFolder": 332 case "LaunchWorkingFolder":
329 launchWorkingDir = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 333 launchWorkingDir = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
330 break; 334 break;
331 case "LicenseFile": 335 case "LicenseFile":
332 licenseFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 336 licenseFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
333 break; 337 break;
334 case "LicenseUrl": 338 case "LicenseUrl":
335 licenseUrl = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); 339 licenseUrl = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty);
336 break; 340 break;
337 case "LogoFile": 341 case "LogoFile":
338 logoFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 342 logoFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
339 break; 343 break;
340 case "LogoSideFile": 344 case "LogoSideFile":
341 logoSideFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 345 logoSideFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
342 break; 346 break;
343 case "ThemeFile": 347 case "ThemeFile":
344 themeFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 348 themeFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
345 break; 349 break;
346 case "LocalizationFile": 350 case "LocalizationFile":
347 localizationFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 351 localizationFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
348 break; 352 break;
349 case "SuppressOptionsUI": 353 case "SuppressOptionsUI":
350 suppressOptionsUI = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 354 suppressOptionsUI = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
351 break; 355 break;
352 case "SuppressDowngradeFailure": 356 case "SuppressDowngradeFailure":
353 suppressDowngradeFailure = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 357 suppressDowngradeFailure = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
354 break; 358 break;
355 case "SuppressRepair": 359 case "SuppressRepair":
356 suppressRepair = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 360 suppressRepair = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
357 break; 361 break;
358 case "ShowVersion": 362 case "ShowVersion":
359 showVersion = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 363 showVersion = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
360 break; 364 break;
361 case "SupportCacheOnly": 365 case "SupportCacheOnly":
362 supportCacheOnly = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); 366 supportCacheOnly = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
363 break; 367 break;
364 default: 368 default:
365 this.Core.UnexpectedAttribute(node, attrib); 369 this.ParseHelper.UnexpectedAttribute(node, attrib);
366 break; 370 break;
367 } 371 }
368 } 372 }
369 else 373 else
370 { 374 {
371 this.Core.ParseExtensionAttribute(node, attrib); 375 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
372 } 376 }
373 } 377 }
374 378
375 this.Core.ParseForExtensionElements(node); 379 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node);
376 380
377 if (String.IsNullOrEmpty(licenseFile) && null == licenseUrl) 381 if (String.IsNullOrEmpty(licenseFile) && null == licenseUrl)
378 { 382 {
379 this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "LicenseFile", "LicenseUrl", true)); 383 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "LicenseFile", "LicenseUrl", true));
380 } 384 }
381 385
382 if (!this.Core.EncounteredError) 386 if (!this.Messaging.EncounteredError)
383 { 387 {
384 if (!String.IsNullOrEmpty(launchTarget)) 388 if (!String.IsNullOrEmpty(launchTarget))
385 { 389 {
386 WixBundleVariableRow row = (WixBundleVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixBundleVariable"); 390 var row = (WixBundleVariableTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixBundleVariable");
387 row.Id = "LaunchTarget"; 391 row.Id = new Identifier("LaunchTarget", AccessModifier.Public);
388 row.Value = launchTarget; 392 row.Value = launchTarget;
389 row.Type = "string"; 393 row.Type = "string";
390 } 394 }
391 395
392 if (!String.IsNullOrEmpty(launchTargetElevatedId)) 396 if (!String.IsNullOrEmpty(launchTargetElevatedId))
393 { 397 {
394 WixBundleVariableRow row = (WixBundleVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixBundleVariable"); 398 var row = (WixBundleVariableTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixBundleVariable");
395 row.Id = "LaunchTargetElevatedId"; 399 row.Id = new Identifier("LaunchTargetElevatedId", AccessModifier.Public);
396 row.Value = launchTargetElevatedId; 400 row.Value = launchTargetElevatedId;
397 row.Type = "string"; 401 row.Type = "string";
398 } 402 }
399 403
400 if (!String.IsNullOrEmpty(launchArguments)) 404 if (!String.IsNullOrEmpty(launchArguments))
401 { 405 {
402 WixBundleVariableRow row = (WixBundleVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixBundleVariable"); 406 var row = (WixBundleVariableTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixBundleVariable");
403 row.Id = "LaunchArguments"; 407 row.Id = new Identifier("LaunchArguments", AccessModifier.Public);
404 row.Value = launchArguments; 408 row.Value = launchArguments;
405 row.Type = "string"; 409 row.Type = "string";
406 } 410 }
407 411
408 if (YesNoType.Yes == launchHidden) 412 if (YesNoType.Yes == launchHidden)
409 { 413 {
410 WixBundleVariableRow row = (WixBundleVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixBundleVariable"); 414 var row = (WixBundleVariableTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixBundleVariable");
411 row.Id = "LaunchHidden"; 415 row.Id = new Identifier("LaunchHidden", AccessModifier.Public);
412 row.Value = "yes"; 416 row.Value = "yes";
413 row.Type = "string"; 417 row.Type = "string";
414 } 418 }
@@ -416,80 +420,80 @@ namespace WixToolset.Extensions
416 420
417 if (!String.IsNullOrEmpty(launchWorkingDir)) 421 if (!String.IsNullOrEmpty(launchWorkingDir))
418 { 422 {
419 WixBundleVariableRow row = (WixBundleVariableRow)this.Core.CreateRow(sourceLineNumbers, "Variable"); 423 var row = (WixBundleVariableTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "Variable");
420 row.Id = "LaunchWorkingFolder"; 424 row.Id = new Identifier("LaunchWorkingFolder", AccessModifier.Public);
421 row.Value = launchWorkingDir; 425 row.Value = launchWorkingDir;
422 row.Type = "string"; 426 row.Type = "string";
423 } 427 }
424 428
425 if (!String.IsNullOrEmpty(licenseFile)) 429 if (!String.IsNullOrEmpty(licenseFile))
426 { 430 {
427 WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); 431 var wixVariableRow = (WixVariableTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixVariable");
428 wixVariableRow.Id = "WixStdbaLicenseRtf"; 432 wixVariableRow.Id = new Identifier("WixStdbaLicenseRtf", AccessModifier.Public);
429 wixVariableRow.Value = licenseFile; 433 wixVariableRow.Value = licenseFile;
430 } 434 }
431 435
432 if (null != licenseUrl) 436 if (null != licenseUrl)
433 { 437 {
434 WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); 438 var wixVariableRow = (WixVariableTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixVariable");
435 wixVariableRow.Id = "WixStdbaLicenseUrl"; 439 wixVariableRow.Id = new Identifier("WixStdbaLicenseUrl", AccessModifier.Public);
436 wixVariableRow.Value = licenseUrl; 440 wixVariableRow.Value = licenseUrl;
437 } 441 }
438 442
439 if (!String.IsNullOrEmpty(logoFile)) 443 if (!String.IsNullOrEmpty(logoFile))
440 { 444 {
441 WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); 445 var wixVariableRow = (WixVariableTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixVariable");
442 wixVariableRow.Id = "WixStdbaLogo"; 446 wixVariableRow.Id = new Identifier("WixStdbaLogo", AccessModifier.Public);
443 wixVariableRow.Value = logoFile; 447 wixVariableRow.Value = logoFile;
444 } 448 }
445 449
446 if (!String.IsNullOrEmpty(logoSideFile)) 450 if (!String.IsNullOrEmpty(logoSideFile))
447 { 451 {
448 WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); 452 var wixVariableRow = (WixVariableTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixVariable");
449 wixVariableRow.Id = "WixStdbaLogoSide"; 453 wixVariableRow.Id = new Identifier("WixStdbaLogoSide", AccessModifier.Public);
450 wixVariableRow.Value = logoSideFile; 454 wixVariableRow.Value = logoSideFile;
451 } 455 }
452 456
453 if (!String.IsNullOrEmpty(themeFile)) 457 if (!String.IsNullOrEmpty(themeFile))
454 { 458 {
455 WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); 459 var wixVariableRow = (WixVariableTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixVariable");
456 wixVariableRow.Id = "WixStdbaThemeXml"; 460 wixVariableRow.Id = new Identifier("WixStdbaThemeXml", AccessModifier.Public);
457 wixVariableRow.Value = themeFile; 461 wixVariableRow.Value = themeFile;
458 } 462 }
459 463
460 if (!String.IsNullOrEmpty(localizationFile)) 464 if (!String.IsNullOrEmpty(localizationFile))
461 { 465 {
462 WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); 466 var wixVariableRow = (WixVariableTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixVariable");
463 wixVariableRow.Id = "WixStdbaThemeWxl"; 467 wixVariableRow.Id = new Identifier("WixStdbaThemeWxl", AccessModifier.Public);
464 wixVariableRow.Value = localizationFile; 468 wixVariableRow.Value = localizationFile;
465 } 469 }
466 470
467 if (YesNoType.Yes == suppressOptionsUI || YesNoType.Yes == suppressDowngradeFailure || YesNoType.Yes == suppressRepair || YesNoType.Yes == showVersion || YesNoType.Yes == supportCacheOnly) 471 if (YesNoType.Yes == suppressOptionsUI || YesNoType.Yes == suppressDowngradeFailure || YesNoType.Yes == suppressRepair || YesNoType.Yes == showVersion || YesNoType.Yes == supportCacheOnly)
468 { 472 {
469 Row row = this.Core.CreateRow(sourceLineNumbers, "WixStdbaOptions"); 473 var tuple = (WixStdbaOptionsTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixStdbaOptions");
470 if (YesNoType.Yes == suppressOptionsUI) 474 if (YesNoType.Yes == suppressOptionsUI)
471 { 475 {
472 row[0] = 1; 476 tuple.SuppressOptionsUI = 1;
473 } 477 }
474 478
475 if (YesNoType.Yes == suppressDowngradeFailure) 479 if (YesNoType.Yes == suppressDowngradeFailure)
476 { 480 {
477 row[1] = 1; 481 tuple.SuppressDowngradeFailure = 1;
478 } 482 }
479 483
480 if (YesNoType.Yes == suppressRepair) 484 if (YesNoType.Yes == suppressRepair)
481 { 485 {
482 row[2] = 1; 486 tuple.SuppressRepair = 1;
483 } 487 }
484 488
485 if (YesNoType.Yes == showVersion) 489 if (YesNoType.Yes == showVersion)
486 { 490 {
487 row[3] = 1; 491 tuple.ShowVersion = 1;
488 } 492 }
489 493
490 if (YesNoType.Yes == supportCacheOnly) 494 if (YesNoType.Yes == supportCacheOnly)
491 { 495 {
492 row[4] = 1; 496 tuple.SupportCacheOnly = 1;
493 } 497 }
494 } 498 }
495 } 499 }
@@ -499,9 +503,9 @@ namespace WixToolset.Extensions
499 /// Parses a WixManagedBootstrapperApplicationHost element for Bundles. 503 /// Parses a WixManagedBootstrapperApplicationHost element for Bundles.
500 /// </summary> 504 /// </summary>
501 /// <param name="node">The element to parse.</param> 505 /// <param name="node">The element to parse.</param>
502 private void ParseWixManagedBootstrapperApplicationHostElement(XElement node) 506 private void ParseWixManagedBootstrapperApplicationHostElement(Intermediate intermediate, IntermediateSection section, XElement node)
503 { 507 {
504 SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); 508 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
505 string logoFile = null; 509 string logoFile = null;
506 string themeFile = null; 510 string themeFile = null;
507 string localizationFile = null; 511 string localizationFile = null;
@@ -513,47 +517,47 @@ namespace WixToolset.Extensions
513 switch (attrib.Name.LocalName) 517 switch (attrib.Name.LocalName)
514 { 518 {
515 case "LogoFile": 519 case "LogoFile":
516 logoFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 520 logoFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
517 break; 521 break;
518 case "ThemeFile": 522 case "ThemeFile":
519 themeFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 523 themeFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
520 break; 524 break;
521 case "LocalizationFile": 525 case "LocalizationFile":
522 localizationFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 526 localizationFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
523 break; 527 break;
524 default: 528 default:
525 this.Core.UnexpectedAttribute(node, attrib); 529 this.ParseHelper.UnexpectedAttribute(node, attrib);
526 break; 530 break;
527 } 531 }
528 } 532 }
529 else 533 else
530 { 534 {
531 this.Core.ParseExtensionAttribute(node, attrib); 535 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
532 } 536 }
533 } 537 }
534 538
535 this.Core.ParseForExtensionElements(node); 539 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node);
536 540
537 if (!this.Core.EncounteredError) 541 if (!this.Messaging.EncounteredError)
538 { 542 {
539 if (!String.IsNullOrEmpty(logoFile)) 543 if (!String.IsNullOrEmpty(logoFile))
540 { 544 {
541 WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); 545 var wixVariableRow = (WixVariableTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixVariable");
542 wixVariableRow.Id = "PreqbaLogo"; 546 wixVariableRow.Id = new Identifier("PreqbaLogo", AccessModifier.Public);
543 wixVariableRow.Value = logoFile; 547 wixVariableRow.Value = logoFile;
544 } 548 }
545 549
546 if (!String.IsNullOrEmpty(themeFile)) 550 if (!String.IsNullOrEmpty(themeFile))
547 { 551 {
548 WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); 552 var wixVariableRow = (WixVariableTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixVariable");
549 wixVariableRow.Id = "PreqbaThemeXml"; 553 wixVariableRow.Id = new Identifier("PreqbaThemeXml", AccessModifier.Public);
550 wixVariableRow.Value = themeFile; 554 wixVariableRow.Value = themeFile;
551 } 555 }
552 556
553 if (!String.IsNullOrEmpty(localizationFile)) 557 if (!String.IsNullOrEmpty(localizationFile))
554 { 558 {
555 WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); 559 var wixVariableRow = (WixVariableTuple)this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixVariable");
556 wixVariableRow.Id = "PreqbaThemeWxl"; 560 wixVariableRow.Id = new Identifier("PreqbaThemeWxl", AccessModifier.Public);
557 wixVariableRow.Value = localizationFile; 561 wixVariableRow.Value = localizationFile;
558 } 562 }
559 } 563 }
diff --git a/src/wixext/BalErrors.cs b/src/wixext/BalErrors.cs
new file mode 100644
index 00000000..5591ae1d
--- /dev/null
+++ b/src/wixext/BalErrors.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 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 MissingPrereq()
22 {
23 return Message(null, Ids.MissingPrereq, "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.");
24 }
25
26 public static Message MultipleBAFunctions(SourceLineNumber sourceLineNumbers)
27 {
28 return Message(sourceLineNumbers, Ids.MultipleBAFunctions, "WixStandardBootstrapperApplication doesn't support multiple BAFunctions DLLs.");
29 }
30
31 public static Message MultiplePrereqLicenses(SourceLineNumber sourceLineNumbers)
32 {
33 return Message(sourceLineNumbers, Ids.MultiplePrereqLicenses, "There may only be one package in the bundle that has either the PrereqLicenseFile attribute or the PrereqLicenseUrl attribute.");
34 }
35
36 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
37 {
38 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args);
39 }
40
41 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args)
42 {
43 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args);
44 }
45
46 public enum Ids
47 {
48 AttributeRequiresPrereqPackage = 6801,
49 MissingPrereq = 6802,
50 MultiplePrereqLicenses = 6803,
51 MultipleBAFunctions = 6804,
52 BAFunctionsPayloadRequiredInUXContainer = 6805,
53 }
54 }
55}
diff --git a/src/wixext/BalExtensionData.cs b/src/wixext/BalExtensionData.cs
index 7e8dea5b..46152b53 100644
--- a/src/wixext/BalExtensionData.cs
+++ b/src/wixext/BalExtensionData.cs
@@ -1,55 +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. 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 2
3namespace WixToolset.Extensions 3namespace WixToolset.Bal
4{ 4{
5 using System;
6 using System.Reflection;
7 using WixToolset.Data; 5 using WixToolset.Data;
8 using WixToolset.Extensibility; 6 using WixToolset.Extensibility;
9 7
10 /// <summary> 8 /// <summary>
11 /// The WiX Toolset Bal Extension. 9 /// The WiX Toolset Bal Extension.
12 /// </summary> 10 /// </summary>
13 public sealed class BalExtensionData : ExtensionData 11 public sealed class BalExtensionData : BaseExtensionData
14 { 12 {
15 /// <summary> 13 /// <summary>
16 /// Gets the optional table definitions for this extension. 14 /// Gets the default culture.
17 /// </summary> 15 /// </summary>
18 /// <value>The optional table definitions for this extension.</value> 16 /// <value>The default culture.</value>
19 public override TableDefinitionCollection TableDefinitions 17 public override string DefaultCulture => "en-US";
20 {
21 get
22 {
23 return BalExtensionData.GetExtensionTableDefinitions();
24 }
25 }
26 18
27 /// <summary> 19 public override bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition)
28 /// Gets the library associated with this extension.
29 /// </summary>
30 /// <param name="tableDefinitions">The table definitions to use while loading the library.</param>
31 /// <returns>The loaded library.</returns>
32 public override Library GetLibrary(TableDefinitionCollection tableDefinitions)
33 { 20 {
34 return BalExtensionData.GetExtensionLibrary(tableDefinitions); 21 tupleDefinition = BalTupleDefinitions.ByName(name);
22 return tupleDefinition != null;
35 } 23 }
36 24
37 /// <summary> 25 public override Intermediate GetLibrary(ITupleDefinitionCreator tupleDefinitions)
38 /// Internal mechanism to access the extension's table definitions.
39 /// </summary>
40 /// <returns>Extension's table definitions.</returns>
41 internal static TableDefinitionCollection GetExtensionTableDefinitions()
42 {
43 return ExtensionData.LoadTableDefinitionHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.tables.xml");
44 }
45
46 /// <summary>
47 /// Internal mechanism to access the extension's library.
48 /// </summary>
49 /// <returns>Extension's library.</returns>
50 internal static Library GetExtensionLibrary(TableDefinitionCollection tableDefinitions)
51 { 26 {
52 return ExtensionData.LoadLibraryHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.bal.wixlib", tableDefinitions); 27 return Intermediate.Load(typeof(BalExtensionData).Assembly, "WixToolset.Bal.bal.wixlib", tupleDefinitions);
53 } 28 }
54 } 29 }
55} 30}
diff --git a/src/wixext/BalExtensionFactory.cs b/src/wixext/BalExtensionFactory.cs
new file mode 100644
index 00000000..936686a6
--- /dev/null
+++ b/src/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 IEnumerable<Type> ExtensionTypes => new[]
12 {
13 typeof(BalCompiler),
14 typeof(BalExtensionData),
15 typeof(BalWindowsInstallerBackendBinderExtension),
16 };
17 }
18}
diff --git a/src/wixext/BalWarnings.cs b/src/wixext/BalWarnings.cs
new file mode 100644
index 00000000..18b25062
--- /dev/null
+++ b/src/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/wixext/BalWindowsInstallerBackendBinderExtension.cs b/src/wixext/BalWindowsInstallerBackendBinderExtension.cs
new file mode 100644
index 00000000..fbda9d1b
--- /dev/null
+++ b/src/wixext/BalWindowsInstallerBackendBinderExtension.cs
@@ -0,0 +1,146 @@
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.Linq;
7 using System.Xml;
8 using WixToolset.Data;
9 using WixToolset.Data.WindowsInstaller;
10 using WixToolset.Data.WindowsInstaller.Rows;
11 using WixToolset.Extensibility;
12 using WixToolset.Extensibility.Data;
13
14 public class BalWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension
15 {
16 // TODO: don't duplicate this from WixToolset.Core.Compiler
17 public const string BurnUXContainerId = "WixUXContainer";
18
19 private static readonly TableDefinition[] Tables = LoadTables();
20
21 protected override TableDefinition[] TableDefinitionsForTuples => Tables;
22
23 private static TableDefinition[] LoadTables()
24 {
25 using (var resourceStream = typeof(BalWindowsInstallerBackendBinderExtension).Assembly.GetManifestResourceStream("WixToolset.Bal.tables.xml"))
26 using (var reader = XmlReader.Create(resourceStream))
27 {
28 var tables = TableDefinitionCollection.Load(reader);
29 return tables.ToArray();
30 }
31 }
32
33 public override void PostBackendBind(BindResult result, Pdb pdb)
34 {
35 base.PostBackendBind(result, pdb);
36
37 var output = pdb.Output;
38
39 // Only process Bundles.
40 if (OutputType.Bundle != output.Type)
41 {
42 return;
43 }
44
45 var baTable = output.Tables["WixBootstrapperApplication"];
46 var baRow = baTable.Rows[0];
47 var baId = (string)baRow[0];
48 if (null == baId)
49 {
50 return;
51 }
52
53 var isStdBA = baId.StartsWith("WixStandardBootstrapperApplication");
54 var isMBA = baId.StartsWith("ManagedBootstrapperApplicationHost");
55
56 if (isStdBA || isMBA)
57 {
58 this.VerifyBAFunctions(output);
59 }
60
61 if (isMBA)
62 {
63 this.VerifyPrereqPackages(output);
64 }
65 }
66
67 private void VerifyBAFunctions(Output output)
68 {
69 Row baFunctionsRow = null;
70 var baFunctionsTable = output.Tables["WixBalBAFunctions"];
71 foreach (var row in baFunctionsTable.Rows)
72 {
73 if (null == baFunctionsRow)
74 {
75 baFunctionsRow = row;
76 }
77 else
78 {
79 this.Messaging.Write(BalErrors.MultipleBAFunctions(row.SourceLineNumbers));
80 }
81 }
82
83 var payloadPropertiesTable = output.Tables["WixPayloadProperties"];
84 var payloadPropertiesRows = payloadPropertiesTable.Rows.Cast<WixPayloadPropertiesRow>();
85 if (null == baFunctionsRow)
86 {
87 foreach (var payloadPropertiesRow in payloadPropertiesRows)
88 {
89 // TODO: Make core WiX canonicalize Name (this won't catch '.\bafunctions.dll').
90 if (string.Equals(payloadPropertiesRow.Name, "bafunctions.dll", StringComparison.OrdinalIgnoreCase))
91 {
92 this.Messaging.Write(BalWarnings.UnmarkedBAFunctionsDLL(payloadPropertiesRow.SourceLineNumbers));
93 }
94 }
95 }
96 else
97 {
98 // TODO: May need to revisit this depending on the outcome of #5273.
99 var payloadId = (string)baFunctionsRow[0];
100 var bundlePayloadRow = payloadPropertiesRows.Single(x => payloadId == x.Id);
101 if (BurnUXContainerId != bundlePayloadRow.Container)
102 {
103 this.Messaging.Write(BalErrors.BAFunctionsPayloadRequiredInUXContainer(baFunctionsRow.SourceLineNumbers));
104 }
105 }
106 }
107
108 private void VerifyPrereqPackages(Output output)
109 {
110 var prereqInfoTable = output.Tables["WixMbaPrereqInformation"];
111 if (null == prereqInfoTable || prereqInfoTable.Rows.Count == 0)
112 {
113 this.Messaging.Write(BalErrors.MissingPrereq());
114 return;
115 }
116
117 var foundLicenseFile = false;
118 var foundLicenseUrl = false;
119
120 foreach (Row prereqInfoRow in prereqInfoTable.Rows)
121 {
122 if (null != prereqInfoRow[1])
123 {
124 if (foundLicenseFile || foundLicenseUrl)
125 {
126 this.Messaging.Write(BalErrors.MultiplePrereqLicenses(prereqInfoRow.SourceLineNumbers));
127 return;
128 }
129
130 foundLicenseFile = true;
131 }
132
133 if (null != prereqInfoRow[2])
134 {
135 if (foundLicenseFile || foundLicenseUrl)
136 {
137 this.Messaging.Write(BalErrors.MultiplePrereqLicenses(prereqInfoRow.SourceLineNumbers));
138 return;
139 }
140
141 foundLicenseUrl = true;
142 }
143 }
144 }
145 }
146}
diff --git a/src/wixext/Tuples/BalTupleDefinitions.cs b/src/wixext/Tuples/BalTupleDefinitions.cs
new file mode 100644
index 00000000..676db9f6
--- /dev/null
+++ b/src/wixext/Tuples/BalTupleDefinitions.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 System;
6 using WixToolset.Data;
7
8 public enum BalTupleDefinitionType
9 {
10 WixBalBAFunctions,
11 WixBalCondition,
12 WixMbaPrereqInformation,
13 WixStdbaOptions,
14 WixStdbaOverridableVariable,
15 }
16
17 public static partial class BalTupleDefinitions
18 {
19 public static readonly Version Version = new Version("4.0.0");
20
21 public static IntermediateTupleDefinition ByName(string name)
22 {
23 if (!Enum.TryParse(name, out BalTupleDefinitionType type))
24 {
25 return null;
26 }
27
28 return ByType(type);
29 }
30
31 public static IntermediateTupleDefinition ByType(BalTupleDefinitionType type)
32 {
33 switch (type)
34 {
35 case BalTupleDefinitionType.WixBalBAFunctions:
36 return BalTupleDefinitions.WixBalBAFunctions;
37
38 case BalTupleDefinitionType.WixBalCondition:
39 return BalTupleDefinitions.WixBalCondition;
40
41 case BalTupleDefinitionType.WixMbaPrereqInformation:
42 return BalTupleDefinitions.WixMbaPrereqInformation;
43
44 case BalTupleDefinitionType.WixStdbaOptions:
45 return BalTupleDefinitions.WixStdbaOptions;
46
47 case BalTupleDefinitionType.WixStdbaOverridableVariable:
48 return BalTupleDefinitions.WixStdbaOverridableVariable;
49
50 default:
51 throw new ArgumentOutOfRangeException(nameof(type));
52 }
53 }
54 }
55}
diff --git a/src/wixext/Tuples/WixBalBAFunctionsTuple.cs b/src/wixext/Tuples/WixBalBAFunctionsTuple.cs
new file mode 100644
index 00000000..f753f239
--- /dev/null
+++ b/src/wixext/Tuples/WixBalBAFunctionsTuple.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.Tuples;
7
8 public static partial class BalTupleDefinitions
9 {
10 public static readonly IntermediateTupleDefinition WixBalBAFunctions = new IntermediateTupleDefinition(
11 BalTupleDefinitionType.WixBalBAFunctions.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixBalBAFunctionsTupleFields.PayloadId), IntermediateFieldType.String),
15 },
16 typeof(WixBalBAFunctionsTuple));
17 }
18}
19
20namespace WixToolset.Bal.Tuples
21{
22 using WixToolset.Data;
23
24 public enum WixBalBAFunctionsTupleFields
25 {
26 PayloadId,
27 }
28
29 public class WixBalBAFunctionsTuple : IntermediateTuple
30 {
31 public WixBalBAFunctionsTuple() : base(BalTupleDefinitions.WixBalBAFunctions, null, null)
32 {
33 }
34
35 public WixBalBAFunctionsTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalTupleDefinitions.WixBalBAFunctions, sourceLineNumber, id)
36 {
37 }
38
39 public IntermediateField this[WixBalBAFunctionsTupleFields index] => this.Fields[(int)index];
40
41 public string PayloadId
42 {
43 get => this.Fields[(int)WixBalBAFunctionsTupleFields.PayloadId].AsString();
44 set => this.Set((int)WixBalBAFunctionsTupleFields.PayloadId, value);
45 }
46 }
47} \ No newline at end of file
diff --git a/src/wixext/Tuples/WixBalConditionTuple.cs b/src/wixext/Tuples/WixBalConditionTuple.cs
new file mode 100644
index 00000000..4c0ddd1d
--- /dev/null
+++ b/src/wixext/Tuples/WixBalConditionTuple.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.Tuples;
7
8 public static partial class BalTupleDefinitions
9 {
10 public static readonly IntermediateTupleDefinition WixBalCondition = new IntermediateTupleDefinition(
11 BalTupleDefinitionType.WixBalCondition.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixBalConditionTupleFields.Condition), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixBalConditionTupleFields.Message), IntermediateFieldType.String),
16 },
17 typeof(WixBalConditionTuple));
18 }
19}
20
21namespace WixToolset.Bal.Tuples
22{
23 using WixToolset.Data;
24
25 public enum WixBalConditionTupleFields
26 {
27 Condition,
28 Message,
29 }
30
31 public class WixBalConditionTuple : IntermediateTuple
32 {
33 public WixBalConditionTuple() : base(BalTupleDefinitions.WixBalCondition, null, null)
34 {
35 }
36
37 public WixBalConditionTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalTupleDefinitions.WixBalCondition, sourceLineNumber, id)
38 {
39 }
40
41 public IntermediateField this[WixBalConditionTupleFields index] => this.Fields[(int)index];
42
43 public string Condition
44 {
45 get => this.Fields[(int)WixBalConditionTupleFields.Condition].AsString();
46 set => this.Set((int)WixBalConditionTupleFields.Condition, value);
47 }
48
49 public string Message
50 {
51 get => this.Fields[(int)WixBalConditionTupleFields.Message].AsString();
52 set => this.Set((int)WixBalConditionTupleFields.Message, value);
53 }
54 }
55} \ No newline at end of file
diff --git a/src/wixext/Tuples/WixMbaPrereqInformationTuple.cs b/src/wixext/Tuples/WixMbaPrereqInformationTuple.cs
new file mode 100644
index 00000000..bcbe9f84
--- /dev/null
+++ b/src/wixext/Tuples/WixMbaPrereqInformationTuple.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.Tuples;
7
8 public static partial class BalTupleDefinitions
9 {
10 public static readonly IntermediateTupleDefinition WixMbaPrereqInformation = new IntermediateTupleDefinition(
11 BalTupleDefinitionType.WixMbaPrereqInformation.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixMbaPrereqInformationTupleFields.PackageId), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixMbaPrereqInformationTupleFields.LicenseFile), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(WixMbaPrereqInformationTupleFields.LicenseUrl), IntermediateFieldType.String),
17 },
18 typeof(WixMbaPrereqInformationTuple));
19 }
20}
21
22namespace WixToolset.Bal.Tuples
23{
24 using WixToolset.Data;
25
26 public enum WixMbaPrereqInformationTupleFields
27 {
28 PackageId,
29 LicenseFile,
30 LicenseUrl,
31 }
32
33 public class WixMbaPrereqInformationTuple : IntermediateTuple
34 {
35 public WixMbaPrereqInformationTuple() : base(BalTupleDefinitions.WixMbaPrereqInformation, null, null)
36 {
37 }
38
39 public WixMbaPrereqInformationTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalTupleDefinitions.WixMbaPrereqInformation, sourceLineNumber, id)
40 {
41 }
42
43 public IntermediateField this[WixMbaPrereqInformationTupleFields index] => this.Fields[(int)index];
44
45 public string PackageId
46 {
47 get => this.Fields[(int)WixMbaPrereqInformationTupleFields.PackageId].AsString();
48 set => this.Set((int)WixMbaPrereqInformationTupleFields.PackageId, value);
49 }
50
51 public string LicenseFile
52 {
53 get => this.Fields[(int)WixMbaPrereqInformationTupleFields.LicenseFile].AsString();
54 set => this.Set((int)WixMbaPrereqInformationTupleFields.LicenseFile, value);
55 }
56
57 public string LicenseUrl
58 {
59 get => this.Fields[(int)WixMbaPrereqInformationTupleFields.LicenseUrl].AsString();
60 set => this.Set((int)WixMbaPrereqInformationTupleFields.LicenseUrl, value);
61 }
62 }
63} \ No newline at end of file
diff --git a/src/wixext/Tuples/WixStdbaOptionsTuple.cs b/src/wixext/Tuples/WixStdbaOptionsTuple.cs
new file mode 100644
index 00000000..d930eb47
--- /dev/null
+++ b/src/wixext/Tuples/WixStdbaOptionsTuple.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.Tuples;
7
8 public static partial class BalTupleDefinitions
9 {
10 public static readonly IntermediateTupleDefinition WixStdbaOptions = new IntermediateTupleDefinition(
11 BalTupleDefinitionType.WixStdbaOptions.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixStdbaOptionsTupleFields.SuppressOptionsUI), IntermediateFieldType.Number),
15 new IntermediateFieldDefinition(nameof(WixStdbaOptionsTupleFields.SuppressDowngradeFailure), IntermediateFieldType.Number),
16 new IntermediateFieldDefinition(nameof(WixStdbaOptionsTupleFields.SuppressRepair), IntermediateFieldType.Number),
17 new IntermediateFieldDefinition(nameof(WixStdbaOptionsTupleFields.ShowVersion), IntermediateFieldType.Number),
18 new IntermediateFieldDefinition(nameof(WixStdbaOptionsTupleFields.SupportCacheOnly), IntermediateFieldType.Number),
19 },
20 typeof(WixStdbaOptionsTuple));
21 }
22}
23
24namespace WixToolset.Bal.Tuples
25{
26 using WixToolset.Data;
27
28 public enum WixStdbaOptionsTupleFields
29 {
30 SuppressOptionsUI,
31 SuppressDowngradeFailure,
32 SuppressRepair,
33 ShowVersion,
34 SupportCacheOnly,
35 }
36
37 public class WixStdbaOptionsTuple : IntermediateTuple
38 {
39 public WixStdbaOptionsTuple() : base(BalTupleDefinitions.WixStdbaOptions, null, null)
40 {
41 }
42
43 public WixStdbaOptionsTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalTupleDefinitions.WixStdbaOptions, sourceLineNumber, id)
44 {
45 }
46
47 public IntermediateField this[WixStdbaOptionsTupleFields index] => this.Fields[(int)index];
48
49 public int SuppressOptionsUI
50 {
51 get => this.Fields[(int)WixStdbaOptionsTupleFields.SuppressOptionsUI].AsNumber();
52 set => this.Set((int)WixStdbaOptionsTupleFields.SuppressOptionsUI, value);
53 }
54
55 public int SuppressDowngradeFailure
56 {
57 get => this.Fields[(int)WixStdbaOptionsTupleFields.SuppressDowngradeFailure].AsNumber();
58 set => this.Set((int)WixStdbaOptionsTupleFields.SuppressDowngradeFailure, value);
59 }
60
61 public int SuppressRepair
62 {
63 get => this.Fields[(int)WixStdbaOptionsTupleFields.SuppressRepair].AsNumber();
64 set => this.Set((int)WixStdbaOptionsTupleFields.SuppressRepair, value);
65 }
66
67 public int ShowVersion
68 {
69 get => this.Fields[(int)WixStdbaOptionsTupleFields.ShowVersion].AsNumber();
70 set => this.Set((int)WixStdbaOptionsTupleFields.ShowVersion, value);
71 }
72
73 public int SupportCacheOnly
74 {
75 get => this.Fields[(int)WixStdbaOptionsTupleFields.SupportCacheOnly].AsNumber();
76 set => this.Set((int)WixStdbaOptionsTupleFields.SupportCacheOnly, value);
77 }
78 }
79} \ No newline at end of file
diff --git a/src/wixext/Tuples/WixStdbaOverridableVariableTuple.cs b/src/wixext/Tuples/WixStdbaOverridableVariableTuple.cs
new file mode 100644
index 00000000..3ba982ea
--- /dev/null
+++ b/src/wixext/Tuples/WixStdbaOverridableVariableTuple.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.Tuples;
7
8 public static partial class BalTupleDefinitions
9 {
10 public static readonly IntermediateTupleDefinition WixStdbaOverridableVariable = new IntermediateTupleDefinition(
11 BalTupleDefinitionType.WixStdbaOverridableVariable.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixStdbaOverridableVariableTupleFields.Name), IntermediateFieldType.String),
15 },
16 typeof(WixStdbaOverridableVariableTuple));
17 }
18}
19
20namespace WixToolset.Bal.Tuples
21{
22 using WixToolset.Data;
23
24 public enum WixStdbaOverridableVariableTupleFields
25 {
26 Name,
27 }
28
29 public class WixStdbaOverridableVariableTuple : IntermediateTuple
30 {
31 public WixStdbaOverridableVariableTuple() : base(BalTupleDefinitions.WixStdbaOverridableVariable, null, null)
32 {
33 }
34
35 public WixStdbaOverridableVariableTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalTupleDefinitions.WixStdbaOverridableVariable, sourceLineNumber, id)
36 {
37 }
38
39 public IntermediateField this[WixStdbaOverridableVariableTupleFields index] => this.Fields[(int)index];
40
41 public string Name
42 {
43 get => this.Fields[(int)WixStdbaOverridableVariableTupleFields.Name].AsString();
44 set => this.Set((int)WixStdbaOverridableVariableTupleFields.Name, value);
45 }
46 }
47} \ No newline at end of file
diff --git a/src/wixext/WixBalExtension.csproj b/src/wixext/WixBalExtension.csproj
deleted file mode 100644
index 3e9d382e..00000000
--- a/src/wixext/WixBalExtension.csproj
+++ /dev/null
@@ -1,47 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
5<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
6 <PropertyGroup>
7 <ProjectGuid>{BF720A63-9D7B-456E-B60C-8122852D9FED}</ProjectGuid>
8 <AssemblyName>WixBalExtension</AssemblyName>
9 <OutputType>Library</OutputType>
10 <RootNamespace>WixToolset.Extensions</RootNamespace>
11 </PropertyGroup>
12 <ItemGroup>
13 <Compile Include="AssemblyInfo.cs" />
14 <Compile Include="BalBinder.cs" />
15 <Compile Include="BalCompiler.cs" />
16 <Compile Include="BalExtensionData.cs" />
17 <MsgGenSource Include="Data\messages.xml">
18 <ResourcesLogicalName>$(RootNamespace).Data.Messages.resources</ResourcesLogicalName>
19 </MsgGenSource>
20 <EmbeddedFlattenedResource Include="Data\tables.xml">
21 <LogicalName>$(RootNamespace).Data.tables.xml</LogicalName>
22 </EmbeddedFlattenedResource>
23 <EmbeddedFlattenedResource Include="Xsd\bal.xsd">
24 <LogicalName>$(RootNamespace).Xsd.bal.xsd</LogicalName>
25 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
26 </EmbeddedFlattenedResource>
27 <XsdGenSource Include="Xsd\bal.xsd">
28 <CommonNamespace>WixToolset.Data.Serialize</CommonNamespace>
29 <Namespace>WixToolset.Extensions.Serialize.Bal</Namespace>
30 </XsdGenSource>
31 <EmbeddedResource Include="$(OutputPath)\bal.wixlib">
32 <Link>Data\bal.wixlib</Link>
33 </EmbeddedResource>
34 </ItemGroup>
35 <ItemGroup>
36 <Reference Include="System" />
37 <Reference Include="System.Xml" />
38 <Reference Include="System.Xml.Linq" />
39 <ProjectReference Include="..\..\..\libs\WixToolset.Data\WixToolset.Data.csproj" />
40 <ProjectReference Include="..\..\..\libs\WixToolset.Extensibility\WixToolset.Extensibility.csproj" />
41 <ProjectReference Include="..\..\..\tools\wix\Wix.csproj" />
42 <ProjectReference Include="..\wixlib\BalExtension.wixproj">
43 <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
44 </ProjectReference>
45 </ItemGroup>
46 <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" />
47</Project>
diff --git a/src/wixext/WixToolset.Bal.wixext.csproj b/src/wixext/WixToolset.Bal.wixext.csproj
new file mode 100644
index 00000000..49f891d3
--- /dev/null
+++ b/src/wixext/WixToolset.Bal.wixext.csproj
@@ -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<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 <IsTool>true</IsTool>
11 <ContentTargetFolders>build</ContentTargetFolders>
12 </PropertyGroup>
13 <ItemGroup>
14 <Content Include="$(MSBuildThisFileName).targets" />
15 <Content Include="bal.xsd" PackagePath="tools" />
16 <EmbeddedResource Include="tables.xml" />
17 <EmbeddedResource Include="$(OutputPath)..\bal.wixlib" />
18 </ItemGroup>
19 <ItemGroup>
20 <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" PrivateAssets="all" />
21 </ItemGroup>
22
23 <ItemGroup>
24 <ProjectReference Include="..\wixlib\bal.wixproj" ReferenceOutputAssembly="false" Condition=" '$(NCrunch)'=='' " />
25 </ItemGroup>
26
27 <ItemGroup>
28 <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.65" PrivateAssets="all" />
29 </ItemGroup>
30</Project>
diff --git a/src/wixext/WixToolset.Bal.wixext.targets b/src/wixext/WixToolset.Bal.wixext.targets
new file mode 100644
index 00000000..70c5a19c
--- /dev/null
+++ b/src/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/wixext/messages.xml b/src/wixext/messages.xml
deleted file mode 100644
index 9b11981d..00000000
--- a/src/wixext/messages.xml
+++ /dev/null
@@ -1,43 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
5<Messages Namespace="WixToolset.Extensions" Resources="Data.Messages" xmlns="http://schemas.microsoft.com/genmsgs/2004/07/messages">
6 <Class Name="BalErrors" ContainerName="BalErrorEventArgs" BaseContainerName="MessageEventArgs" Level="Error">
7 <Message Id="AttributeRequiresPrereqPackage" Number="6801">
8 <Instance>
9 When the {0}/@{1} attribute is specified, the {0}/@PrereqPackage attribute must be set to "yes".
10 <Parameter Type="System.String" Name="elementName" />
11 <Parameter Type="System.String" Name="attributeName" />
12 </Instance>
13 </Message>
14 <Message Id="MissingPrereq" Number="6802" SourceLineNumbers="no">
15 <Instance>
16 There must be at least one PrereqPackage when using the ManagedBootstrapperApplicationHost.
17 This is typically done by using the WixNetFxExtension and referencing one of the NetFxAsPrereq package groups.
18 </Instance>
19 </Message>
20 <Message Id="MultiplePrereqLicenses" Number="6803">
21 <Instance>
22 There may only be one package in the bundle that has either the PrereqLicenseFile attribute or the PrereqLicenseUrl attribute.
23 </Instance>
24 </Message>
25 <Message Id="MultipleBAFunctions" Number="6804">
26 <Instance>
27 WixStandardBootstrapperApplication doesn't support multiple BAFunctions DLLs.
28 </Instance>
29 </Message>
30 <Message Id="BAFunctionsPayloadRequiredInUXContainer" Number="6805">
31 <Instance>
32 The BAFunctions DLL Payload element must be located inside the BootstrapperApplication container.
33 </Instance>
34 </Message>
35 </Class>
36 <Class Name="BalWarnings" ContainerName="BalWarningEventArgs" BaseContainerName="MessageEventArgs" Level="Warning">
37 <Message Id="UnmarkedBAFunctionsDLL" Number="6501">
38 <Instance>
39 WixStandardBootstrapperApplication doesn't automatically load BAFunctions.dll. Use the bal:BAFunctions attribute to indicate that it should be loaded.
40 </Instance>
41 </Message>
42 </Class>
43</Messages>
diff --git a/src/wixlib/BalExtension.wixproj b/src/wixlib/BalExtension.wixproj
deleted file mode 100644
index e2898e83..00000000
--- a/src/wixlib/BalExtension.wixproj
+++ /dev/null
@@ -1,39 +0,0 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
5<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
6 <PropertyGroup>
7 <ProjectGuid>{3444D952-F21C-496F-AB6B-56435BFD0787}</ProjectGuid>
8 <OutputName>bal</OutputName>
9 <OutputType>Library</OutputType>
10 <BindFiles>true</BindFiles>
11 <Pedantic>true</Pedantic>
12 <Cultures>en-us</Cultures>
13 </PropertyGroup>
14
15 <ItemGroup>
16 <Compile Include="BalExtension.wxs" />
17 <Compile Include="Mba.wxs" />
18 <Compile Include="NetFx4AsPrereq.wxs" />
19 <Compile Include="NetFx45AsPrereq.wxs" />
20 <Compile Include="NetFx451AsPrereq.wxs" />
21 <Compile Include="NetFx452AsPrereq.wxs" />
22 <Compile Include="NetFx46AsPrereq.wxs" />
23 <Compile Include="NetFx461AsPrereq.wxs" />
24 <Compile Include="NetFx462AsPrereq.wxs" />
25 <Compile Include="wixstdba.wxs" />
26 <Compile Include="wixstdba_x86.wxs" />
27 </ItemGroup>
28
29 <ItemGroup>
30 <BindInputPaths Include="$(OutputPath)WixstdbaResources\" />
31 </ItemGroup>
32
33 <ItemGroup>
34 <ProjectReference Include="..\mba\host\host.vcxproj" />
35 <ProjectReference Include="..\wixstdba\wixstdba.vcxproj" />
36 </ItemGroup>
37
38 <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" />
39</Project>
diff --git a/src/wixlib/bal.wixproj b/src/wixlib/bal.wixproj
new file mode 100644
index 00000000..be15229b
--- /dev/null
+++ b/src/wixlib/bal.wixproj
@@ -0,0 +1,62 @@
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" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
4 <Import Project="..\..\packages\WixToolset.MSBuild.4.0.0-build-0035\build\WixToolset.MSBuild.props" Condition="Exists('..\..\packages\WixToolset.MSBuild.4.0.0-build-0035\build\WixToolset.MSBuild.props')" />
5 <Import Project="..\FindLocalWix.props" />
6 <PropertyGroup>
7 <ProjectGuid>{3444D952-F21C-496F-AB6B-56435BFD0787}</ProjectGuid>
8 <OutputName>bal</OutputName>
9 <OutputType>Library</OutputType>
10 <BindFiles>true</BindFiles>
11 <Pedantic>true</Pedantic>
12 <Cultures>en-us</Cultures>
13 </PropertyGroup>
14
15 <ItemGroup>
16 <Compile Include="BalExtension.wxs" />
17 <!-- TODO: Reenable when compiling Bundle elements is supported
18 <Compile Include="Mba.wxs" />
19 <Compile Include="NetFx4AsPrereq.wxs" />
20 <Compile Include="NetFx45AsPrereq.wxs" />
21 <Compile Include="NetFx451AsPrereq.wxs" />
22 <Compile Include="NetFx452AsPrereq.wxs" />
23 <Compile Include="NetFx46AsPrereq.wxs" />
24 <Compile Include="NetFx461AsPrereq.wxs" />
25 <Compile Include="NetFx462AsPrereq.wxs" />
26 <Compile Include="wixstdba.wxs" />
27 <Compile Include="wixstdba_x86.wxs" />
28 -->
29 </ItemGroup>
30
31 <ItemGroup>
32 <None Include="packages.config" />
33 </ItemGroup>
34
35 <ItemGroup>
36 <BindInputPaths Include="$(OutputPath)WixstdbaResources\" />
37 </ItemGroup>
38
39 <ItemGroup>
40 <ProjectReference Include="..\mbahost\mbahost.vcxproj">
41 <Name>mbahost</Name>
42 <Project>{12C87C77-3547-44F8-8134-29BC915CB19D}</Project>
43 </ProjectReference>
44 <ProjectReference Include="..\wixstdba\wixstdba.vcxproj">
45 <Name>wixstdba</Name>
46 <Project>{41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}</Project>
47 </ProjectReference>
48 </ItemGroup>
49 <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' AND Exists('$(WixTargetsPath)') " />
50 <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets') " />
51 <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
52 <Error Text="WiX Toolset build tools (v4.0 or later) must be installed to build this project. To download the WiX Toolset, go to http://wixtoolset.org/releases/." />
53 </Target>
54 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
55 <PropertyGroup>
56 <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>
57 </PropertyGroup>
58 <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" />
59 <Error Condition="!Exists('..\..\packages\WixToolset.MSBuild.4.0.0-build-0035\build\WixToolset.MSBuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.MSBuild.4.0.0-build-0035\build\WixToolset.MSBuild.props'))" />
60 </Target>
61 <Import Project="..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" />
62</Project>
diff --git a/src/wixlib/packages.config b/src/wixlib/packages.config
new file mode 100644
index 00000000..7964daed
--- /dev/null
+++ b/src/wixlib/packages.config
@@ -0,0 +1,5 @@
1<?xml version="1.0" encoding="utf-8"?>
2<packages>
3 <package id="Nerdbank.GitVersioning" version="2.1.65" developmentDependency="true" targetFramework="net40" />
4 <package id="WixToolset.MSBuild" version="4.0.0-build-0035" developmentDependency="true" targetFramework="net40" />
5</packages> \ No newline at end of file
diff --git a/src/wixstdba/packages.config b/src/wixstdba/packages.config
new file mode 100644
index 00000000..41ba2f12
--- /dev/null
+++ b/src/wixstdba/packages.config
@@ -0,0 +1,7 @@
1<?xml version="1.0" encoding="utf-8"?>
2<packages>
3 <package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="native" developmentDependency="true" />
4 <package id="WixToolset.BootstrapperCore" version="4.0.3" targetFramework="native" />
5 <package id="WixToolset.BalUtil" version="4.0.4" targetFramework="native" />
6 <package id="WixToolset.DUtil" version="4.0.13" targetFramework="native" />
7</packages> \ No newline at end of file
diff --git a/src/wixstdba/precomp.cpp b/src/wixstdba/precomp.cpp
new file mode 100644
index 00000000..37664a1c
--- /dev/null
+++ b/src/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/wixstdba/precomp.h b/src/wixstdba/precomp.h
index a0390fe2..925a80ce 100644
--- a/src/wixstdba/precomp.h
+++ b/src/wixstdba/precomp.h
@@ -3,7 +3,12 @@
3 3
4 4
5#include <windows.h> 5#include <windows.h>
6
7#pragma warning(push)
8#pragma warning(disable:4458) // declaration of 'xxx' hides class member
6#include <gdiplus.h> 9#include <gdiplus.h>
10#pragma warning(pop)
11
7#include <msiquery.h> 12#include <msiquery.h>
8#include <objbase.h> 13#include <objbase.h>
9#include <shlobj.h> 14#include <shlobj.h>
diff --git a/src/wixstdba/wixstdba.vcxproj b/src/wixstdba/wixstdba.vcxproj
index ddc0bc57..8ee9ace9 100644
--- a/src/wixstdba/wixstdba.vcxproj
+++ b/src/wixstdba/wixstdba.vcxproj
@@ -1,8 +1,11 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> 2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3 3
4<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 <Import Project="..\..\packages\WixToolset.BalUtil.4.0.4\build\WixToolset.BalUtil.props" Condition="Exists('..\..\packages\WixToolset.BalUtil.4.0.4\build\WixToolset.BalUtil.props')" />
6 <Import Project="..\..\packages\WixToolset.BootstrapperCore.4.0.3\build\WixToolset.BootstrapperCore.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.4.0.1\build\WixToolset.BootstrapperCore.props')" />
7 <Import Project="..\..\packages\WixToolset.DUtil.4.0.13\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.13\build\WixToolset.DUtil.props')" />
4 8
5<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
6 <ItemGroup Label="ProjectConfigurations"> 9 <ItemGroup Label="ProjectConfigurations">
7 <ProjectConfiguration Include="Debug|Win32"> 10 <ProjectConfiguration Include="Debug|Win32">
8 <Configuration>Debug</Configuration> 11 <Configuration>Debug</Configuration>
@@ -13,33 +16,27 @@
13 <Platform>Win32</Platform> 16 <Platform>Win32</Platform>
14 </ProjectConfiguration> 17 </ProjectConfiguration>
15 </ItemGroup> 18 </ItemGroup>
16 <ItemGroup Label="ProjectConfigurations">
17 <ProjectConfiguration Include="Debug|ARM">
18 <Configuration>Debug</Configuration>
19 <Platform>ARM</Platform>
20 </ProjectConfiguration>
21 <ProjectConfiguration Include="Release|ARM">
22 <Configuration>Release</Configuration>
23 <Platform>ARM</Platform>
24 </ProjectConfiguration>
25 </ItemGroup>
26 19
27 <PropertyGroup Label="Globals"> 20 <PropertyGroup Label="Globals">
28 <ProjectGuid>{41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}</ProjectGuid> 21 <ProjectGuid>{41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}</ProjectGuid>
29 <ConfigurationType>DynamicLibrary</ConfigurationType> 22 <ConfigurationType>DynamicLibrary</ConfigurationType>
23 <PlatformToolset>v141</PlatformToolset>
30 <CharacterSet>Unicode</CharacterSet> 24 <CharacterSet>Unicode</CharacterSet>
31 <TargetName>WixStdBA</TargetName> 25 <TargetName>WixStdBA</TargetName>
32 <ProjectModuleDefinitionFile>wixstdba.def</ProjectModuleDefinitionFile> 26 <ProjectModuleDefinitionFile>wixstdba.def</ProjectModuleDefinitionFile>
33 </PropertyGroup> 27 </PropertyGroup>
34 28
35 <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.props" /> 29 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
30 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
36 31
37 <PropertyGroup> 32 <PropertyGroup>
38 <ProjectAdditionalIncludeDirectories>$(WixRoot)src\libs\dutil\inc;$(WixRoot)src\burn\inc;$(WixRoot)src\libs\balutil\inc</ProjectAdditionalIncludeDirectories> 33 <ProjectAdditionalLinkLibraries>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;wininet.lib;wixstdba.res</ProjectAdditionalLinkLibraries>
39 <ProjectAdditionalLinkLibraries>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;wininet.lib;dutil.lib;balutil.lib;wixstdba.res</ProjectAdditionalLinkLibraries>
40 </PropertyGroup> 34 </PropertyGroup>
41 35
42 <ItemGroup> 36 <ItemGroup>
37 <ClCompile Include="precomp.cpp">
38 <PrecompiledHeader>Create</PrecompiledHeader>
39 </ClCompile>
43 <ClCompile Include="WixStandardBootstrapperApplication.cpp" /> 40 <ClCompile Include="WixStandardBootstrapperApplication.cpp" />
44 <ClCompile Include="wixstdba.cpp" /> 41 <ClCompile Include="wixstdba.cpp" />
45 </ItemGroup> 42 </ItemGroup>
@@ -93,7 +90,9 @@
93 <None Include="wixstdba.def" /> 90 <None Include="wixstdba.def" />
94 </ItemGroup> 91 </ItemGroup>
95 <ItemGroup> 92 <ItemGroup>
96 <ResourceCompile Include="wixstdba.rc" /> 93 <None Include="packages.config" />
94 </ItemGroup>
95 <ItemGroup>
97 <CustomBuild Include="wixstdba.mc"> 96 <CustomBuild Include="wixstdba.mc">
98 <Message>Compiling message file...</Message> 97 <Message>Compiling message file...</Message>
99 <Command>mc.exe -h "$(IntDir)." -r "$(IntDir)." -A -c -z wixstdba.messages "$(InputDir)wixstdba.mc" 98 <Command>mc.exe -h "$(IntDir)." -r "$(IntDir)." -A -c -z wixstdba.messages "$(InputDir)wixstdba.mc"
@@ -102,5 +101,15 @@ rc.exe -fo "$(OutDir)wixstdba.res" "$(IntDir)wixstdba.messages.rc"</Command>
102 </CustomBuild> 101 </CustomBuild>
103 </ItemGroup> 102 </ItemGroup>
104 103
105 <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" /> 104 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
105 <Import Project="..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" />
106 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
107 <PropertyGroup>
108 <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>
109 </PropertyGroup>
110 <Error Condition="!Exists('..\..\packages\WixToolset.BalUtil.4.0.4\build\WixToolset.BalUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BalUtil.4.0.4\build\WixToolset.BalUtil.props'))" />
111 <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.4.0.3\build\WixToolset.BootstrapperCore.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.4.0.3\build\WixToolset.BootstrapperCore.props'))" />
112 <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.13\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.13\build\WixToolset.DUtil.props'))" />
113 <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" />
114 </Target>
106</Project> 115</Project>
diff --git a/version.json b/version.json
new file mode 100644
index 00000000..5f857771
--- /dev/null
+++ b/version.json
@@ -0,0 +1,11 @@
1{
2 "version": "4.0",
3 "publicReleaseRefSpec": [
4 "^refs/heads/master$"
5 ],
6 "cloudBuild": {
7 "buildNumber": {
8 "enabled": true
9 }
10 }
11}