aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Bal/WixToolset.Mba.Host
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2021-05-03 15:55:48 -0700
committerRob Mensching <rob@firegiant.com>2021-05-03 15:55:48 -0700
commitba7bab476501c16e437b0aee71c1be02c3dda176 (patch)
tree814fba485c29a7dfe1adb396169e27ed641ef9a3 /src/ext/Bal/WixToolset.Mba.Host
parent14987a72cc1a3493ca8f80693d273352fc314bd9 (diff)
downloadwix-ba7bab476501c16e437b0aee71c1be02c3dda176.tar.gz
wix-ba7bab476501c16e437b0aee71c1be02c3dda176.tar.bz2
wix-ba7bab476501c16e437b0aee71c1be02c3dda176.zip
Move Bal.wixext into ext
Diffstat (limited to 'src/ext/Bal/WixToolset.Mba.Host')
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/BootstrapperApplicationFactory.cs86
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/BootstrapperSectionGroup.cs29
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/Exceptions.cs145
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/HostSection.cs47
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/NativeMethods.cs18
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElement.cs47
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElementCollection.cs36
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.config26
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.csproj54
-rw-r--r--src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.nuspec23
10 files changed, 511 insertions, 0 deletions
diff --git a/src/ext/Bal/WixToolset.Mba.Host/BootstrapperApplicationFactory.cs b/src/ext/Bal/WixToolset.Mba.Host/BootstrapperApplicationFactory.cs
new file mode 100644
index 00000000..78e68bd9
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/BootstrapperApplicationFactory.cs
@@ -0,0 +1,86 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Mba.Host
4{
5 using System;
6 using System.Configuration;
7 using System.Reflection;
8 using System.Runtime.InteropServices;
9 using WixToolset.Mba.Core;
10
11 /// <summary>
12 /// Entry point for the managed host to create and return the BA to the engine.
13 /// </summary>
14 [ClassInterface(ClassInterfaceType.None)]
15 public sealed class BootstrapperApplicationFactory : MarshalByRefObject, IBootstrapperApplicationFactory
16 {
17 /// <summary>
18 /// Creates a new instance of the <see cref="BootstrapperApplicationFactory"/> class.
19 /// Entry point for the MBA host.
20 /// </summary>
21 public BootstrapperApplicationFactory()
22 {
23 }
24
25 /// <summary>
26 /// Loads the bootstrapper application assembly and calls its IBootstrapperApplicationFactory.Create method.
27 /// </summary>
28 /// <param name="pArgs">Pointer to BOOTSTRAPPER_CREATE_ARGS struct.</param>
29 /// <param name="pResults">Pointer to BOOTSTRAPPER_CREATE_RESULTS struct.</param>
30 /// <exception cref="MissingAttributeException">The bootstrapper application assembly
31 /// does not define the <see cref="BootstrapperApplicationFactoryAttribute"/>.</exception>
32 public void Create(IntPtr pArgs, IntPtr pResults)
33 {
34 // Get the wix.boostrapper section group to get the name of the bootstrapper application assembly to host.
35 var section = ConfigurationManager.GetSection("wix.bootstrapper/host") as HostSection;
36 if (null == section)
37 {
38 throw new MissingAttributeException(); // TODO: throw a more specific exception than this.
39 }
40
41 // Load the BA's IBootstrapperApplicationFactory.
42 var baFactoryType = BootstrapperApplicationFactory.GetBAFactoryTypeFromAssembly(section.AssemblyName);
43 var baFactory = (IBootstrapperApplicationFactory)Activator.CreateInstance(baFactoryType);
44 if (null == baFactory)
45 {
46 throw new InvalidBootstrapperApplicationFactoryException();
47 }
48
49 baFactory.Create(pArgs, pResults);
50 }
51
52 /// <summary>
53 /// Locates the <see cref="BootstrapperApplicationFactoryAttribute"/> and returns the specified type.
54 /// </summary>
55 /// <param name="assemblyName">The assembly that defines the IBootstrapperApplicationFactory implementation.</param>
56 /// <returns>The bootstrapper application factory <see cref="Type"/>.</returns>
57 private static Type GetBAFactoryTypeFromAssembly(string assemblyName)
58 {
59 Type baFactoryType = null;
60
61 // Load the requested assembly.
62 Assembly asm = AppDomain.CurrentDomain.Load(assemblyName);
63
64 // If an assembly was loaded and is not the current assembly, check for the required attribute.
65 // This is done to avoid using the BootstrapperApplicationFactoryAttribute which we use at build time
66 // to specify the BootstrapperApplicationFactory assembly in the manifest.
67 if (!Assembly.GetExecutingAssembly().Equals(asm))
68 {
69 // There must be one and only one BootstrapperApplicationFactoryAttribute.
70 // The attribute prevents multiple declarations already.
71 var attrs = (BootstrapperApplicationFactoryAttribute[])asm.GetCustomAttributes(typeof(BootstrapperApplicationFactoryAttribute), false);
72 if (null != attrs)
73 {
74 baFactoryType = attrs[0].BootstrapperApplicationFactoryType;
75 }
76 }
77
78 if (null == baFactoryType)
79 {
80 throw new MissingAttributeException();
81 }
82
83 return baFactoryType;
84 }
85 }
86}
diff --git a/src/ext/Bal/WixToolset.Mba.Host/BootstrapperSectionGroup.cs b/src/ext/Bal/WixToolset.Mba.Host/BootstrapperSectionGroup.cs
new file mode 100644
index 00000000..5cf1bc9c
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/BootstrapperSectionGroup.cs
@@ -0,0 +1,29 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Mba.Host
4{
5 using System;
6 using System.Configuration;
7
8 /// <summary>
9 /// Handler for the wix.bootstrapper configuration section group.
10 /// </summary>
11 public class BootstrapperSectionGroup : ConfigurationSectionGroup
12 {
13 /// <summary>
14 /// Creates a new instance of the <see cref="BootstrapperSectionGroup"/> class.
15 /// </summary>
16 public BootstrapperSectionGroup()
17 {
18 }
19
20 /// <summary>
21 /// Gets the <see cref="HostSection"/> handler for the mba configuration section.
22 /// </summary>
23 [ConfigurationProperty("host")]
24 public HostSection Host
25 {
26 get { return (HostSection)base.Sections["host"]; }
27 }
28 }
29}
diff --git a/src/ext/Bal/WixToolset.Mba.Host/Exceptions.cs b/src/ext/Bal/WixToolset.Mba.Host/Exceptions.cs
new file mode 100644
index 00000000..c68951f0
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/Exceptions.cs
@@ -0,0 +1,145 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Mba.Host
4{
5 using System;
6 using System.Runtime.Serialization;
7
8 /// <summary>
9 /// Base class for exception returned to the bootstrapper application host.
10 /// </summary>
11 [Serializable]
12 public abstract class BootstrapperException : Exception
13 {
14 /// <summary>
15 /// Creates an instance of the <see cref="BootstrapperException"/> base class with the given HRESULT.
16 /// </summary>
17 /// <param name="hr">The HRESULT for the exception that is used by the bootstrapper application host.</param>
18 public BootstrapperException(int hr)
19 {
20 this.HResult = hr;
21 }
22
23 /// <summary>
24 /// Initializes a new instance of the <see cref="BootstrapperException"/> class.
25 /// </summary>
26 /// <param name="message">Exception message.</param>
27 public BootstrapperException(string message)
28 : base(message)
29 {
30 }
31
32 /// <summary>
33 /// Initializes a new instance of the <see cref="BootstrapperException"/> class.
34 /// </summary>
35 /// <param name="message">Exception message</param>
36 /// <param name="innerException">Inner exception associated with this one</param>
37 public BootstrapperException(string message, Exception innerException)
38 : base(message, innerException)
39 {
40 }
41
42 /// <summary>
43 /// Initializes a new instance of the <see cref="BootstrapperException"/> class.
44 /// </summary>
45 /// <param name="info">Serialization information for this exception</param>
46 /// <param name="context">Streaming context to serialize to</param>
47 protected BootstrapperException(SerializationInfo info, StreamingContext context)
48 : base(info, context)
49 {
50 }
51 }
52
53 /// <summary>
54 /// The bootstrapper application assembly loaded by the host does not contain exactly one instance of the
55 /// <see cref="Core.BootstrapperApplicationFactoryAttribute"/> class.
56 /// </summary>
57 /// <seealso cref="Core.BootstrapperApplicationFactoryAttribute"/>
58 [Serializable]
59 public class MissingAttributeException : BootstrapperException
60 {
61 /// <summary>
62 /// Creates a new instance of the <see cref="MissingAttributeException"/> class.
63 /// </summary>
64 public MissingAttributeException()
65 : base(NativeMethods.E_NOTFOUND)
66 {
67 }
68
69 /// <summary>
70 /// Initializes a new instance of the <see cref="MissingAttributeException"/> class.
71 /// </summary>
72 /// <param name="message">Exception message.</param>
73 public MissingAttributeException(string message)
74 : base(message)
75 {
76 }
77
78 /// <summary>
79 /// Initializes a new instance of the <see cref="MissingAttributeException"/> class.
80 /// </summary>
81 /// <param name="message">Exception message</param>
82 /// <param name="innerException">Inner exception associated with this one</param>
83 public MissingAttributeException(string message, Exception innerException)
84 : base(message, innerException)
85 {
86 }
87
88 /// <summary>
89 /// Initializes a new instance of the <see cref="MissingAttributeException"/> class.
90 /// </summary>
91 /// <param name="info">Serialization information for this exception</param>
92 /// <param name="context">Streaming context to serialize to</param>
93 protected MissingAttributeException(SerializationInfo info, StreamingContext context)
94 : base(info, context)
95 {
96 }
97 }
98
99 /// <summary>
100 /// The bootstrapper application factory specified by the <see cref="Core.BootstrapperApplicationFactoryAttribute"/>
101 /// does not extend the <see cref="Core.IBootstrapperApplicationFactory"/> base class.
102 /// </summary>
103 /// <seealso cref="Core.BaseBootstrapperApplicationFactory"/>
104 /// <seealso cref="Core.BootstrapperApplicationFactoryAttribute"/>
105 [Serializable]
106 public class InvalidBootstrapperApplicationFactoryException : BootstrapperException
107 {
108 /// <summary>
109 /// Creates a new instance of the <see cref="InvalidBootstrapperApplicationFactoryException"/> class.
110 /// </summary>
111 public InvalidBootstrapperApplicationFactoryException()
112 : base(NativeMethods.E_UNEXPECTED)
113 {
114 }
115
116 /// <summary>
117 /// Initializes a new instance of the <see cref="InvalidBootstrapperApplicationFactoryException"/> class.
118 /// </summary>
119 /// <param name="message">Exception message.</param>
120 public InvalidBootstrapperApplicationFactoryException(string message)
121 : base(message)
122 {
123 }
124
125 /// <summary>
126 /// Initializes a new instance of the <see cref="InvalidBootstrapperApplicationFactoryException"/> class.
127 /// </summary>
128 /// <param name="message">Exception message</param>
129 /// <param name="innerException">Inner exception associated with this one</param>
130 public InvalidBootstrapperApplicationFactoryException(string message, Exception innerException)
131 : base(message, innerException)
132 {
133 }
134
135 /// <summary>
136 /// Initializes a new instance of the <see cref="InvalidBootstrapperApplicationFactoryException"/> class.
137 /// </summary>
138 /// <param name="info">Serialization information for this exception</param>
139 /// <param name="context">Streaming context to serialize to</param>
140 protected InvalidBootstrapperApplicationFactoryException(SerializationInfo info, StreamingContext context)
141 : base(info, context)
142 {
143 }
144 }
145}
diff --git a/src/ext/Bal/WixToolset.Mba.Host/HostSection.cs b/src/ext/Bal/WixToolset.Mba.Host/HostSection.cs
new file mode 100644
index 00000000..632025c7
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/HostSection.cs
@@ -0,0 +1,47 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Mba.Host
4{
5 using System;
6 using System.Configuration;
7
8 /// <summary>
9 /// Handler for the Host configuration section.
10 /// </summary>
11 public sealed class HostSection : ConfigurationSection
12 {
13 private static readonly ConfigurationProperty assemblyNameProperty = new ConfigurationProperty("assemblyName", typeof(string), null, ConfigurationPropertyOptions.IsRequired);
14 private static readonly ConfigurationProperty supportedFrameworksProperty = new ConfigurationProperty("", typeof(SupportedFrameworkElementCollection), null, ConfigurationPropertyOptions.IsDefaultCollection);
15
16 /// <summary>
17 /// Creates a new instance of the <see cref="HostSection"/> class.
18 /// </summary>
19 public HostSection()
20 {
21 }
22
23 /// <summary>
24 /// Gets the name of the assembly that contians the <see cref="Core.IBootstrapperApplicationFactory"/> child class.
25 /// </summary>
26 /// <remarks>
27 /// The assembly specified by this name must contain the <see cref="Core.BootstrapperApplicationFactoryAttribute"/> to identify
28 /// the type of the <see cref="Core.IBootstrapperApplicationFactory"/> child class.
29 /// </remarks>
30 [ConfigurationProperty("assemblyName", IsRequired = true)]
31 public string AssemblyName
32 {
33 get { return (string)base[assemblyNameProperty]; }
34 set { base[assemblyNameProperty] = value; }
35 }
36
37 /// <summary>
38 /// Gets the <see cref="SupportedFrameworkElementCollection"/> of supported frameworks for the host configuration.
39 /// </summary>
40 [ConfigurationProperty("", IsDefaultCollection = true)]
41 [ConfigurationCollection(typeof(SupportedFrameworkElement))]
42 public SupportedFrameworkElementCollection SupportedFrameworks
43 {
44 get { return (SupportedFrameworkElementCollection)base[supportedFrameworksProperty]; }
45 }
46 }
47}
diff --git a/src/ext/Bal/WixToolset.Mba.Host/NativeMethods.cs b/src/ext/Bal/WixToolset.Mba.Host/NativeMethods.cs
new file mode 100644
index 00000000..b9fc85a0
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/NativeMethods.cs
@@ -0,0 +1,18 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Mba.Host
4{
5 using System;
6 using System.Runtime.InteropServices;
7
8 /// <summary>
9 /// Contains native constants, functions, and structures for this assembly.
10 /// </summary>
11 internal static class NativeMethods
12 {
13 #region Error Constants
14 internal const int E_NOTFOUND = unchecked((int)0x80070490);
15 internal const int E_UNEXPECTED = unchecked((int)0x8000ffff);
16 #endregion
17 }
18}
diff --git a/src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElement.cs b/src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElement.cs
new file mode 100644
index 00000000..fe7fd2eb
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElement.cs
@@ -0,0 +1,47 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Mba.Host
4{
5 using System;
6 using System.Configuration;
7
8 /// <summary>
9 /// Handler for the supportedFramework configuration section.
10 /// </summary>
11 public sealed class SupportedFrameworkElement : ConfigurationElement
12 {
13 private static readonly ConfigurationProperty versionProperty = new ConfigurationProperty("version", typeof(string), null, ConfigurationPropertyOptions.IsRequired);
14 private static readonly ConfigurationProperty runtimeVersionProperty = new ConfigurationProperty("runtimeVersion", typeof(string));
15
16 /// <summary>
17 /// Creates a new instance of the <see cref="SupportedFrameworkElement"/> class.
18 /// </summary>
19 public SupportedFrameworkElement()
20 {
21 }
22
23 /// <summary>
24 /// Gets the version of the supported framework.
25 /// </summary>
26 /// <remarks>
27 /// The assembly specified by this name must contain a value matching the NETFX version registry key under
28 /// "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP".
29 /// </remarks>
30 [ConfigurationProperty("version", IsRequired = true)]
31 public string Version
32 {
33 get { return (string)base[versionProperty]; }
34 set { base[versionProperty] = value; }
35 }
36
37 /// <summary>
38 /// Gets the runtime version required by this supported framework.
39 /// </summary>
40 [ConfigurationProperty("runtimeVersion", IsRequired = false)]
41 public string RuntimeVersion
42 {
43 get { return (string)base[runtimeVersionProperty]; }
44 set { base[runtimeVersionProperty] = value; }
45 }
46 }
47}
diff --git a/src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElementCollection.cs b/src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElementCollection.cs
new file mode 100644
index 00000000..12c7cf3e
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElementCollection.cs
@@ -0,0 +1,36 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Mba.Host
4{
5 using System;
6 using System.Configuration;
7 using System.Diagnostics.CodeAnalysis;
8
9 /// <summary>
10 /// Handler for the supportedFramework collection.
11 /// </summary>
12 [SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface")]
13 [ConfigurationCollection(typeof(SupportedFrameworkElement), AddItemName = "supportedFramework", CollectionType = ConfigurationElementCollectionType.BasicMap)]
14 public sealed class SupportedFrameworkElementCollection : ConfigurationElementCollection
15 {
16 public override ConfigurationElementCollectionType CollectionType
17 {
18 get { return ConfigurationElementCollectionType.BasicMap; }
19 }
20
21 protected override string ElementName
22 {
23 get { return "supportedFramework"; }
24 }
25
26 protected override ConfigurationElement CreateNewElement()
27 {
28 return new SupportedFrameworkElement();
29 }
30
31 protected override object GetElementKey(ConfigurationElement element)
32 {
33 return (element as SupportedFrameworkElement).Version;
34 }
35 }
36}
diff --git a/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.config b/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.config
new file mode 100644
index 00000000..a19b66f1
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.config
@@ -0,0 +1,26 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
5<configuration>
6 <configSections>
7 <sectionGroup name="wix.bootstrapper" type="WixToolset.Mba.Host.BootstrapperSectionGroup, WixToolset.Mba.Host">
8 <section name="host" type="WixToolset.Mba.Host.HostSection, WixToolset.Mba.Host" />
9 </sectionGroup>
10 </configSections>
11 <startup useLegacyV2RuntimeActivationPolicy="true">
12 <supportedRuntime version="v4.0" />
13 <supportedRuntime version="v2.0.50727" />
14 </startup>
15 <wix.bootstrapper>
16 <!-- Example only. Use only if the startup/supportedRuntime above cannot discern supported frameworks. -->
17 <!--
18 <supportedFramework version="v4\Client" />
19 <supportedFramework version="v3.5" />
20 <supportedFramework version="v3.0" />
21 -->
22
23 <!-- Example only. Replace the host/@assemblyName attribute with assembly that implements IBootstrapperApplicationFactory. -->
24 <host assemblyName="AssemblyWithClassThatInheritsFromBootstrapperApplicationFactory" />
25 </wix.bootstrapper>
26</configuration>
diff --git a/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.csproj b/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.csproj
new file mode 100644
index 00000000..3ee0ad1e
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.csproj
@@ -0,0 +1,54 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4<Project Sdk="Microsoft.NET.Sdk">
5 <PropertyGroup>
6 <AssemblyName>WixToolset.Mba.Host</AssemblyName>
7 <RootNamespace>WixToolset.Mba.Host</RootNamespace>
8 <TargetFrameworks>net20</TargetFrameworks>
9 <Description>Managed Bootstrapper Application entry point</Description>
10 <DebugType>embedded</DebugType>
11 <NuspecFile>$(MSBuildThisFileName).nuspec</NuspecFile>
12 <PlatformTarget>AnyCPU</PlatformTarget>
13 </PropertyGroup>
14
15 <ItemGroup>
16 <None Include="WixToolset.Mba.Host.config" CopyToOutputDirectory="PreserveNewest" />
17 </ItemGroup>
18 <ItemGroup>
19 <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
20 <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="All" />
21 <PackageReference Include="WixToolset.Mba.Core" Version="4.0.*" />
22 </ItemGroup>
23 <ItemGroup>
24 <Reference Include="System.Configuration" />
25 </ItemGroup>
26 <ItemGroup>
27 <HeaderPath Include="$(BaseOutputPath)obj\$(AssemblyName).h">
28 <Visible>False</Visible>
29 </HeaderPath>
30 </ItemGroup>
31
32 <Target Name="GenerateIdentityHeader" AfterTargets="Build" Inputs="$(TargetPath)" Outputs="@(HeaderPath)">
33 <GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
34 <Output TaskParameter="Assemblies" ItemName="AssemblyIdentity" />
35 </GetAssemblyIdentity>
36 <ItemGroup>
37 <Line Include='#define MBA_ASSEMBLY_FULL_NAME L"%(AssemblyIdentity.Identity)"' />
38 <Line Include='#define MBA_CONFIG_FILE_NAME L"$(AssemblyName).config"' />
39 <Line Include='#define MBA_ENTRY_TYPE L"$(RootNamespace).BootstrapperApplicationFactory"' />
40 </ItemGroup>
41 <Message Importance="normal" Text="Generating identity definitions into @(HeaderPath->'%(FullPath)')" />
42 <WriteLinesToFile File="@(HeaderPath)" Lines="@(Line)" Overwrite="True" />
43 <ItemGroup>
44 <FileWrites Include="@(HeaderPath)" />
45 </ItemGroup>
46 </Target>
47
48 <Target Name="SetNuspecProperties" DependsOnTargets="InitializeSourceControlInformation" AfterTargets="GetBuildVersion">
49 <PropertyGroup>
50 <NuspecBasePath>$(OutputPath)</NuspecBasePath>
51 <NuspecProperties>Id=$(AssemblyName);Version=$(BuildVersionSimple);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description);RepositoryCommit=$(SourceRevisionId);RepositoryType=$(RepositoryType);RepositoryUrl=$(PrivateRepositoryUrl)</NuspecProperties>
52 </PropertyGroup>
53 </Target>
54</Project> \ No newline at end of file
diff --git a/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.nuspec b/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.nuspec
new file mode 100644
index 00000000..00fd21ac
--- /dev/null
+++ b/src/ext/Bal/WixToolset.Mba.Host/WixToolset.Mba.Host.nuspec
@@ -0,0 +1,23 @@
1<?xml version="1.0"?>
2<package >
3 <metadata>
4 <id>$id$</id>
5 <version>$version$</version>
6 <authors>WiX Toolset Team</authors>
7 <owners>WiX Toolset Team</owners>
8 <license type="expression">MS-RL</license>
9 <projectUrl>https://github.com/wixtoolset/Bal.wixext</projectUrl>
10 <requireLicenseAcceptance>false</requireLicenseAcceptance>
11 <description>$description$</description>
12 <copyright>$copyright$</copyright>
13 <repository type="$repositorytype$" url="$repositoryurl$" commit="$repositorycommit$" />
14 <dependencies>
15 <group targetFramework=".NETFramework2.0" />
16 </dependencies>
17 </metadata>
18
19 <files>
20 <file src="net20\$id$.config" target="samples" />
21 <file src="net20\$id$.dll" target="lib\net20" />
22 </files>
23</package>