Error handling for sigpatches installation, removed frivelous printfs

This commit is contained in:
Huntereb 2019-10-29 20:33:41 -04:00
parent 40224c7955
commit fad4defcd1
3 changed files with 35 additions and 28 deletions

View File

@ -123,7 +123,6 @@ namespace netInstStuff{
inst::ui::mainApp->CreateShowDialog(inst::util::shortenString(inst::util::formatUrlString(ourUrl), 64, true) + " installed!", "", {"OK"}, true);
}
catch (std::exception& e) {
printf("NSP_INSTALL_FAILED\n");
printf("Failed to install NSP");
printf("%s", e.what());
fprintf(stdout, "%s", e.what());

View File

@ -90,7 +90,6 @@ namespace nspInstStuff {
}
catch (std::exception& e)
{
printf("NSP_INSTALL_FAILED\n");
printf("Failed to install NSP");
printf("%s", e.what());
fprintf(stdout, "%s", e.what());

View File

@ -10,6 +10,7 @@ namespace inst::ui {
namespace sig {
void installSigPatches () {
try {
int ourResult = inst::ui::mainApp->CreateShowDialog("Install signature patches?", "Signature patches are required for installing and playing NSP contents!", {"Install", "Uninstall", "Cancel"}, true);
if (ourResult == 0) {
if (!inst::util::copyFile("sdmc:/bootloader/patches.ini", inst::config::appDir + "/patches.ini.old")) {
@ -38,4 +39,12 @@ namespace sig {
else inst::ui::mainApp->CreateShowDialog("Unable to remove signature patches", "Files may have been renamed or deleted", {"OK"}, true);
} else return;
}
catch (std::exception& e)
{
printf("Failed to install Signature Patches");
printf("%s", e.what());
fprintf(stdout, "%s", e.what());
inst::ui::mainApp->CreateShowDialog("Failed to install Signature Patches!", (std::string)e.what(), {"OK"}, true);
}
}
}