aboutsummaryrefslogtreecommitdiff
path: root/src/wix/WixToolset.Core.Burn/BurnBackendFactory.cs
blob: 63f522006974c1afd62a907df4c913dd0685e228 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// 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.

namespace WixToolset.Core.Burn
{
    using System;
    using System.IO;
    using WixToolset.Extensibility;

    internal class BurnBackendFactory : IBackendFactory
    {
        public bool TryCreateBackend(string outputType, string outputFile, out IBackend backend)
        {
            if (String.IsNullOrEmpty(outputType))
            {
                outputType = Path.GetExtension(outputFile);
            }

            switch (outputType.ToLowerInvariant())
            {
                case "bundle":
                case "burn":
                case ".exe":
                    backend = new BundleBackend();
                    return true;
            }

            backend = null;
            return false;
        }
    }
}