commit f3946c298c91d21ccbfb1296c204a7a9f2c62d47 parent 9005a84b8803bcee3f8e83e298c7cb211468e184 Author: KEINOS <github+fork-qiita-news@keinos.com> Date: Sun, 15 Jun 2025 06:36:19 +0000 Merge remote-tracking branch 'upstream/master' Diffstat:
| M | src/AppInstallerCLICore/Workflows/PortableFlow.cpp | | | 9 | +++++++-- |
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/AppInstallerCLICore/Workflows/PortableFlow.cpp b/src/AppInstallerCLICore/Workflows/PortableFlow.cpp @@ -111,9 +111,14 @@ namespace AppInstaller::CLI::Workflow { Manifest::ScopeEnum scope = Manifest::ScopeEnum::Unknown; bool isUpdate = WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::InstallerExecutionUseUpdate); - if (isUpdate) + std::shared_ptr<Repository::IPackageVersion> installedVersion; + if (context.Contains(Execution::Data::InstalledPackageVersion)) { - IPackageVersion::Metadata installationMetadata = context.Get<Execution::Data::InstalledPackageVersion>()->GetMetadata(); + installedVersion = context.Get<Execution::Data::InstalledPackageVersion>(); + } + if (isUpdate && installedVersion) + { + IPackageVersion::Metadata installationMetadata = installedVersion->GetMetadata(); auto installerScopeItr = installationMetadata.find(Repository::PackageVersionMetadata::InstalledScope); if (installerScopeItr != installationMetadata.end()) {