commit 4cd4cc4a4cf0f974c08cc7ee24b66c77bfb7be08 parent 993de6b6996023c399071be59fdf35ba60cd1d83 Author: Kaleb Luedtke <jluedtk@jci.com> Date: Wed, 14 Sep 2022 16:34:27 -0500 Add ExpectedReturnCode::ReturnResponse for PackageInUseByApplication (#2492) Diffstat:
8 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/schemas/JSON/manifests/v1.4.0/manifest.installer.1.4.0.json b/schemas/JSON/manifests/v1.4.0/manifest.installer.1.4.0.json @@ -222,6 +222,7 @@ "type": "string", "enum": [ "packageInUse", + "packageInUseByApplication", "installInProgress", "fileInUse", "missingDependency", diff --git a/schemas/JSON/manifests/v1.4.0/manifest.singleton.1.4.0.json b/schemas/JSON/manifests/v1.4.0/manifest.singleton.1.4.0.json @@ -264,6 +264,7 @@ "type": "string", "enum": [ "packageInUse", + "packageInUseByApplication", "installInProgress", "fileInUse", "missingDependency", diff --git a/src/AppInstallerCLICore/Resources.h b/src/AppInstallerCLICore/Resources.h @@ -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); diff --git a/src/AppInstallerCLICore/Workflows/InstallFlow.cpp b/src/AppInstallerCLICore/Workflows/InstallFlow.cpp @@ -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: diff --git a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw @@ -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> diff --git a/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp b/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp @@ -311,6 +311,10 @@ namespace AppInstaller::Manifest { result = ExpectedReturnCodeEnum::PackageInUse; } + if (inStrLower == "packageinusebyapplication") + { + result = ExpectedReturnCodeEnum::PackageInUseByApplication; + } else if (inStrLower == "installinprogress") { result = ExpectedReturnCodeEnum::InstallInProgress; diff --git a/src/AppInstallerCommonCore/Public/AppInstallerErrors.h b/src/AppInstallerCommonCore/Public/AppInstallerErrors.h @@ -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 diff --git a/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h b/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h @@ -123,6 +123,7 @@ namespace AppInstaller::Manifest { Unknown, PackageInUse, + PackageInUseByApplication, InstallInProgress, FileInUse, MissingDependency,