aboutsummaryrefslogtreecommitdiff
path: root/LauncherInjector/main.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-25 18:06:57 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-25 18:06:57 +0000
commitfc10ac473811f2497ef3f4c9c0b885f8efb3025f (patch)
treec4af81b026e6d72b79d1b11e939e04183ece4b84 /LauncherInjector/main.cpp
parent32277386b62877999c2017146750a2449d52d447 (diff)
parenta23232aad6bccc3dc0e5ecd38365303863222a73 (diff)
downloadNorthstarLauncher-fc10ac473811f2497ef3f4c9c0b885f8efb3025f.tar.gz
NorthstarLauncher-fc10ac473811f2497ef3f4c9c0b885f8efb3025f.zip
Merge branch 'main' of https://github.com/R2Northstar/NorthstarLauncher
Diffstat (limited to 'LauncherInjector/main.cpp')
-rw-r--r--LauncherInjector/main.cpp18
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);
}