From 48db1c1de532ea3b5b5f80262b3e6db30a011ac4 Mon Sep 17 00:00:00 2001 From: PabloMK7 Date: Wed, 20 Aug 2025 14:48:34 +0200 Subject: [PATCH] am: fix save data being deleted on CIA install failure (#1319) --- src/core/hle/service/am/am.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 7dd42cecc..1b8c97bae 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -864,8 +864,10 @@ bool CIAFile::Close() { if (!complete) { LOG_ERROR(Service_AM, "CIAFile closed prematurely, aborting install..."); if (!is_additional_content) { - FileUtil::DeleteDirRecursively( - GetTitlePath(media_type, container.GetTitleMetadata().GetTitleID())); + // Only delete the content folder as there may be user save data in the title folder. + const std::string title_content_path = + GetTitlePath(media_type, container.GetTitleMetadata().GetTitleID()) + "content/"; + FileUtil::DeleteDirRecursively(title_content_path); } return true; }