diff --git a/src/AppInstallerCLICore/Workflows/InstallFlow.cpp b/src/AppInstallerCLICore/Workflows/InstallFlow.cpp index d27fee0ebe..31ce9e53c2 100644 --- a/src/AppInstallerCLICore/Workflows/InstallFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/InstallFlow.cpp @@ -551,7 +551,6 @@ namespace AppInstaller::CLI::Workflow { context.Reporter.Info() << Resource::String::InstallFlowInstallSuccess << std::endl; } - } } diff --git a/src/AppInstallerCLICore/Workflows/RepairFlow.cpp b/src/AppInstallerCLICore/Workflows/RepairFlow.cpp index 5c97a688dd..bb60b079d4 100644 --- a/src/AppInstallerCLICore/Workflows/RepairFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/RepairFlow.cpp @@ -441,9 +441,23 @@ namespace AppInstaller::CLI::Workflow AICLI_TERMINATE_CONTEXT(APPINSTALLER_CLI_ERROR_NO_APPLICABLE_INSTALLER); } + std::string_view requestedVersion = context.Args.Contains(Execution::Args::Type::Version) ? context.Args.GetArg(Execution::Args::Type::Version) : installedVersion.ToString(); + // If it's Store source with only one version unknown, use the unknown version for available version mapping. + const auto& package = context.Get(); + auto versionKeys = package->GetAvailableVersionKeys(); + if (versionKeys.size() == 1) + { + auto packageVersion = package->GetAvailableVersion(versionKeys.at(0)); + if (packageVersion->GetSource().IsWellKnownSource(WellKnownSource::MicrosoftStore) && + Utility::Version{ packageVersion->GetProperty(PackageVersionProperty::Version) }.IsUnknown()) + { + requestedVersion = ""; + } + } + context << GetManifestWithVersionFromPackage( - context.Args.Contains(Execution::Args::Type::Version) ? context.Args.GetArg(Execution::Args::Type::Version) : installedVersion.ToString(), + requestedVersion, context.Args.GetArg(Execution::Args::Type::Channel), false) << SelectInstaller << EnsureApplicableInstaller;