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,6 +56,7 @@ bool isValidUnlaunchInstallerSize(size_t size)
static bool removeHnaaLauncher() static bool removeHnaaLauncher()
{ {
auto* errString = [] -> const char* { auto* errString = [] -> const char* {
if(fileExists(hnaaTmdPath)) {
if(!toggleFileReadOnly(hnaaTmdPath, false)) 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";
@ -63,6 +64,7 @@ static bool removeHnaaLauncher()
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"))
{ {