diff options
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendFactory.cs')
| -rw-r--r-- | src/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendFactory.cs | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendFactory.cs b/src/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendFactory.cs new file mode 100644 index 00000000..b66a4617 --- /dev/null +++ b/src/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendFactory.cs | |||
| @@ -0,0 +1,50 @@ | |||
| 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.WindowsInstaller | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.IO; | ||
| 7 | using WixToolset.Extensibility; | ||
| 8 | |||
| 9 | internal class WindowsInstallerBackendFactory : 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 "module": | ||
| 21 | case ".msm": | ||
| 22 | backend = new MsmBackend(); | ||
| 23 | return true; | ||
| 24 | |||
| 25 | case "msipackage": | ||
| 26 | case "product": | ||
| 27 | case ".msi": | ||
| 28 | backend = new MsiBackend(); | ||
| 29 | return true; | ||
| 30 | |||
| 31 | case "patch": | ||
| 32 | case ".msp": | ||
| 33 | backend = new MspBackend(); | ||
| 34 | return true; | ||
| 35 | |||
| 36 | //case "patchcreation": | ||
| 37 | //case ".pcp": | ||
| 38 | // return new PatchCreationBackend(); | ||
| 39 | |||
| 40 | case "transform": | ||
| 41 | case ".mst": | ||
| 42 | backend = new MstBackend(); | ||
| 43 | return true; | ||
| 44 | } | ||
| 45 | |||
| 46 | backend = null; | ||
| 47 | return false; | ||
| 48 | } | ||
| 49 | } | ||
| 50 | } | ||
