COMCommand.cpp (2454B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 #include "pch.h" 4 #include "COMCommand.h" 5 #include "Workflows/DownloadFlow.h" 6 #include "Workflows/InstallFlow.h" 7 #include "Workflows/PromptFlow.h" 8 #include "Workflows/UninstallFlow.h" 9 #include "Workflows/WorkflowBase.h" 10 #include "Workflows/DependenciesFlow.h" 11 #include "Workflows/RepairFlow.h" 12 13 namespace AppInstaller::CLI 14 { 15 using namespace AppInstaller::CLI::Execution; 16 using namespace AppInstaller::CLI::Workflow; 17 using namespace AppInstaller::Manifest; 18 using namespace AppInstaller::Utility::literals; 19 20 // IMPORTANT: To use this command, the caller should have already retrieved the package manifest (GetManifest()) and added it to the Context Data 21 void COMDownloadCommand::ExecuteInternal(Context& context) const 22 { 23 context << 24 Workflow::InitializeInstallerDownloadAuthenticatorsMap << 25 Workflow::ReportExecutionStage(ExecutionStage::Discovery) << 26 Workflow::SelectInstaller << 27 Workflow::EnsureApplicableInstaller << 28 Workflow::ReportIdentityAndInstallationDisclaimer << 29 Workflow::ShowPromptsForSinglePackage(/* ensureAcceptance */ true) << 30 Workflow::SetDownloadDirectory << 31 Workflow::DownloadPackageDependencies << 32 Workflow::DownloadInstaller; 33 } 34 35 // IMPORTANT: To use this command, the caller should have already executed the COMDownloadCommand 36 void COMInstallCommand::ExecuteInternal(Context& context) const 37 { 38 context << 39 Workflow::InstallDependencies << 40 Workflow::ReverifyInstallerHash << 41 Workflow::InstallPackageInstaller; 42 } 43 44 // IMPORTANT: To use this command, the caller should have already retrieved the InstalledPackageVersion and added it to the Context Data 45 void COMUninstallCommand::ExecuteInternal(Execution::Context& context) const 46 { 47 context << 48 Workflow::UninstallSinglePackage; 49 } 50 51 // IMPORTANT: To use this command, the caller should have already retrieved the InstalledPackageVersion and added it to the Context Data 52 void COMRepairCommand::ExecuteInternal(Execution::Context& context) const 53 { 54 context << 55 Workflow::InitializeInstallerDownloadAuthenticatorsMap << 56 Workflow::SelectApplicableInstallerIfNecessary << 57 Workflow::RepairSinglePackage; 58 } 59 }