[Emulator] Install Content: Create header for installed packages

This fixes support for certain DLCs
This commit is contained in:
Gliniak
2022-08-20 20:41:08 +02:00
parent 469d062a50
commit 010b59e81c
7 changed files with 72 additions and 6 deletions

View File

@@ -370,6 +370,10 @@ X_STATUS Emulator::InstallContentPackage(const std::filesystem::path& path) {
content_root() / fmt::format("{:08X}", device->title_id()) /
fmt::format("{:08X}", device->content_type()) / path.filename();
std::filesystem::path header_path =
content_root() / fmt::format("{:08X}", device->title_id()) / "Headers" /
fmt::format("{:08X}", device->content_type()) / path.filename();
if (std::filesystem::exists(installation_path)) {
// TODO(Gliniak): Popup
// Do you want to overwrite already existing data?
@@ -380,7 +384,11 @@ X_STATUS Emulator::InstallContentPackage(const std::filesystem::path& path) {
return error_code.value();
}
}
return vfs::VirtualFileSystem::ExtractFiles(device.get(), installation_path);
vfs::VirtualFileSystem::ExtractContentHeader(device.get(), header_path);
return vfs::VirtualFileSystem::ExtractContentFiles(device.get(),
installation_path);
}
void Emulator::Pause() {