Cleanup previously installed contents when installing anew

This commit is contained in:
Huntereb 2019-12-21 15:14:04 -05:00
parent 49651f448b
commit c861c7d85c
2 changed files with 12 additions and 4 deletions

View file

@ -91,11 +91,15 @@ namespace tin::install::nsp
std::shared_ptr<nx::ncm::ContentStorage> contentStorage(new nx::ncm::ContentStorage(m_destStorageId));
// Attempt to delete any leftover placeholders
try
{
try {
contentStorage->DeletePlaceholder(*(NcmPlaceHolderId*)&ncaId);
}
catch (...) {}
// Attempt to delete leftover ncas
try {
contentStorage->Delete(ncaId);
}
catch (...) {}
LOG_DEBUG("Size: 0x%lx\n", ncaSize);

View file

@ -87,11 +87,15 @@ namespace tin::install::xci
std::shared_ptr<nx::ncm::ContentStorage> contentStorage(new nx::ncm::ContentStorage(m_destStorageId));
// Attempt to delete any leftover placeholders
try
{
try {
contentStorage->DeletePlaceholder(*(NcmPlaceHolderId*)&ncaId);
}
catch (...) {}
// Attempt to delete leftover ncas
try {
contentStorage->Delete(ncaId);
}
catch (...) {}
LOG_DEBUG("Size: 0x%lx\n", ncaSize);