diff --git a/src/AppInstallerCLICore/Commands/RootCommand.cpp b/src/AppInstallerCLICore/Commands/RootCommand.cpp index ecc608bed4..098878d6fa 100644 --- a/src/AppInstallerCLICore/Commands/RootCommand.cpp +++ b/src/AppInstallerCLICore/Commands/RootCommand.cpp @@ -173,6 +173,8 @@ namespace AppInstaller::CLI info << std::endl << "Windows: "_liv << Runtime::GetOSVersion() << std::endl; + info << Resource::String::SystemArchitecture << ": "_liv << Utility::ToString(Utility::GetSystemArchitecture()) << std::endl; + if (Runtime::IsRunningInPackagedContext()) { info << Resource::String::Package << ": "_liv << Runtime::GetPackageVersion() << std::endl; diff --git a/src/AppInstallerCLICore/Resources.h b/src/AppInstallerCLICore/Resources.h index 9fa6921885..5f355bdf8e 100644 --- a/src/AppInstallerCLICore/Resources.h +++ b/src/AppInstallerCLICore/Resources.h @@ -318,6 +318,7 @@ namespace AppInstaller::CLI::Resource WINGET_DEFINE_RESOURCE_STRINGID(SourceUpdateCommandLongDescription); WINGET_DEFINE_RESOURCE_STRINGID(SourceUpdateCommandShortDescription); WINGET_DEFINE_RESOURCE_STRINGID(SourceUpdateOne); + WINGET_DEFINE_RESOURCE_STRINGID(SystemArchitecture); WINGET_DEFINE_RESOURCE_STRINGID(TagArgumentDescription); WINGET_DEFINE_RESOURCE_STRINGID(ThankYou); WINGET_DEFINE_RESOURCE_STRINGID(ThirdPartSoftwareNotices); diff --git a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw index cced9e4e1d..47239ab436 100644 --- a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw +++ b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw @@ -1272,4 +1272,7 @@ Please specify one of them using the `--source` option to proceed. The arguments provided can only be used with a query. + + System Architecture + \ No newline at end of file diff --git a/src/AppInstallerCommonCore/Architecture.cpp b/src/AppInstallerCommonCore/Architecture.cpp index 2e40069dcc..93d1fe8a34 100644 --- a/src/AppInstallerCommonCore/Architecture.cpp +++ b/src/AppInstallerCommonCore/Architecture.cpp @@ -8,6 +8,7 @@ namespace AppInstaller::Utility { + using namespace literals; namespace { // IsWow64GuestMachineSupported() is available starting on Windows 10, version 1709 (RS3). @@ -186,23 +187,23 @@ namespace AppInstaller::Utility return Architecture::Unknown; } - std::string_view ToString(Architecture architecture) + LocIndView ToString(Architecture architecture) { switch (architecture) { case Architecture::Neutral: - return "Neutral"sv; + return "Neutral"_liv; case Architecture::X86: - return "X86"sv; + return "X86"_liv; case Architecture::X64: - return "X64"sv; + return "X64"_liv; case Architecture::Arm: - return "Arm"sv; + return "Arm"_liv; case Architecture::Arm64: - return "Arm64"sv; + return "Arm64"_liv; } - return "Unknown"sv; + return "Unknown"_liv; } Architecture GetSystemArchitecture() diff --git a/src/AppInstallerCommonCore/Public/AppInstallerArchitecture.h b/src/AppInstallerCommonCore/Public/AppInstallerArchitecture.h index c25bb54458..5e20cf14e2 100644 --- a/src/AppInstallerCommonCore/Public/AppInstallerArchitecture.h +++ b/src/AppInstallerCommonCore/Public/AppInstallerArchitecture.h @@ -3,6 +3,7 @@ #pragma once #include +#include namespace AppInstaller::Utility { @@ -22,7 +23,7 @@ namespace AppInstaller::Utility Architecture ConvertToArchitectureEnum(const std::string& archStr); // Converts an Architecture to a string_view - std::string_view ToString(Architecture architecture); + LocIndView ToString(Architecture architecture); // Gets the system's architecture as Architecture enum AppInstaller::Utility::Architecture GetSystemArchitecture();