| 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 WixToolset.Core.WindowsInstaller.CommandLine; |
| 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 CommandLineHelp GetCommandLineHelp() |
| 25 | { |
| 26 | return new CommandLineHelp("Specialized operations for manipulating Windows Installer databases.") |
| 27 | { |
| 28 | Commands = new[] |
| 29 | { |
| 30 | new CommandLineHelpCommand("msi", "Specialized operations for manipulating Windows Installer packages."), |
| 31 | } |
| 32 | }; |
| 33 | } |
| 34 | |
| 35 | public override bool TryParseCommand(ICommandLineParser parser, string argument, out ICommandLineCommand command) |
| 36 | { |
| 37 | command = null; |
| 38 | |
| 39 | if ("msi".Equals(argument, StringComparison.OrdinalIgnoreCase)) |
| 40 | { |
| 41 | command = new WindowsInstallerCommand(this.ServiceProvider); |
| 42 | } |
| 43 | |
| 44 | return command != null; |
| 45 | } |
| 46 | } |
| 47 | } |