summaryrefslogtreecommitdiff
path: root/view/sharedcache/core/DSCView.cpp
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-02-19 23:17:55 -0500
committerMason Reed <mason@vector35.com>2025-04-02 05:36:54 -0400
commitad337df11a3939dea833fc39d7ee555a427b9d09 (patch)
treef393f670f428eb6f2f621eeb3dc630caca62fdaf /view/sharedcache/core/DSCView.cpp
parent0d228d32f6087ea95d5de5235dd25aa6eeb7f406 (diff)
[SharedCache] Warn when loading BNDB with different shared cache metadata version
This does not actually give the user control to exit early, that looks to need core changes.
Diffstat (limited to 'view/sharedcache/core/DSCView.cpp')
-rw-r--r--view/sharedcache/core/DSCView.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/view/sharedcache/core/DSCView.cpp b/view/sharedcache/core/DSCView.cpp
index 782bbe30..aae1e3c4 100644
--- a/view/sharedcache/core/DSCView.cpp
+++ b/view/sharedcache/core/DSCView.cpp
@@ -195,6 +195,14 @@ bool DSCView::Init()
if (m_parseOnly)
return true;
+ // Check the metadata version if there is one, so we can alert the user to why they have no loaded images.
+ // TODO: Once the view is able to be exited early we should offer to close the view if the user does not want to upgrade.
+ auto metadataVersion = SharedCacheCore::SharedCacheMetadata::ViewMetadataVersion(GetParentView());
+ if (metadataVersion.has_value() && metadataVersion.value() != METADATA_VERSION)
+ {
+ ShowMessageBox("Invalid Shared Cache Metadata!", "The BNDB shared cache metadata was created with a different version of the Shared Cache view, to continue the metadata has to be recreated. You will need to add your images back again.");
+ }
+
// Add Mach-O file header type info
EnumerationBuilder cpuTypeBuilder;
cpuTypeBuilder.AddMemberWithValue("CPU_TYPE_ANY", MACHO_CPU_TYPE_ANY);