diff --git a/src/AppInstallerRepositoryCore/PackageTrackingCatalog.cpp b/src/AppInstallerRepositoryCore/PackageTrackingCatalog.cpp index 5c5b18077e..9328786c65 100644 --- a/src/AppInstallerRepositoryCore/PackageTrackingCatalog.cpp +++ b/src/AppInstallerRepositoryCore/PackageTrackingCatalog.cpp @@ -214,7 +214,7 @@ namespace AppInstaller::Repository } PackageTrackingCatalog::Version PackageTrackingCatalog::RecordInstall( - const Manifest::Manifest& manifest, + Manifest::Manifest& manifest, const Manifest::ManifestInstaller& installer, bool isUpgrade) { @@ -224,16 +224,10 @@ namespace AppInstaller::Repository auto& index = m_implementation->Source->GetIndex(); // Strip ARP version information from the manifest if it is present - const Manifest::Manifest* effectiveManifest = &manifest; - Manifest::Manifest arpRangeRemovedManifest; - auto arpVersionRange = manifest.GetArpVersionRange(); if (!arpVersionRange.IsEmpty()) { - arpRangeRemovedManifest = manifest; - effectiveManifest = &arpRangeRemovedManifest; - - for (auto& arpRangeRemovedInstaller : arpRangeRemovedManifest.Installers) + for (auto& arpRangeRemovedInstaller : manifest.Installers) { for (auto& arpRangeRemovedEntry : arpRangeRemovedInstaller.AppsAndFeaturesEntries) { @@ -243,15 +237,15 @@ namespace AppInstaller::Repository } // Check for an existing manifest that matches this one (could be reinstalling) - auto manifestIdOpt = index.GetManifestIdByManifest(*effectiveManifest); + auto manifestIdOpt = index.GetManifestIdByManifest(manifest); if (manifestIdOpt) { - index.UpdateManifest(*effectiveManifest); + index.UpdateManifest(manifest); } else { - manifestIdOpt = index.AddManifest(*effectiveManifest); + manifestIdOpt = index.AddManifest(manifest); } SQLiteIndex::IdType manifestId = manifestIdOpt.value(); diff --git a/src/AppInstallerRepositoryCore/Public/winget/PackageTrackingCatalog.h b/src/AppInstallerRepositoryCore/Public/winget/PackageTrackingCatalog.h index 6b049f1cf7..f8963d37f8 100644 --- a/src/AppInstallerRepositoryCore/Public/winget/PackageTrackingCatalog.h +++ b/src/AppInstallerRepositoryCore/Public/winget/PackageTrackingCatalog.h @@ -59,7 +59,7 @@ namespace AppInstaller::Repository }; // Records an installation of the given package. - Version RecordInstall(const Manifest::Manifest& manifest, const Manifest::ManifestInstaller& installer, bool isUpgrade); + Version RecordInstall(Manifest::Manifest& manifest, const Manifest::ManifestInstaller& installer, bool isUpgrade); // Records an uninstall of the given package. void RecordUninstall(const Utility::LocIndString& packageIdentifier);