Skip to content

Commit

Permalink
Added error message if included DirectX DLLs are missing (#998)
Browse files Browse the repository at this point in the history
* Added error message if included DirectX DLLs are missing

* locale: added System_Win32_MissingDLLs localisation

Co-Authored-By: LJSTAR <[email protected]>
Co-Authored-By: Kitzuku <[email protected]>
Co-Authored-By: NextinHKRY <[email protected]>
Co-Authored-By: brianuuu <[email protected]>
Co-Authored-By: Darío <[email protected]>

* Fix ifdefs

---------

Co-authored-by: LJSTAR <[email protected]>
Co-authored-by: Kitzuku <[email protected]>
Co-authored-by: NextinHKRY <[email protected]>
Co-authored-by: brianuuu <[email protected]>
Co-authored-by: Darío <[email protected]>
  • Loading branch information
6 people authored Mar 7, 2025
1 parent c19a7b1 commit c64ef1f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
11 changes: 11 additions & 0 deletions UnleashedRecomp/locale/locale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,17 @@ std::unordered_map<std::string_view, std::unordered_map<ELanguage, std::string>>
{ 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." },
{ ELanguage::Japanese, "モジュール\"%s\"が見つかりませんでした\n\n次の点を確認してください:\n\n※Unleashed Recompiledの*.exeファイルだけを抽出していなく、 コピーを完全に抽出してること\n※Unleashed Recompiledを*.zipファイルから実行していないこと" },
{ ELanguage::German, "Das Modul \"%s\" konnte nicht gefunden werden.\n\nBitte stelle sicher, dass:\n\n- Diese Kopie von Unleashed Recompiled vollständig entpackt wurde und nicht nur die *.exe-Datei.\n- Unleashed Recompiled nicht direkt aus einer *.zip-Datei ausgeführt wird." },
{ ELanguage::French, "Le module \"%s\" n'a pas pu être trouvé.\n\nVeuillez vous assurer que :\n\n- Vous avez extrait Unleashed Recompiled dans son entièreté et pas seulement le fichier *.exe.\n- Vous n'exécutez pas Unleashed Recompiled à partir d'un fichier *.zip." },
{ ELanguage::Spanish, "No se pudo encontrar el módulo \"%s\".\n\nAsegúrese de que:\n\n- Ha extraido esta copia de Unleashed Recompiled por completo y no solo el archivo *.exe.\n- No está ejecutando Unleashed Recompiled desde un archivo *.zip." },
{ ELanguage::Italian, "Impossibile trovare il modulo \"%s\".\n\nAssicurati che:\n\n- Hai estratto questa copia di Unleashed Recompiled correttamente e non solo il file *.exe.\n- Non stai eseguendo Unleashed Recompiled da un file *.zip." }
}
},
{
"Common_On",
{
Expand Down
22 changes: 22 additions & 0 deletions UnleashedRecomp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
#include <timeapi.h>
#endif

#if defined(_WIN32) && defined(UNLEASHED_RECOMP_D3D12)
static std::array<std::string_view, 3> g_D3D12RequiredModules =
{
"D3D12/D3D12Core.dll",
"dxcompiler.dll",
"dxil.dll"
};
#endif

const size_t XMAIOBegin = 0x7FEA0000;
const size_t XMAIOEnd = XMAIOBegin + 0x0000FFFF;

Expand Down Expand Up @@ -204,6 +213,19 @@ int main(int argc, char *argv[])

Config::Load();

#if defined(_WIN32) && defined(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);
Expand Down
2 changes: 2 additions & 0 deletions UnleashedRecomp/user/paths.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#define GAME_INSTALL_DIRECTORY "."
#endif

extern std::filesystem::path g_executableRoot;

inline std::filesystem::path GetGamePath()
{
return GAME_INSTALL_DIRECTORY;
Expand Down

0 comments on commit c64ef1f

Please sign in to comment.