diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-01-24 22:23:20 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-24 22:23:20 +0000 |
commit | a23232aad6bccc3dc0e5ecd38365303863222a73 (patch) | |
tree | 4e503b36a4e8c20747c820a7bd039016e7de54bf /LauncherInjector | |
parent | f31c452286cf8861f328b94b6b51c004a46984e0 (diff) | |
parent | b85b357a496ab633bb42f46735c42ef0abade392 (diff) | |
download | NorthstarLauncher-a23232aad6bccc3dc0e5ecd38365303863222a73.tar.gz NorthstarLauncher-a23232aad6bccc3dc0e5ecd38365303863222a73.zip |
Merge pull request #56 from p0358/main
Misc improvements
Diffstat (limited to 'LauncherInjector')
-rw-r--r-- | LauncherInjector/main.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/LauncherInjector/main.cpp b/LauncherInjector/main.cpp index 7697e80d..a5d70f76 100644 --- a/LauncherInjector/main.cpp +++ b/LauncherInjector/main.cpp @@ -65,17 +65,29 @@ FARPROC GetLauncherMain() void LibraryLoadError(DWORD dwMessageId, const wchar_t* libName, const wchar_t* location) { - char text[4096]; + char text[8192]; std::string message = std::system_category().message(dwMessageId); - sprintf_s(text, "Failed to load the %ls at \"%ls\" (%lu):\n\n%hs\n\nMake sure you followed the Northstar installation instructions carefully.", libName, location, dwMessageId, message.c_str()); + sprintf_s(text, "Failed to load the %ls at \"%ls\" (%lu):\n\n%hs\n\nMake sure you followed the Northstar installation instructions carefully before reaching out for help.", libName, location, dwMessageId, message.c_str()); - if (!fs::exists("Titanfall2.exe") && fs::exists("..\\Titanfall2.exe")) + if (dwMessageId == 126 && std::filesystem::exists(location)) + { + sprintf_s(text, "%s\n\nThe file at the specified location DOES exist, so this error indicates that one of its *dependencies* failed to be found.\n\nTry the following steps:\n1. Install Visual C++ 2022 Redistributable: https://aka.ms/vs/17/release/vc_redist.x64.exe\n2. Repair game files", text); + } + else if (!fs::exists("Titanfall2.exe") && (fs::exists("..\\Titanfall2.exe") || fs::exists("..\\..\\Titanfall2.exe"))) { auto curDir = std::filesystem::current_path().filename().string(); auto aboveDir = std::filesystem::current_path().parent_path().filename().string(); sprintf_s(text, "%s\n\nWe detected that in your case you have extracted the files into a *subdirectory* of your Titanfall 2 installation.\nPlease move all the files and folders from current folder (\"%s\") into the Titanfall 2 installation directory just above (\"%s\").\n\nPlease try out the above steps by yourself before reaching out to the community for support.", text, curDir.c_str(), aboveDir.c_str()); } + else if (!fs::exists("Titanfall2.exe")) + { + sprintf_s(text, "%s\n\nRemember: you need to unpack the contents of this archive into your Titanfall 2 game installation directory, not just to any random folder.", text); + } + else if (fs::exists("Titanfall2.exe")) + { + sprintf_s(text, "%s\n\nTitanfall2.exe has been found in the current directory: is the game installation corrupted or did you not unpack all Northstar files here?", text); + } MessageBoxA(GetForegroundWindow(), text, "Northstar Launcher Error", 0); } |