Check for import.db and title.db before attempting install

This commit is contained in:
d0k3 2020-08-05 21:47:21 +02:00
parent 3aa9a1633a
commit 0af181ac6a

View File

@ -2165,10 +2165,16 @@ u32 InstallGameFile(const char* path, bool to_emunand) {
else if (!((tid64 >> 32) & 0x10))
to_sd = true;
// does the title.db exist?
if ((to_sd && !fvx_qsize(to_emunand ? "B:/dbs/title.db" : "A:/dbs/title.db")) ||
(!to_sd && !fvx_qsize(to_emunand ? "4:/dbs/title.db" : "1:/dbs/title.db")))
return 1;
// does title.db & import.db exist?
if (to_sd) {
if (!fvx_qsize(to_emunand ? "B:/dbs/title.db" : "A:/dbs/title.db") ||
!fvx_qsize(to_emunand ? "B:/dbs/import.db" : "A:/dbs/import.db"))
return 1;
} else {
if (!fvx_qsize(to_emunand ? "4:/dbs/title.db" : "1:/dbs/title.db") ||
!fvx_qsize(to_emunand ? "4:/dbs/import.db" : "1:/dbs/import.db"))
return 1;
}
// now we know the correct drive
drv = to_emunand ? (to_sd ? "B:" : to_twl ? "5:" : "4:") :