From f6a503a2a39c6fd4f7fab0f8c793380ecb1b8e46 Mon Sep 17 00:00:00 2001 From: Edoardo Lolletti Date: Thu, 25 Apr 2024 22:44:53 +0200 Subject: [PATCH] Directly disable install option if an unlaunch version is found to be already installed The user will have to explicitly uninstall first and then reinstall --- arm9/src/main.c | 2 +- arm9/src/unlaunch.cpp | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/arm9/src/main.c b/arm9/src/main.c index 1506e9f..90117a4 100644 --- a/arm9/src/main.c +++ b/arm9/src/main.c @@ -66,7 +66,7 @@ static int mainMenu(int cursor) char uninstallStr[32], installStr[32]; sprintf(uninstallStr, "\x1B[%02omUninstall unlaunch", unlaunchFound ? 047 : 037); - sprintf(installStr, "\x1B[%02omInstall unlaunch", unlaunchInstallerFound ? 047 : 037); + sprintf(installStr, "\x1B[%02omInstall unlaunch", unlaunchInstallerFound && !unlaunchFound ? 047 : 037); addMenuItem(m, uninstallStr, NULL, 0); addMenuItem(m, installStr, NULL, 0); addMenuItem(m, "\x1B[47mExit", NULL, 0); diff --git a/arm9/src/unlaunch.cpp b/arm9/src/unlaunch.cpp index e1db1f4..8542e28 100644 --- a/arm9/src/unlaunch.cpp +++ b/arm9/src/unlaunch.cpp @@ -128,18 +128,7 @@ static bool patchMainTmd(const char* path) fclose(launcherTmd); return false; } - if (getFileSize(launcherTmd) > 520) { - // Remove unlaunch if it already exists on the main launcher tmd. - // If we don't do this and unlaunch is on the tmd, it will take over and prevent loading HNAA - messageBox("Unlaunch is already installed \nwith the legacy method\nTrying to remove...\n"); - if (ftruncate(fileno(launcherTmd), 520) != 0) { - messageBox("\x1B[31mError:\x1B[33m Failed to remove old unlaunch\n"); - fclose(launcherTmd); - return false; - } - fclose(launcherTmd); - return true; - } + fclose(launcherTmd); return true; }