diff options
Diffstat (limited to 'src/wix/WixToolset.Core.WindowsInstaller/WindowsInstallerExtensionCommandLine.cs')
-rw-r--r-- | src/wix/WixToolset.Core.WindowsInstaller/WindowsInstallerExtensionCommandLine.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/wix/WixToolset.Core.WindowsInstaller/WindowsInstallerExtensionCommandLine.cs b/src/wix/WixToolset.Core.WindowsInstaller/WindowsInstallerExtensionCommandLine.cs new file mode 100644 index 00000000..4c516d0d --- /dev/null +++ b/src/wix/WixToolset.Core.WindowsInstaller/WindowsInstallerExtensionCommandLine.cs | |||
@@ -0,0 +1,41 @@ | |||
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.Collections.Generic; | ||
7 | using WixToolset.Extensibility; | ||
8 | using WixToolset.Extensibility.Data; | ||
9 | using WixToolset.Extensibility.Services; | ||
10 | |||
11 | /// <summary> | ||
12 | /// Parses the "msi" command-line command. See <c>WindowsInstallerCommand</c> | ||
13 | /// for the bulk of the command-line processing. | ||
14 | /// </summary> | ||
15 | internal class WindowsInstallerExtensionCommandLine : BaseExtensionCommandLine | ||
16 | { | ||
17 | public WindowsInstallerExtensionCommandLine(IServiceProvider serviceProvider) | ||
18 | { | ||
19 | this.ServiceProvider = serviceProvider; | ||
20 | } | ||
21 | |||
22 | private IServiceProvider ServiceProvider { get; } | ||
23 | |||
24 | public override IReadOnlyCollection<ExtensionCommandLineSwitch> CommandLineSwitches => new ExtensionCommandLineSwitch[] | ||
25 | { | ||
26 | new ExtensionCommandLineSwitch { Switch = "msi", Description = "Windows Installer specialized operations." }, | ||
27 | }; | ||
28 | |||
29 | public override bool TryParseCommand(ICommandLineParser parser, string argument, out ICommandLineCommand command) | ||
30 | { | ||
31 | command = null; | ||
32 | |||
33 | if ("msi".Equals(argument, StringComparison.OrdinalIgnoreCase)) | ||
34 | { | ||
35 | command = new WindowsInstallerCommand(this.ServiceProvider); | ||
36 | } | ||
37 | |||
38 | return command != null; | ||
39 | } | ||
40 | } | ||
41 | } | ||