diff --git a/include/util/util.hpp b/include/util/util.hpp index 7d0e50f..db794e5 100755 --- a/include/util/util.hpp +++ b/include/util/util.hpp @@ -4,6 +4,8 @@ namespace inst::util { void initApp (); void deinitApp (); + void initInstallServices(); + void deinitInstallServices(); std::vector getDirectoryFiles(const std::string & dir, const std::vector & extensions); bool removeDirectory(std::string dir); bool copyFile(std::string inFile, std::string outFile); diff --git a/source/netInstall.cpp b/source/netInstall.cpp index 0f1c798..3c242ab 100755 --- a/source/netInstall.cpp +++ b/source/netInstall.cpp @@ -114,6 +114,7 @@ namespace netInstStuff{ void installNspLan(std::vector ourUrlList, int ourStorage) { + inst::util::initInstallServices(); appletLockExit(); inst::ui::loadInstallScreen(); bool nspInstalled = true; @@ -160,6 +161,7 @@ namespace netInstStuff{ printf("Done"); appletUnlockExit(); inst::ui::loadMainMenu(); + inst::util::deinitInstallServices(); return; } diff --git a/source/nspInstall.cpp b/source/nspInstall.cpp index c489387..4cc347a 100755 --- a/source/nspInstall.cpp +++ b/source/nspInstall.cpp @@ -81,6 +81,7 @@ namespace nspInstStuff { void installNspFromFile(std::vector ourNspList, int whereToInstall) { + inst::util::initInstallServices(); appletLockExit(); inst::ui::loadInstallScreen(); bool nspInstalled = true; @@ -145,6 +146,7 @@ namespace nspInstStuff { printf("Done"); appletUnlockExit(); inst::ui::loadMainMenu(); + inst::util::deinitInstallServices(); return; } } diff --git a/source/sigInstall.cpp b/source/sigInstall.cpp index 0963910..aa24b72 100755 --- a/source/sigInstall.cpp +++ b/source/sigInstall.cpp @@ -11,6 +11,7 @@ namespace inst::ui { namespace sig { void installSigPatches () { + bpcInitialize(); try { std::string patchesVersion = inst::util::readTextFromFile("sdmc:/atmosphere/exefs_patches/es_patches/patches.txt"); std::string versionText = ""; @@ -61,5 +62,6 @@ namespace sig { fprintf(stdout, "%s", e.what()); inst::ui::mainApp->CreateShowDialog("Failed to install Signature Patches!", (std::string)e.what(), {"OK"}, true); } + bpcExit(); } } \ No newline at end of file diff --git a/source/util/util.cpp b/source/util/util.cpp index 5fbeaaa..2f93a49 100755 --- a/source/util/util.cpp +++ b/source/util/util.cpp @@ -21,30 +21,28 @@ namespace inst::util { #ifdef __DEBUG__ nxlinkStdio(); #endif - plInitialize(); - setInitialize(); - ncmInitialize(); - nsInitialize(); - nsextInitialize(); - esInitialize(); - nifmInitialize(); - splCryptoInitialize(); - splInitialize(); - bpcInitialize(); } void deinitApp () { socketExit(); - plExit(); - setExit(); + } + + void initInstallServices() { + ncmInitialize(); + nsInitialize(); + nsextInitialize(); + esInitialize(); + splCryptoInitialize(); + splInitialize(); + } + + void deinitInstallServices() { ncmExit(); nsExit(); nsextExit(); esExit(); - nifmExit(); splCryptoExit(); splExit(); - bpcExit(); } std::vector getDirectoryFiles(const std::string & dir, const std::vector & extensions) {