qt: Install System TitleTypes to System NAND

Fixes an issue where installed system archive NCAs would be installed to user NAND and not recognized by games.
This commit is contained in:
Zach Hilman 2018-09-27 09:19:53 -04:00
parent 7b81e1e525
commit 70e86248fd
1 changed files with 14 additions and 4 deletions

View File

@ -1055,11 +1055,21 @@ void GMainWindow::OnMenuInstallToNAND() {
return;
}
if (index >= 5)
index += 0x7B;
// If index is equal to or past Game, add the jump in TitleType.
if (index >= 5) {
index += static_cast<size_t>(FileSys::TitleType::Application) -
static_cast<size_t>(FileSys::TitleType::FirmwarePackageB);
}
const auto res = Service::FileSystem::GetUserNANDContents()->InstallEntry(
FileSys::InstallResult res;
if (index >= static_cast<size_t>(FileSys::TitleType::Application)) {
res = Service::FileSystem::GetUserNANDContents()->InstallEntry(
nca, static_cast<FileSys::TitleType>(index), false, qt_raw_copy);
} else {
res = Service::FileSystem::GetSystemNANDContents()->InstallEntry(
nca, static_cast<FileSys::TitleType>(index), false, qt_raw_copy);
}
if (res == FileSys::InstallResult::Success) {
success();
} else if (res == FileSys::InstallResult::ErrorAlreadyExists) {