diff options
author | Rob Mensching <rob@firegiant.com> | 2017-10-14 16:12:07 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2017-10-14 16:12:07 -0700 |
commit | dbde9e7104b907bbbaea17e21247d8cafc8b3a4c (patch) | |
tree | 0f5fbbb6fe12c6b2e5e622a0e18ce4c5b4eb2b96 /src/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendFactory.cs | |
parent | fbf986eb97f68396797a89fc7d40dec07b775440 (diff) | |
download | wix-dbde9e7104b907bbbaea17e21247d8cafc8b3a4c.tar.gz wix-dbde9e7104b907bbbaea17e21247d8cafc8b3a4c.tar.bz2 wix-dbde9e7104b907bbbaea17e21247d8cafc8b3a4c.zip |
Massive refactoring to introduce the concept of IBackend
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 | } | ||