diff --git a/UnleashedRecomp/locale/locale.cpp b/UnleashedRecomp/locale/locale.cpp index eafb24b9..42071dfb 100644 --- a/UnleashedRecomp/locale/locale.cpp +++ b/UnleashedRecomp/locale/locale.cpp @@ -692,6 +692,12 @@ std::unordered_map> { ELanguage::Italian, "Impossibile creare un backend D3D12 (Windows) o Vulkan.\n\nAssicurati che:\n\n- Il tuo sistema soddisfi i requisiti minimi.\n- I driver della scheda grafica siano aggiornati.\n- Il tuo sistema operativo sia aggiornato." } } }, + { + "System_Win32_MissingDLLs", + { + { ELanguage::English, "The module \"%s\" could not be found.\n\nPlease make sure that:\n\n- You extracted this copy of Unleashed Recompiled fully and not just the *.exe file.\n- You are not running Unleashed Recompiled from a *.zip file." } + } + }, { "Common_On", { diff --git a/UnleashedRecomp/main.cpp b/UnleashedRecomp/main.cpp index d3d12381..10ed15ef 100644 --- a/UnleashedRecomp/main.cpp +++ b/UnleashedRecomp/main.cpp @@ -27,6 +27,15 @@ #include #endif +#if _WIN32 && UNLEASHED_RECOMP_D3D12 +static std::array g_D3D12RequiredModules = +{ + "D3D12/D3D12Core.dll", + "dxcompiler.dll", + "dxil.dll" +}; +#endif + const size_t XMAIOBegin = 0x7FEA0000; const size_t XMAIOEnd = XMAIOBegin + 0x0000FFFF; @@ -180,6 +189,19 @@ int main(int argc, char *argv[]) Config::Load(); +#if _WIN32 && UNLEASHED_RECOMP_D3D12 + for (auto& dll : g_D3D12RequiredModules) + { + if (!std::filesystem::exists(g_executableRoot / dll)) + { + char text[512]; + snprintf(text, sizeof(text), Localise("System_Win32_MissingDLLs").c_str(), dll.data()); + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, GameWindow::GetTitle(), text, GameWindow::s_pWindow); + std::_Exit(1); + } + } +#endif + // Check the time since the last time an update was checked. Store the new time if the difference is more than six hours. constexpr double TimeBetweenUpdateChecksInSeconds = 6 * 60 * 60; time_t timeNow = std::time(nullptr); diff --git a/UnleashedRecomp/user/paths.h b/UnleashedRecomp/user/paths.h index d914213b..c0835204 100644 --- a/UnleashedRecomp/user/paths.h +++ b/UnleashedRecomp/user/paths.h @@ -8,6 +8,8 @@ #define GAME_INSTALL_DIRECTORY "." #endif +extern std::filesystem::path g_executableRoot; + inline std::filesystem::path GetGamePath() { return GAME_INSTALL_DIRECTORY;