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

Support --no-upgrade option for install flow #2655

Merged
merged 2 commits into from
Nov 4, 2022

Conversation

yao-msft
Copy link
Contributor

@yao-msft yao-msft commented Nov 1, 2022

Related to #929

There are community asks to allow skipping package upgrade if any version is already installed.

Unit tests added.

Microsoft Reviewers: Open in CodeFlow

@yao-msft yao-msft requested a review from a team as a code owner November 1, 2022 18:59
@yao-msft yao-msft linked an issue Nov 1, 2022 that may be closed by this pull request
case APPINSTALLER_CLI_ERROR_INSTALL_PACKAGE_IN_USE:
return "Application is currently running.Exit the application then try again.";
return "Application is currently running. Exit the application then try again.";
case APPINSTALLER_CLI_ERROR_INSTALL_INSTALL_IN_PROGRESS:
return "Another installation is already in progress.Try again later.";
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Since you fixed the space above, might want to fix this one too

@@ -309,7 +309,8 @@ namespace AppInstaller::CLI::Workflow
context.Reporter.Info() << Resource::String::Cancelled << std::endl;
return;
}
else if (searchContext.GetTerminationHR() == APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE)
Copy link
Contributor

Choose a reason for hiding this comment

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

searchContext.GetTerminationHR()

Nit: should this be assigned to a variable so that it is not called 3 times within this if-else block.

@@ -1467,4 +1466,10 @@ Please specify one of them using the `--source` option to proceed.</value>
<value>Archive scan detected malware; proceeding due to --force</value>
<comment>{Locked="--force"}</comment>
</data>
<data name="NoUpgradeArgumentDescription" xml:space="preserve">
<value>Do not try to upgrade any installed version during install operation</value>
Copy link
Contributor

Choose a reason for hiding this comment

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

Do not try to upgrade any installed version during install operation

Nit: This sounds like a warning message rather than an argument description.

How about: "Skips upgrade if an installed version already exists"

@yao-msft yao-msft merged commit fb37675 into microsoft:master Nov 4, 2022
@yao-msft yao-msft deleted the installnoupgrade branch November 4, 2022 21:10
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.

winget should not install an already installed package
3 participants