Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Install flow aware of package installed status #2539

Merged
merged 20 commits into from
Oct 9, 2022

Conversation

yao-msft
Copy link
Contributor

@yao-msft yao-msft commented Sep 21, 2022

  • Make install flow detect installed packages and convert to upgrade flow accordingly
  • Install flow will now always select for latest applicable version
  • Add dedicated "ignore-security-hash" argument for installer hash check override
  • Added unit tests and e2e tests
Microsoft Reviewers: Open in CodeFlow

@yao-msft yao-msft marked this pull request as ready for review September 24, 2022 00:36
@yao-msft yao-msft requested a review from a team as a code owner September 24, 2022 00:36
Workflow::GetManifestFromArg <<
Workflow::SelectInstaller <<
Workflow::EnsureApplicableInstaller <<
Workflow::InstallSinglePackage;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't install from a manifest behave as an upgrade as well (when appropriate)?

Workflow::EnsureApplicableInstaller <<
Workflow::CheckForUnsupportedArgs <<
Workflow::InstallSinglePackage;
if (context.Args.Contains(Execution::Args::Type::Manifest))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

side note: I've thought that it would be great to collapse the manifest flow into the normal one by making OpenSource create a simple in-memory source for the manifest so that it could behave exactly as everything else.

@@ -316,7 +316,7 @@ They can be configured through the settings file 'winget settings'.</value>
<comment>Links to different webpages</comment>
</data>
<data name="ListCommandLongDescription" xml:space="preserve">
<value>The list command displays the packages installed on the system, as well as whether an update is available. Additional options can be provided to filter the output, much like the search command.</value>
<value>The list command displays the packages installed on the system, as well as whether an upgrade is available. Additional options can be provided to filter the output, much like the search command.</value>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update install command description to include the new behavior of changing to upgrade?

Workflow::OpenCompositeSource(Repository::PredefinedSource::Installed, false, Repository::CompositeSearchBehavior::AvailablePackages);
}

context << Workflow::InstallOrUpgradeSinglePackage(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this also need to be applied to import? More specifically, does import need to be calling InstallOrUpgradeSinglePackage?

@yao-msft yao-msft merged commit d54c5a3 into microsoft:master Oct 9, 2022
@yao-msft yao-msft deleted the mergeinstallupgrade branch October 9, 2022 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants