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
This commit is contained in:
Edoardo Lolletti 2024-04-25 22:44:53 +02:00
parent 71c1c21234
commit f6a503a2a3
2 changed files with 2 additions and 13 deletions

View File

@ -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);

View File

@ -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;
}