aboutsummaryrefslogtreecommitdiff
path: root/LauncherInjector
diff options
context:
space:
mode:
authorp0358 <p0358@users.noreply.github.com>2021-12-31 23:21:01 +0100
committerp0358 <p0358@users.noreply.github.com>2021-12-31 23:21:01 +0100
commit23a7ac1ef5c3e5f35c40f738d9140311ef1d3fdb (patch)
tree324ed835d3ad2c1a85e7bb11e12362d89ae68666 /LauncherInjector
parent047539631f9485540865cec55076928717e0f25b (diff)
downloadNorthstarLauncher-23a7ac1ef5c3e5f35c40f738d9140311ef1d3fdb.tar.gz
NorthstarLauncher-23a7ac1ef5c3e5f35c40f738d9140311ef1d3fdb.zip
Add more clear error message for the most common install mistake
Diffstat (limited to 'LauncherInjector')
-rw-r--r--LauncherInjector/main.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/LauncherInjector/main.cpp b/LauncherInjector/main.cpp
index 0f70fd4b..7697e80d 100644
--- a/LauncherInjector/main.cpp
+++ b/LauncherInjector/main.cpp
@@ -65,9 +65,18 @@ FARPROC GetLauncherMain()
void LibraryLoadError(DWORD dwMessageId, const wchar_t* libName, const wchar_t* location)
{
- char text[2048];
+ char text[4096];
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());
+
+ if (!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());
+ }
+
MessageBoxA(GetForegroundWindow(), text, "Northstar Launcher Error", 0);
}
@@ -81,7 +90,7 @@ void EnsureOriginStarted()
HKEY key;
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\WOW6432Node\\Origin", 0, KEY_READ, &key) != ERROR_SUCCESS)
{
- MessageBoxA(0, "Error: failed reading Origin path!", "", MB_OK);
+ MessageBoxA(0, "Error: failed reading Origin path!", "Northstar Launcher Error", MB_OK);
return;
}
@@ -89,7 +98,7 @@ void EnsureOriginStarted()
DWORD originPathLength = 520;
if (RegQueryValueExA(key, "ClientPath", 0, 0, (LPBYTE)&originPath, &originPathLength) != ERROR_SUCCESS)
{
- MessageBoxA(0, "Error: failed reading Origin path!", "", MB_OK);
+ MessageBoxA(0, "Error: failed reading Origin path!", "Northstar Launcher Error", MB_OK);
return;
}