3
0
Fork 0
forked from suyu/suyu

Merge pull request #1403 from DarkLordZach/install-sysnand

qt: Install System TitleTypes to System NAND
This commit is contained in:
bunnei 2018-09-30 21:08:44 -04:00 committed by GitHub
commit decc319634
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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);
}
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);
}
const auto res = Service::FileSystem::GetUserNANDContents()->InstallEntry(
nca, static_cast<FileSys::TitleType>(index), false, qt_raw_copy);
if (res == FileSys::InstallResult::Success) {
success();
} else if (res == FileSys::InstallResult::ErrorAlreadyExists) {