WiiUtils: Warn before overwriting during WAD import

This commit is contained in:
Léo Lam 2017-10-01 12:46:38 +02:00
parent 0bdeb63894
commit 6a03a24822

View file

@ -122,6 +122,15 @@ bool InstallWAD(const std::string& wad_path)
if (wad.GetTMD().GetContents() == installed_contents) if (wad.GetTMD().GetContents() == installed_contents)
return true; return true;
// If a different version is currently installed, warn the user to make sure
// they don't overwrite the current version by mistake.
if (ios.GetES()->FindInstalledTMD(wad.GetTMD().GetTitleId()).IsValid() &&
!AskYesNoT("A different version of this title is already installed on the NAND. "
"Installing this WAD will replace it irreversibly. Continue?"))
{
return false;
}
const bool result = InstallWAD(ios, wad); const bool result = InstallWAD(ios, wad);
DiscIO::NANDContentManager::Access().ClearCache(); DiscIO::NANDContentManager::Access().ClearCache();