From b99aba7db72abd152e0e24dd3179c53f60233fae Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Mon, 24 Oct 2022 11:03:05 -0500 Subject: [PATCH 1/5] Add Expected Return Code for InvalidParameter --- .../v1.4.0/manifest.installer.1.4.0.json | 1 + .../v1.4.0/manifest.singleton.1.4.0.json | 1 + src/AppInstallerCLICore/Resources.h | 1 + .../Workflows/InstallFlow.cpp | 2 ++ .../Shared/Strings/en-us/winget.resw | 3 +++ .../Manifest/ManifestCommon.cpp | 21 ++++++++++++++++++- .../Public/AppInstallerErrors.h | 1 + .../Public/winget/ManifestCommon.h | 1 + .../1_4/Json/ManifestDeserializer_1_4.cpp | 4 ++++ 9 files changed, 34 insertions(+), 1 deletion(-) 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 index 452002b6f9..a955b65c62 100644 --- 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 @@ -228,6 +228,7 @@ "missingDependency", "diskFull", "insufficientMemory", + "invalidParameter", "noNetwork", "contactSupport", "rebootRequiredToFinish", 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 index d4c52aef94..2e6dc37806 100644 --- 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 @@ -270,6 +270,7 @@ "missingDependency", "diskFull", "insufficientMemory", + "invalidParameter", "noNetwork", "contactSupport", "rebootRequiredToFinish", diff --git a/src/AppInstallerCLICore/Resources.h b/src/AppInstallerCLICore/Resources.h index 12a997d28d..84fa57df52 100644 --- a/src/AppInstallerCLICore/Resources.h +++ b/src/AppInstallerCLICore/Resources.h @@ -156,6 +156,7 @@ namespace AppInstaller::CLI::Resource WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodeFileInUse); WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodeInstallInProgress); WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodeInsufficientMemory); + WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodeInvalidParameter); WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodeMissingDependency); WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodeNoNetwork); WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodePackageInUse); diff --git a/src/AppInstallerCLICore/Workflows/InstallFlow.cpp b/src/AppInstallerCLICore/Workflows/InstallFlow.cpp index bd2bad359c..aee04e8857 100644 --- a/src/AppInstallerCLICore/Workflows/InstallFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/InstallFlow.cpp @@ -128,6 +128,8 @@ namespace AppInstaller::CLI::Workflow return ExpectedReturnCode(returnCode, APPINSTALLER_CLI_ERROR_INSTALL_DISK_FULL, Resource::String::InstallFlowReturnCodeDiskFull); case ExpectedReturnCodeEnum::InsufficientMemory: return ExpectedReturnCode(returnCode, APPINSTALLER_CLI_ERROR_INSTALL_INSUFFICIENT_MEMORY, Resource::String::InstallFlowReturnCodeInsufficientMemory); + case ExpectedReturnCodeEnum::InvalidParameter: + return ExpectedReturnCode(returnCode, APPINSTALLER_CLI_ERROR_INSTALL_INVALID_PARAMETER, Resource::String::InstallFlowReturnCodeInvalidParameter); case ExpectedReturnCodeEnum::NoNetwork: return ExpectedReturnCode(returnCode, APPINSTALLER_CLI_ERROR_INSTALL_NO_NETWORK, Resource::String::InstallFlowReturnCodeNoNetwork); case ExpectedReturnCodeEnum::ContactSupport: diff --git a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw index 68fcd5cbea..f2d5bab400 100644 --- a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw +++ b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw @@ -1197,6 +1197,9 @@ Do you agree to the terms? There's not enough memory available to install. Close other applications then try again. + + One of the installation parameters is invalid. The package installation log may have additional details. + This application requires internet connectivity. Connect to a network then try again. diff --git a/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp b/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp index 39209385b0..a47b4c07b9 100644 --- a/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp +++ b/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp @@ -311,7 +311,7 @@ namespace AppInstaller::Manifest { result = ExpectedReturnCodeEnum::PackageInUse; } - if (inStrLower == "packageinusebyapplication") + else if (inStrLower == "packageinusebyapplication") { result = ExpectedReturnCodeEnum::PackageInUseByApplication; } @@ -335,6 +335,10 @@ namespace AppInstaller::Manifest { result = ExpectedReturnCodeEnum::InsufficientMemory; } + else if (inStrLower == "invalidparameter") + { + result = ExpectedReturnCodeEnum::InvalidParameter; + } else if (inStrLower == "nonetwork") { result = ExpectedReturnCodeEnum::NoNetwork; @@ -594,6 +598,10 @@ namespace AppInstaller::Manifest { ERROR_INSTALL_USEREXIT, ExpectedReturnCodeEnum::CancelledByUser }, { ERROR_PRODUCT_VERSION, ExpectedReturnCodeEnum::AlreadyInstalled }, { ERROR_INSTALL_REJECTED, ExpectedReturnCodeEnum::BlockedByPolicy }, + { ERROR_INVALID_PARAMETER, ExpectedReturnCodeEnum::InvalidParameter }, + { ERROR_INVALID_TABLE, ExpectedReturnCodeEnum::InvalidParameter }, + { ERROR_INVALID_COMMAND_LINE, ExpectedReturnCodeEnum::InvalidParameter }, + { ERROR_INVALID_PATCH_XML, ExpectedReturnCodeEnum::InvalidParameter }, }; case InstallerTypeEnum::Inno: // See https://jrsoftware.org/ishelp/index.php?topic=setupexitcodes @@ -614,6 +622,17 @@ namespace AppInstaller::Manifest { HRESULT_FROM_WIN32(ERROR_INSTALL_CANCEL), ExpectedReturnCodeEnum::CancelledByUser }, { HRESULT_FROM_WIN32(ERROR_PACKAGE_ALREADY_EXISTS), ExpectedReturnCodeEnum::AlreadyInstalled }, { HRESULT_FROM_WIN32(ERROR_INSTALL_PACKAGE_DOWNGRADE), ExpectedReturnCodeEnum::Downgrade }, + { HRESULT_FROM_WIN32(ERROR_DEPLOYMENT_BLOCKED_BY_POLICY), ExpectedReturnCodeEnum::BlockedByPolicy}, + { HRESULT_FROM_WIN32(ERROR_PACKAGES_IN_USE), ExpectedReturnCodeEnum::PackageInUse }, + { HRESULT_FROM_WIN32(APPX_E_INVALID_PACKAGING_LAYOUT), ExpectedReturnCodeEnum::InvalidParameter }, + { HRESULT_FROM_WIN32(APPX_E_INVALID_PACKAGESIGNCONFIG), ExpectedReturnCodeEnum::InvalidParameter }, + { HRESULT_FROM_WIN32(APPX_E_INVALID_ENCRYPTION_EXCLUSION_FILE_LIST), ExpectedReturnCodeEnum::InvalidParameter }, + { HRESULT_FROM_WIN32(APPX_E_INVALID_DELTA_PACKAGE), ExpectedReturnCodeEnum::InvalidParameter }, + { HRESULT_FROM_WIN32(APPX_E_INVALID_APPINSTALLER), ExpectedReturnCodeEnum::InvalidParameter }, + { HRESULT_FROM_WIN32(APPX_E_INVALID_CONTENTGROUPMAP), ExpectedReturnCodeEnum::InvalidParameter }, + { HRESULT_FROM_WIN32(APPX_E_INVALID_KEY_INFO), ExpectedReturnCodeEnum::InvalidParameter }, + { HRESULT_FROM_WIN32(APPX_E_INVALID_BLOCKMAP), ExpectedReturnCodeEnum::InvalidParameter }, + { HRESULT_FROM_WIN32(APPX_E_INVALID_MANIFEST), ExpectedReturnCodeEnum::InvalidParameter }, }; default: return {}; diff --git a/src/AppInstallerCommonCore/Public/AppInstallerErrors.h b/src/AppInstallerCommonCore/Public/AppInstallerErrors.h index 0264a41ba4..8204aff5d1 100644 --- a/src/AppInstallerCommonCore/Public/AppInstallerErrors.h +++ b/src/AppInstallerCommonCore/Public/AppInstallerErrors.h @@ -128,6 +128,7 @@ #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) +#define APPINSTALLER_CLI_ERROR_INSTALL_INVALID_PARAMETER ((HRESULT)0x8A150112) // Status values for check package installed status results. // Partial success has the success bit(first bit) set to 0. diff --git a/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h b/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h index 80401672b5..18772b5629 100644 --- a/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h +++ b/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h @@ -129,6 +129,7 @@ namespace AppInstaller::Manifest MissingDependency, DiskFull, InsufficientMemory, + InvalidParameter, NoNetwork, ContactSupport, RebootRequiredToFinish, diff --git a/src/AppInstallerRepositoryCore/Rest/Schema/1_4/Json/ManifestDeserializer_1_4.cpp b/src/AppInstallerRepositoryCore/Rest/Schema/1_4/Json/ManifestDeserializer_1_4.cpp index f5b01729c7..6d396b24d6 100644 --- a/src/AppInstallerRepositoryCore/Rest/Schema/1_4/Json/ManifestDeserializer_1_4.cpp +++ b/src/AppInstallerRepositoryCore/Rest/Schema/1_4/Json/ManifestDeserializer_1_4.cpp @@ -59,6 +59,10 @@ namespace AppInstaller::Repository::Rest::Schema::V1_4::Json { return ExpectedReturnCodeEnum::PackageInUseByApplication; } + else if (inStrLower == "invalidparameter") + { + return ExpectedReturnCodeEnum::InvalidParameter; + } return V1_1::Json::ManifestDeserializer::ConvertToExpectedReturnCodeEnum(inStrLower); } From 6865d2ed5d0bb1d3b02b04b46c0fb264250ae356 Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Mon, 24 Oct 2022 11:22:34 -0500 Subject: [PATCH 2/5] Add Expected Return Code for SystemNotSupported --- .../v1.4.0/manifest.installer.1.4.0.json | 1 + .../v1.4.0/manifest.singleton.1.4.0.json | 1 + src/AppInstallerCLICore/Resources.h | 1 + .../Workflows/InstallFlow.cpp | 2 ++ .../Shared/Strings/en-us/winget.resw | 3 +++ .../Manifest/ManifestCommon.cpp | 19 ++++++++++++++++++- .../Public/AppInstallerErrors.h | 1 + .../Public/winget/ManifestCommon.h | 1 + .../1_4/Json/ManifestDeserializer_1_4.cpp | 4 ++++ 9 files changed, 32 insertions(+), 1 deletion(-) 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 index a955b65c62..1c09ee9ae8 100644 --- 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 @@ -238,6 +238,7 @@ "alreadyInstalled", "downgrade", "blockedByPolicy", + "systemNotSupported", "custom" ] }, 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 index 2e6dc37806..cf0e9cc9b7 100644 --- 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 @@ -280,6 +280,7 @@ "alreadyInstalled", "downgrade", "blockedByPolicy", + "systemNotSupported", "custom" ] }, diff --git a/src/AppInstallerCLICore/Resources.h b/src/AppInstallerCLICore/Resources.h index 84fa57df52..7533e9aeba 100644 --- a/src/AppInstallerCLICore/Resources.h +++ b/src/AppInstallerCLICore/Resources.h @@ -164,6 +164,7 @@ namespace AppInstaller::CLI::Resource WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodeRebootInitiated); WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodeRebootRequiredForInstall); WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodeRebootRequiredToFinish); + WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowReturnCodeSystemNotSupported); WINGET_DEFINE_RESOURCE_STRINGID(InstallFlowStartingPackageInstall); WINGET_DEFINE_RESOURCE_STRINGID(InstallLocationNotProvided); WINGET_DEFINE_RESOURCE_STRINGID(InstallScopeDescription); diff --git a/src/AppInstallerCLICore/Workflows/InstallFlow.cpp b/src/AppInstallerCLICore/Workflows/InstallFlow.cpp index aee04e8857..d94a873392 100644 --- a/src/AppInstallerCLICore/Workflows/InstallFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/InstallFlow.cpp @@ -148,6 +148,8 @@ namespace AppInstaller::CLI::Workflow return ExpectedReturnCode(returnCode, APPINSTALLER_CLI_ERROR_INSTALL_DOWNGRADE, Resource::String::InstallFlowReturnCodeDowngrade); case ExpectedReturnCodeEnum::BlockedByPolicy: return ExpectedReturnCode(returnCode, APPINSTALLER_CLI_ERROR_INSTALL_BLOCKED_BY_POLICY, Resource::String::InstallFlowReturnCodeBlockedByPolicy); + case ExpectedReturnCodeEnum::SystemNotSupported: + return ExpectedReturnCode(returnCode, APPINSTALLER_CLI_ERROR_INSTALL_SYSTEM_NOT_SUPPORTED, Resource::String::InstallFlowReturnCodeSystemNotSupported); default: THROW_HR(E_UNEXPECTED); } diff --git a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw index f2d5bab400..b626cc7228 100644 --- a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw +++ b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw @@ -1227,6 +1227,9 @@ Do you agree to the terms? Organization policies are preventing installation. Contact your admin. + + Your system configuration does not support the installation of this package. + Installation abandoned diff --git a/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp b/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp index a47b4c07b9..f6273d09d6 100644 --- a/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp +++ b/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp @@ -375,6 +375,10 @@ namespace AppInstaller::Manifest { result = ExpectedReturnCodeEnum::BlockedByPolicy; } + else if (inStrLower == "systemnotsupported") + { + result = ExpectedReturnCodeEnum::SystemNotSupported; + } else if (inStrLower == "custom") { result = ExpectedReturnCodeEnum::Custom; @@ -597,11 +601,18 @@ namespace AppInstaller::Manifest { ERROR_SUCCESS_REBOOT_INITIATED, ExpectedReturnCodeEnum::RebootInitiated }, { ERROR_INSTALL_USEREXIT, ExpectedReturnCodeEnum::CancelledByUser }, { ERROR_PRODUCT_VERSION, ExpectedReturnCodeEnum::AlreadyInstalled }, - { ERROR_INSTALL_REJECTED, ExpectedReturnCodeEnum::BlockedByPolicy }, + { ERROR_INSTALL_REJECTED, ExpectedReturnCodeEnum::SystemNotSupported }, + { ERROR_INSTALL_PACKAGE_REJECTED, ExpectedReturnCodeEnum::BlockedByPolicy }, + { ERROR_INSTALL_TRANSFORM_REJECTED, ExpectedReturnCodeEnum::BlockedByPolicy }, + { ERROR_PATCH_PACKAGE_REJECTED, ExpectedReturnCodeEnum::BlockedByPolicy }, + { ERROR_PATCH_REMOVAL_DISALLOWED, ExpectedReturnCodeEnum::BlockedByPolicy }, + { ERROR_INSTALL_REMOTE_DISALLOWED, ExpectedReturnCodeEnum::BlockedByPolicy }, { ERROR_INVALID_PARAMETER, ExpectedReturnCodeEnum::InvalidParameter }, { ERROR_INVALID_TABLE, ExpectedReturnCodeEnum::InvalidParameter }, { ERROR_INVALID_COMMAND_LINE, ExpectedReturnCodeEnum::InvalidParameter }, { ERROR_INVALID_PATCH_XML, ExpectedReturnCodeEnum::InvalidParameter }, + { ERROR_INSTALL_LANGUAGE_UNSUPPORTED, ExpectedReturnCodeEnum::SystemNotSupported }, + { ERROR_INSTALL_PLATFORM_UNSUPPORTED, ExpectedReturnCodeEnum::SystemNotSupported }, }; case InstallerTypeEnum::Inno: // See https://jrsoftware.org/ishelp/index.php?topic=setupexitcodes @@ -623,6 +634,7 @@ namespace AppInstaller::Manifest { HRESULT_FROM_WIN32(ERROR_PACKAGE_ALREADY_EXISTS), ExpectedReturnCodeEnum::AlreadyInstalled }, { HRESULT_FROM_WIN32(ERROR_INSTALL_PACKAGE_DOWNGRADE), ExpectedReturnCodeEnum::Downgrade }, { HRESULT_FROM_WIN32(ERROR_DEPLOYMENT_BLOCKED_BY_POLICY), ExpectedReturnCodeEnum::BlockedByPolicy}, + { HRESULT_FROM_WIN32(ERROR_INSTALL_POLICY_FAILURE), ExpectedReturnCodeEnum::BlockedByPolicy}, { HRESULT_FROM_WIN32(ERROR_PACKAGES_IN_USE), ExpectedReturnCodeEnum::PackageInUse }, { HRESULT_FROM_WIN32(APPX_E_INVALID_PACKAGING_LAYOUT), ExpectedReturnCodeEnum::InvalidParameter }, { HRESULT_FROM_WIN32(APPX_E_INVALID_PACKAGESIGNCONFIG), ExpectedReturnCodeEnum::InvalidParameter }, @@ -633,6 +645,11 @@ namespace AppInstaller::Manifest { HRESULT_FROM_WIN32(APPX_E_INVALID_KEY_INFO), ExpectedReturnCodeEnum::InvalidParameter }, { HRESULT_FROM_WIN32(APPX_E_INVALID_BLOCKMAP), ExpectedReturnCodeEnum::InvalidParameter }, { HRESULT_FROM_WIN32(APPX_E_INVALID_MANIFEST), ExpectedReturnCodeEnum::InvalidParameter }, + { HRESULT_FROM_WIN32(E_INVALIDARG), ExpectedReturnCodeEnum::InvalidParameter }, + { HRESULT_FROM_WIN32(ERROR_INSTALL_WRONG_PROCESSOR_ARCHITECTURE), ExpectedReturnCodeEnum::SystemNotSupported }, + { HRESULT_FROM_WIN32(ERROR_PACKAGE_NOT_SUPPORTED_ON_FILESYSTEM), ExpectedReturnCodeEnum::SystemNotSupported }, + { HRESULT_FROM_WIN32(ERROR_DEPLOYMENT_OPTION_NOT_SUPPORTED), ExpectedReturnCodeEnum::SystemNotSupported }, + { HRESULT_FROM_WIN32(ERROR_PACKAGE_LACKS_CAPABILITY_TO_DEPLOY_ON_HOST), ExpectedReturnCodeEnum::SystemNotSupported }, }; default: return {}; diff --git a/src/AppInstallerCommonCore/Public/AppInstallerErrors.h b/src/AppInstallerCommonCore/Public/AppInstallerErrors.h index 8204aff5d1..fdde7df584 100644 --- a/src/AppInstallerCommonCore/Public/AppInstallerErrors.h +++ b/src/AppInstallerCommonCore/Public/AppInstallerErrors.h @@ -129,6 +129,7 @@ #define APPINSTALLER_CLI_ERROR_INSTALL_DEPENDENCIES ((HRESULT)0x8A150110) #define APPINSTALLER_CLI_ERROR_INSTALL_PACKAGE_IN_USE_BY_APPLICATION ((HRESULT)0x8A150111) #define APPINSTALLER_CLI_ERROR_INSTALL_INVALID_PARAMETER ((HRESULT)0x8A150112) +#define APPINSTALLER_CLI_ERROR_INSTALL_SYSTEM_NOT_SUPPORTED ((HRESULT)0x8A150113) // Status values for check package installed status results. // Partial success has the success bit(first bit) set to 0. diff --git a/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h b/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h index 18772b5629..e69bf4e2de 100644 --- a/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h +++ b/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h @@ -139,6 +139,7 @@ namespace AppInstaller::Manifest AlreadyInstalled, Downgrade, BlockedByPolicy, + SystemNotSupported, Custom, }; diff --git a/src/AppInstallerRepositoryCore/Rest/Schema/1_4/Json/ManifestDeserializer_1_4.cpp b/src/AppInstallerRepositoryCore/Rest/Schema/1_4/Json/ManifestDeserializer_1_4.cpp index 6d396b24d6..05b606882a 100644 --- a/src/AppInstallerRepositoryCore/Rest/Schema/1_4/Json/ManifestDeserializer_1_4.cpp +++ b/src/AppInstallerRepositoryCore/Rest/Schema/1_4/Json/ManifestDeserializer_1_4.cpp @@ -63,6 +63,10 @@ namespace AppInstaller::Repository::Rest::Schema::V1_4::Json { return ExpectedReturnCodeEnum::InvalidParameter; } + else if (inStrLower == "systemnotsupported") + { + return ExpectedReturnCodeEnum::SystemNotSupported; + } return V1_1::Json::ManifestDeserializer::ConvertToExpectedReturnCodeEnum(inStrLower); } From 53ad8e1023d2d092313fda685737307a45620569 Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Mon, 24 Oct 2022 11:30:23 -0500 Subject: [PATCH 3/5] Fix build error --- src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp b/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp index f6273d09d6..b0b5e32135 100644 --- a/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp +++ b/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp @@ -636,6 +636,9 @@ namespace AppInstaller::Manifest { HRESULT_FROM_WIN32(ERROR_DEPLOYMENT_BLOCKED_BY_POLICY), ExpectedReturnCodeEnum::BlockedByPolicy}, { HRESULT_FROM_WIN32(ERROR_INSTALL_POLICY_FAILURE), ExpectedReturnCodeEnum::BlockedByPolicy}, { HRESULT_FROM_WIN32(ERROR_PACKAGES_IN_USE), ExpectedReturnCodeEnum::PackageInUse }, + /* + * For the below return codes, 'argument': conversion from 'HRESULT' to 'unsigned long', signed/unsigned mismatch + * { HRESULT_FROM_WIN32(APPX_E_INVALID_PACKAGING_LAYOUT), ExpectedReturnCodeEnum::InvalidParameter }, { HRESULT_FROM_WIN32(APPX_E_INVALID_PACKAGESIGNCONFIG), ExpectedReturnCodeEnum::InvalidParameter }, { HRESULT_FROM_WIN32(APPX_E_INVALID_ENCRYPTION_EXCLUSION_FILE_LIST), ExpectedReturnCodeEnum::InvalidParameter }, @@ -646,6 +649,8 @@ namespace AppInstaller::Manifest { HRESULT_FROM_WIN32(APPX_E_INVALID_BLOCKMAP), ExpectedReturnCodeEnum::InvalidParameter }, { HRESULT_FROM_WIN32(APPX_E_INVALID_MANIFEST), ExpectedReturnCodeEnum::InvalidParameter }, { HRESULT_FROM_WIN32(E_INVALIDARG), ExpectedReturnCodeEnum::InvalidParameter }, + * + */ { HRESULT_FROM_WIN32(ERROR_INSTALL_WRONG_PROCESSOR_ARCHITECTURE), ExpectedReturnCodeEnum::SystemNotSupported }, { HRESULT_FROM_WIN32(ERROR_PACKAGE_NOT_SUPPORTED_ON_FILESYSTEM), ExpectedReturnCodeEnum::SystemNotSupported }, { HRESULT_FROM_WIN32(ERROR_DEPLOYMENT_OPTION_NOT_SUPPORTED), ExpectedReturnCodeEnum::SystemNotSupported }, From ac7a913965eea25e45cc177a6864040640f31c0c Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Mon, 24 Oct 2022 11:31:46 -0500 Subject: [PATCH 4/5] Make error message more generic --- src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw index b626cc7228..a9998cbb6c 100644 --- a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw +++ b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw @@ -1228,7 +1228,7 @@ Do you agree to the terms? Organization policies are preventing installation. Contact your admin. - Your system configuration does not support the installation of this package. + The current system configuration does not support the installation of this package. Installation abandoned From 01789e4d8527952bc9bffa77d67d1563db20ff8e Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Tue, 25 Oct 2022 20:29:08 -0500 Subject: [PATCH 5/5] Remove commented return codes --- .../Manifest/ManifestCommon.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp b/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp index b0b5e32135..d6c194a5af 100644 --- a/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp +++ b/src/AppInstallerCommonCore/Manifest/ManifestCommon.cpp @@ -636,21 +636,6 @@ namespace AppInstaller::Manifest { HRESULT_FROM_WIN32(ERROR_DEPLOYMENT_BLOCKED_BY_POLICY), ExpectedReturnCodeEnum::BlockedByPolicy}, { HRESULT_FROM_WIN32(ERROR_INSTALL_POLICY_FAILURE), ExpectedReturnCodeEnum::BlockedByPolicy}, { HRESULT_FROM_WIN32(ERROR_PACKAGES_IN_USE), ExpectedReturnCodeEnum::PackageInUse }, - /* - * For the below return codes, 'argument': conversion from 'HRESULT' to 'unsigned long', signed/unsigned mismatch - * - { HRESULT_FROM_WIN32(APPX_E_INVALID_PACKAGING_LAYOUT), ExpectedReturnCodeEnum::InvalidParameter }, - { HRESULT_FROM_WIN32(APPX_E_INVALID_PACKAGESIGNCONFIG), ExpectedReturnCodeEnum::InvalidParameter }, - { HRESULT_FROM_WIN32(APPX_E_INVALID_ENCRYPTION_EXCLUSION_FILE_LIST), ExpectedReturnCodeEnum::InvalidParameter }, - { HRESULT_FROM_WIN32(APPX_E_INVALID_DELTA_PACKAGE), ExpectedReturnCodeEnum::InvalidParameter }, - { HRESULT_FROM_WIN32(APPX_E_INVALID_APPINSTALLER), ExpectedReturnCodeEnum::InvalidParameter }, - { HRESULT_FROM_WIN32(APPX_E_INVALID_CONTENTGROUPMAP), ExpectedReturnCodeEnum::InvalidParameter }, - { HRESULT_FROM_WIN32(APPX_E_INVALID_KEY_INFO), ExpectedReturnCodeEnum::InvalidParameter }, - { HRESULT_FROM_WIN32(APPX_E_INVALID_BLOCKMAP), ExpectedReturnCodeEnum::InvalidParameter }, - { HRESULT_FROM_WIN32(APPX_E_INVALID_MANIFEST), ExpectedReturnCodeEnum::InvalidParameter }, - { HRESULT_FROM_WIN32(E_INVALIDARG), ExpectedReturnCodeEnum::InvalidParameter }, - * - */ { HRESULT_FROM_WIN32(ERROR_INSTALL_WRONG_PROCESSOR_ARCHITECTURE), ExpectedReturnCodeEnum::SystemNotSupported }, { HRESULT_FROM_WIN32(ERROR_PACKAGE_NOT_SUPPORTED_ON_FILESYSTEM), ExpectedReturnCodeEnum::SystemNotSupported }, { HRESULT_FROM_WIN32(ERROR_DEPLOYMENT_OPTION_NOT_SUPPORTED), ExpectedReturnCodeEnum::SystemNotSupported },