From 079f0899488e131e25a0b8d7ed25a52869d63693 Mon Sep 17 00:00:00 2001 From: Will Xyen Date: Sun, 5 Jul 2020 18:46:06 -0700 Subject: [PATCH] launcher: Use more descriptive error message for ERROR_MOD_NOT_FOUND --- src/main/launcher/module.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/launcher/module.c b/src/main/launcher/module.c index 521a301..3a58d09 100644 --- a/src/main/launcher/module.c +++ b/src/main/launcher/module.c @@ -17,17 +17,23 @@ void module_context_init(struct module_context *module, const char *path) if (module->dll == NULL) { LPSTR buffer; + DWORD err = GetLastError(); FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, - GetLastError(), + err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR) &buffer, 0, NULL); + if (err == ERROR_MOD_NOT_FOUND) { + log_warning("%s is likely missing dependencies", path); + log_warning("Do you have vcredist/directx runtimes installed?"); + } + log_fatal("%s: Failed to load game DLL: %s", path, buffer); LocalFree(buffer);