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

Add ExpectedReturnCode::ReturnResponse for PackageInUseByApplication #2492

Merged
merged 1 commit into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
"type": "string",
"enum": [
"packageInUse",
"packageInUseByApplication",
"installInProgress",
"fileInUse",
"missingDependency",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
"type": "string",
"enum": [
"packageInUse",
"packageInUseByApplication",
"installInProgress",
"fileInUse",
"missingDependency",
Expand Down
1 change: 1 addition & 0 deletions src/AppInstallerCLICore/Resources.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ namespace AppInstaller::CLI::Resource
WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodeMissingDependency);
WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodeNoNetwork);
WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodePackageInUse);
WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodePackageInUseByApplication);
WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodeRebootInitiated);
WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodeRebootRequiredForInstall);
WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodeRebootRequiredToFinish);
Expand Down
2 changes: 2 additions & 0 deletions src/AppInstallerCLICore/Workflows/InstallFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ namespace AppInstaller::CLI::Workflow
{
case ExpectedReturnCodeEnum::PackageInUse:
return ExpectedReturnCode(returnCode, APPINSTALLER_CLI_ERROR_INSTALL_PACKAGE_IN_USE, Resource::String::InstallFlowReturnCodePackageInUse);
case ExpectedReturnCodeEnum::PackageInUseByApplication:
return ExpectedReturnCode(returnCode, APPINSTALLER_CLI_ERROR_INSTALL_PACKAGE_IN_USE_BY_APPLICATION, Resource::String::InstallFlowReturnCodePackageInUseByApplication);
case ExpectedReturnCodeEnum::InstallInProgress:
return ExpectedReturnCode(returnCode, APPINSTALLER_CLI_ERROR_INSTALL_INSTALL_IN_PROGRESS, Resource::String::InstallFlowReturnCodeInstallInProgress);
case ExpectedReturnCodeEnum::FileInUse:
Expand Down
3 changes: 3 additions & 0 deletions src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw
Original file line number Diff line number Diff line change
Expand Up @@ -1176,6 +1176,9 @@ Do you agree to the terms?</value>
<data name="InstallFlowReturnCodePackageInUse" xml:space="preserve">
<value>Application is currently running. Exit the application then try again.</value>
</data>
<data name="InstallFlowReturnCodePackageInUseByApplication" xml:space="preserve">
<value>Files modified by the installer are currently in use by a different application. Exit the applications then try again.</value>
</data>
<data name="InstallFlowReturnCodeInstallInProgress" xml:space="preserve">
<value>Another installation is already in progress. Try again later.</value>
</data>
Expand Down
4 changes: 4 additions & 0 deletions src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ namespace AppInstaller::Manifest
{
result = ExpectedReturnCodeEnum::PackageInUse;
}
if (inStrLower == "packageinusebyapplication")
{
result = ExpectedReturnCodeEnum::PackageInUseByApplication;
}
else if (inStrLower == "installinprogress")
{
result = ExpectedReturnCodeEnum::InstallInProgress;
Expand Down
1 change: 1 addition & 0 deletions src/AppInstallerCommonCore/Public/AppInstallerErrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
#define APPINSTALLER_CLI_ERROR_INSTALL_DOWNGRADE ((HRESULT)0x8A15010E)
#define APPINSTALLER_CLI_ERROR_INSTALL_BLOCKED_BY_POLICY ((HRESULT)0x8A15010F)
#define APPINSTALLER_CLI_ERROR_INSTALL_DEPENDENCIES ((HRESULT)0x8A150110)
#define APPINSTALLER_CLI_ERROR_INSTALL_PACKAGE_IN_USE_BY_APPLICATION ((HRESULT)0x8A150111)


namespace AppInstaller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ namespace AppInstaller::Manifest
{
Unknown,
PackageInUse,
PackageInUseByApplication,
InstallInProgress,
FileInUse,
MissingDependency,
Expand Down