diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-05-22 20:09:02 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-05-22 20:31:54 +1000 |
| commit | 929f43b2d48f9d35803064774e357c7a2cf76713 (patch) | |
| tree | 884bf82e0cdaa8bcf3312c5047702666d8db6121 /src | |
| parent | 36ed678790b0eb9d39848bf6b384733e57a37b6d (diff) | |
| download | wix-929f43b2d48f9d35803064774e357c7a2cf76713.tar.gz wix-929f43b2d48f9d35803064774e357c7a2cf76713.tar.bz2 wix-929f43b2d48f9d35803064774e357c7a2cf76713.zip | |
Add heat.exe
Diffstat (limited to 'src')
| -rw-r--r-- | src/heat/Program.cs | 74 | ||||
| -rw-r--r-- | src/heat/heat.csproj | 34 | ||||
| -rw-r--r-- | src/heat/heat.net461.v3.ncrunchproject | 5 | ||||
| -rw-r--r-- | src/heat/heat.netcoreapp2.1.v3.ncrunchproject | 5 |
4 files changed, 118 insertions, 0 deletions
diff --git a/src/heat/Program.cs b/src/heat/Program.cs new file mode 100644 index 00000000..38d6d401 --- /dev/null +++ b/src/heat/Program.cs | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace WixToolset.Tools.Heat | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.Runtime.InteropServices; | ||
| 7 | using WixToolset.Core; | ||
| 8 | using WixToolset.Data; | ||
| 9 | using WixToolset.Extensibility; | ||
| 10 | using WixToolset.Extensibility.Data; | ||
| 11 | using WixToolset.Extensibility.Services; | ||
| 12 | using WixToolset.Harvesters; | ||
| 13 | using WixToolset.Tools.Core; | ||
| 14 | |||
| 15 | /// <summary> | ||
| 16 | /// Wix Toolset Harvester. | ||
| 17 | /// </summary> | ||
| 18 | public sealed class Program | ||
| 19 | { | ||
| 20 | /// <summary> | ||
| 21 | /// The main entry point for the application. | ||
| 22 | /// </summary> | ||
| 23 | /// <param name="args">Commandline arguments for the application.</param> | ||
| 24 | /// <returns>Returns the application error code.</returns> | ||
| 25 | [MTAThread] | ||
| 26 | public static int Main(string[] args) | ||
| 27 | { | ||
| 28 | var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); | ||
| 29 | var listener = new ConsoleMessageListener("HEAT", "heat.exe"); | ||
| 30 | |||
| 31 | try | ||
| 32 | { | ||
| 33 | var program = new Program(); | ||
| 34 | return program.Run(serviceProvider, listener, args); | ||
| 35 | } | ||
| 36 | catch (WixException e) | ||
| 37 | { | ||
| 38 | listener.Write(e.Error); | ||
| 39 | |||
| 40 | return e.Error.Id; | ||
| 41 | } | ||
| 42 | catch (Exception e) | ||
| 43 | { | ||
| 44 | listener.Write(ErrorMessages.UnexpectedException(e)); | ||
| 45 | |||
| 46 | if (e is NullReferenceException || e is SEHException) | ||
| 47 | { | ||
| 48 | throw; | ||
| 49 | } | ||
| 50 | |||
| 51 | return e.HResult; | ||
| 52 | } | ||
| 53 | } | ||
| 54 | |||
| 55 | /// <summary> | ||
| 56 | /// Run the application with the given arguments. | ||
| 57 | /// </summary> | ||
| 58 | /// <param name="serviceProvider">Service provider to use throughout this execution.</param> | ||
| 59 | /// <param name="args">The commandline arguments.</param> | ||
| 60 | /// <returns>Returns the application error code.</returns> | ||
| 61 | public int Run(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string[] args) | ||
| 62 | { | ||
| 63 | var messaging = serviceProvider.GetService<IMessaging>(); | ||
| 64 | messaging.SetListener(listener); | ||
| 65 | |||
| 66 | var arguments = serviceProvider.GetService<ICommandLineArguments>(); | ||
| 67 | arguments.Populate(args); | ||
| 68 | |||
| 69 | var commandLine = HeatCommandLineFactory.CreateCommandLine(serviceProvider); | ||
| 70 | var command = commandLine.ParseStandardCommandLine(arguments); | ||
| 71 | return command?.Execute() ?? 1; | ||
| 72 | } | ||
| 73 | } | ||
| 74 | } | ||
diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj new file mode 100644 index 00000000..fd56c6c8 --- /dev/null +++ b/src/heat/heat.csproj | |||
| @@ -0,0 +1,34 @@ | |||
| 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 | <TargetFrameworks>netcoreapp2.1;net461;net472</TargetFrameworks> | ||
| 7 | <OutputType>Exe</OutputType> | ||
| 8 | <Description>Harvester</Description> | ||
| 9 | <Title>WiX Harvester</Title> | ||
| 10 | <DebugType>embedded</DebugType> | ||
| 11 | <PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
| 12 | <!-- <PackAsTool>true</PackAsTool> --> | ||
| 13 | <RuntimeIdentifier Condition=" '$(RuntimeIdentifier)'=='' and '$(TargetFramework)'!='netcoreapp2.1' ">win-x86</RuntimeIdentifier> | ||
| 14 | <PlatformTarget>AnyCPU</PlatformTarget> | ||
| 15 | </PropertyGroup> | ||
| 16 | |||
| 17 | <PropertyGroup> | ||
| 18 | <NoWarn>NU1701</NoWarn> | ||
| 19 | </PropertyGroup> | ||
| 20 | |||
| 21 | <ItemGroup> | ||
| 22 | <ProjectReference Include="..\WixToolset.Tools.Core\WixToolset.Tools.Core.csproj" /> | ||
| 23 | </ItemGroup> | ||
| 24 | |||
| 25 | <ItemGroup> | ||
| 26 | <PackageReference Include="WixToolset.Core" Version="4.0.*" /> | ||
| 27 | <PackageReference Include="WixToolset.Harvesters" Version="4.0.*" /> | ||
| 28 | </ItemGroup> | ||
| 29 | |||
| 30 | <ItemGroup> | ||
| 31 | <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" /> | ||
| 32 | <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.65" PrivateAssets="All" /> | ||
| 33 | </ItemGroup> | ||
| 34 | </Project> | ||
diff --git a/src/heat/heat.net461.v3.ncrunchproject b/src/heat/heat.net461.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/heat/heat.net461.v3.ncrunchproject | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | <ProjectConfiguration> | ||
| 2 | <Settings> | ||
| 3 | <HiddenComponentWarnings /> | ||
| 4 | </Settings> | ||
| 5 | </ProjectConfiguration> \ No newline at end of file | ||
diff --git a/src/heat/heat.netcoreapp2.1.v3.ncrunchproject b/src/heat/heat.netcoreapp2.1.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/heat/heat.netcoreapp2.1.v3.ncrunchproject | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | <ProjectConfiguration> | ||
| 2 | <Settings> | ||
| 3 | <HiddenComponentWarnings /> | ||
| 4 | </Settings> | ||
| 5 | </ProjectConfiguration> \ No newline at end of file | ||
