diff --git a/src/xenia/app/emulator_window.cc b/src/xenia/app/emulator_window.cc index 65a6f5e0e..0a1537bea 100644 --- a/src/xenia/app/emulator_window.cc +++ b/src/xenia/app/emulator_window.cc @@ -883,9 +883,9 @@ void EmulatorWindow::InstallContent() { // Normalize the path and make absolute. auto abs_path = std::filesystem::absolute(path); auto result = emulator_->InstallContentPackage(abs_path); - if (XFAILED(result)) { + if (result != X_STATUS_SUCCESS) { // TODO: Display a message box. - XELOGE("Failed to install content: {:08X}", result); + XELOGE("Failed to install content! Error code: {:08X}", result); } } } diff --git a/src/xenia/emulator.cc b/src/xenia/emulator.cc index e9a671c87..f4400fb25 100644 --- a/src/xenia/emulator.cc +++ b/src/xenia/emulator.cc @@ -374,7 +374,12 @@ X_STATUS Emulator::InstallContentPackage(const std::filesystem::path& path) { // TODO: Popup // Do you want to overwrite already existing data? } else { - std::filesystem::create_directories(installation_path / path.filename()); + std::error_code error_code; + std::filesystem::create_directories(installation_path / path.filename(), + error_code); + if (error_code) { + return error_code.value(); + } } // Run through all the files, breadth-first style. @@ -396,7 +401,11 @@ X_STATUS Emulator::InstallContentPackage(const std::filesystem::path& path) { auto dest_name = installation_path / path.filename() / xe::to_path(entry->path()); if (entry->attributes() & vfs::kFileAttributeDirectory) { - std::filesystem::create_directories(dest_name); + std::error_code error_code; + std::filesystem::create_directories(dest_name, error_code); + if (error_code) { + return error_code.value(); + } continue; }