forked from microsoft/winget-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdateFlow.h
More file actions
65 lines (54 loc) · 2.36 KB
/
Copy pathUpdateFlow.h
File metadata and controls
65 lines (54 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#pragma once
#include "ExecutionContext.h"
#include "WorkflowBase.h"
namespace AppInstaller::CLI::Workflow
{
// Iterates through all available versions from a package and find latest applicable version
// Required Args: bool indicating whether to report update not found
// Inputs: InstalledPackageVersion?, Package
// Outputs: Manifest?, Installer?
struct SelectLatestApplicableVersion : public WorkflowTask
{
SelectLatestApplicableVersion(bool isSinglePackage) :
WorkflowTask("SelectLatestApplicableUpdate"), m_isSinglePackage(isSinglePackage) {}
void operator()(Execution::Context& context) const override;
private:
bool m_isSinglePackage;
};
// Ensures the update package has higher version than installed
// Required Args: None
// Inputs: Manifest, InstalledPackageVersion
// Outputs: None
void EnsureUpdateVersionApplicable(Execution::Context& context);
// Update all packages from SearchResult to latest if applicable
// Required Args: None
// Inputs: SearchResult
// Outputs: None
void UpdateAllApplicable(Execution::Context& context);
// Select single package version for install or upgrade
// Required Args: bool indicating whether the flow is for upgrade
// Inputs: Source, SearchResult
// Outputs: None
struct SelectSinglePackageVersionForInstallOrUpgrade : public WorkflowTask
{
SelectSinglePackageVersionForInstallOrUpgrade(OperationType operation) :
WorkflowTask("SelectSinglePackageVersionForInstallOrUpgrade"), m_operationType(operation) {}
void operator()(Execution::Context& context) const override;
private:
mutable OperationType m_operationType;
};
// Install or upgrade a single package
// Required Args: bool indicating whether the flow is for upgrade
// Inputs: Source
// Outputs: None
struct InstallOrUpgradeSinglePackage : public WorkflowTask
{
InstallOrUpgradeSinglePackage(OperationType operation) :
WorkflowTask("InstallOrUpgradeSinglePackage"), m_operationType(operation) {}
void operator()(Execution::Context& context) const override;
private:
mutable OperationType m_operationType;
};
}