From c3b458e2755b5fc84382a4b7b47459a33302088c Mon Sep 17 00:00:00 2001 From: nmlgc Date: Mon, 11 Jul 2016 15:48:03 +0200 Subject: [PATCH] thcrap_loader: Show an error message if the run configuration was not found. --- thcrap_loader/src/loader.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/thcrap_loader/src/loader.c b/thcrap_loader/src/loader.c index 533f0b2e..88b054f1 100644 --- a/thcrap_loader/src/loader.c +++ b/thcrap_loader/src/loader.c @@ -136,8 +136,20 @@ int CALLBACK wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd "If you do not have one yet, use the " "thcrap_configure tool to create one.\n" ); + ret = -2; + } else { + size_t cur_dir_len = GetCurrentDirectoryU(0, NULL) + 1; + VLA(char, cur_dir, cur_dir_len); + GetCurrentDirectoryU(cur_dir_len, cur_dir); + + log_mboxf(NULL, MB_OK | MB_ICONEXCLAMATION, + "The run configuration file \"%s\" was not found in the current directory (%s).\n", + run_cfg_fn, cur_dir + ); + + VLA_FREE(cur_dir); + ret = -4; } - ret = -2; goto end; } // Command-line arguments take precedence over run configuration values