diff options
Diffstat (limited to 'src/WixToolset.Core.Burn/BackendFactory.cs')
-rw-r--r-- | src/WixToolset.Core.Burn/BackendFactory.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/WixToolset.Core.Burn/BackendFactory.cs b/src/WixToolset.Core.Burn/BackendFactory.cs new file mode 100644 index 00000000..042fa254 --- /dev/null +++ b/src/WixToolset.Core.Burn/BackendFactory.cs | |||
@@ -0,0 +1,30 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Core.Burn | ||
4 | { | ||
5 | using System; | ||
6 | using System.IO; | ||
7 | using WixToolset.Extensibility; | ||
8 | |||
9 | internal class BackendFactory : IBackendFactory | ||
10 | { | ||
11 | public bool TryCreateBackend(string outputType, string outputFile, IBindContext context, out IBackend backend) | ||
12 | { | ||
13 | if (String.IsNullOrEmpty(outputType)) | ||
14 | { | ||
15 | outputType = Path.GetExtension(outputFile); | ||
16 | } | ||
17 | |||
18 | switch (outputType.ToLowerInvariant()) | ||
19 | { | ||
20 | case "bundle": | ||
21 | case ".exe": | ||
22 | backend = new BundleBackend(); | ||
23 | return true; | ||
24 | } | ||
25 | |||
26 | backend = null; | ||
27 | return false; | ||
28 | } | ||
29 | } | ||
30 | } | ||