Try to mark HNAA tmd as writable only if it exists

This commit is contained in:
Edoardo Lolletti 2025-08-18 01:30:24 +02:00
parent 773fe2b7a5
commit 979ed83640

View File

@ -56,14 +56,16 @@ bool isValidUnlaunchInstallerSize(size_t size)
static bool removeHnaaLauncher() static bool removeHnaaLauncher()
{ {
auto* errString = [] -> const char* { auto* errString = [] -> const char* {
if(!toggleFileReadOnly(hnaaTmdPath, false)) if(fileExists(hnaaTmdPath)) {
{ if(!toggleFileReadOnly(hnaaTmdPath, false))
return "\x1B[31mError:\x1B[33m Failed to mark unlaunch's title.tmd as writable\nLeaving as is\n"; {
} return "\x1B[31mError:\x1B[33m Failed to mark unlaunch's title.tmd as writable\nLeaving as is\n";
if(!removeIfExists(hnaaTmdPath)) }
{ if(!removeIfExists(hnaaTmdPath))
return "\x1B[31mError:\x1B[33m Failed to delete ulnaunch's title.tmd\n"; {
} return "\x1B[31mError:\x1B[33m Failed to delete ulnaunch's title.tmd\n";
}
}
if(!removeIfExists("nand:/title/00030017/484e4141/content")) if(!removeIfExists("nand:/title/00030017/484e4141/content"))
{ {
return "\x1B[31mError:\x1B[33m Failed to delete ulnaunch's content folder\n"; return "\x1B[31mError:\x1B[33m Failed to delete ulnaunch's content folder\n";