Skip to content

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

Merged
yao-msft merged 2 commits into
microsoft:masterfrom
yao-msft:installnoupgrade
Nov 4, 2022
Merged

yao-msft merged 2 commits into
microsoft:masterfrom
yao-msft:installnoupgrade

Conversation

@yao-msft

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

Copy link
Copy Markdown
Contributor

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
Comment thread src/AppInstallerCommonCore/Errors.cpp Outdated
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
Copy Markdown
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

context.Reporter.Info() << Resource::String::Cancelled << std::endl;
return;
}
else if (searchContext.GetTerminationHR() == APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE)

Copy link
Copy Markdown
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.

<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
Copy Markdown
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