mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 21:52:48 +00:00
Handle cleanup before installs and after failed installs
This commit is contained in:
parent
4af0268e5a
commit
99b69754b2
@ -2301,6 +2301,10 @@ u32 InstallGameFile(const char* path, bool to_emunand) {
|
||||
// check permissions for SysNAND (this includes everything we need)
|
||||
if (!CheckWritePermissions(to_emunand ? "4:" : "1:")) return 1;
|
||||
|
||||
// cleanup content folder before starting install
|
||||
ShowProgress(0, 0, path);
|
||||
UninstallGameData(tid64, false, false, false, to_emunand);
|
||||
|
||||
// install game file
|
||||
if (filetype & GAME_CIA)
|
||||
ret = InstallFromCiaFile(path, drv);
|
||||
@ -2314,9 +2318,8 @@ u32 InstallGameFile(const char* path, bool to_emunand) {
|
||||
ret = BuildInstallFromNdsFile(path, drv, true);
|
||||
else ret = 1;
|
||||
|
||||
// we have no clue what to do on failure
|
||||
// if (ret != 0) ...
|
||||
// maybe just uninstall?
|
||||
// cleanup on failed installs, but leave ticket and save untouched
|
||||
if (ret != 0) UninstallGameData(tid64, true, false, false, to_emunand);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user