diff --git a/rpcs3/Crypto/unpkg.cpp b/rpcs3/Crypto/unpkg.cpp index 92e34833e3..959784ba0c 100644 --- a/rpcs3/Crypto/unpkg.cpp +++ b/rpcs3/Crypto/unpkg.cpp @@ -197,23 +197,16 @@ bool pkg_install(const std::string& path, atomic_t& sync) archive_seek(packet.size, fs::seek_cur); } - // If false, an existing directory is being overwritten: cannot cancel the operation - bool was_null = true; - // Get full path and create the directory const std::string dir = Emulator::GetHddDir() + "game/" + install_id + '/'; - if (!fs::create_dir(dir)) + // If false, an existing directory is being overwritten: cannot cancel the operation + const bool was_null = !fs::is_dir(dir); + + if (!fs::create_path(dir)) { - if (fs::g_tls_error == fs::error::exist) - { - was_null = false; - } - else - { - LOG_ERROR(LOADER, "PKG: Could not create the installation directory %s", dir); - return false; - } + LOG_ERROR(LOADER, "PKG: Could not create the installation directory %s", dir); + return false; } // Allocate buffer with BUF_SIZE size or more if required diff --git a/rpcs3/rpcs3qt/vfs_dialog.cpp b/rpcs3/rpcs3qt/vfs_dialog.cpp index 6a6a328489..af97bdc88a 100644 --- a/rpcs3/rpcs3qt/vfs_dialog.cpp +++ b/rpcs3/rpcs3qt/vfs_dialog.cpp @@ -4,6 +4,8 @@ #include #include +#include "Emu/System.h" + inline std::string sstr(const QString& _in) { return _in.toStdString(); } vfs_dialog::vfs_dialog(std::shared_ptr guiSettings, std::shared_ptr emuSettings, QWidget* parent) @@ -60,6 +62,13 @@ vfs_dialog::vfs_dialog(std::shared_ptr guiSettings, std::shared_pt static_cast(tabs->widget(i))->SetSettings(); } m_emu_settings->SaveSettings(); + + // Recreate folder structure for new VFS paths + if (Emu.IsStopped()) + { + Emu.Init(); + } + accept(); } else if (button == buttons->button(QDialogButtonBox::Close))