diff --git a/auth.cpp b/auth.cpp index 0af7ed4..f1ef415 100644 --- a/auth.cpp +++ b/auth.cpp @@ -597,16 +597,24 @@ void KeyAuth::api::init() else if (json[(XorStr("message"))] == XorStr("invalidver")) { std::string dl = json[(XorStr("download"))]; - api::app_data.downloadLink = json[XorStr("download")]; - if (dl == "") - { - MessageBoxA(0, XorStr("Version in the loader does match the one on the dashboard, and the download link on dashboard is blank.\n\nTo fix this, either fix the loader so it matches the version on the dashboard. Or if you intended for it to have different versions, update the download link on dashboard so it will auto-update correctly.").c_str(), NULL, MB_ICONERROR); + api::app_data.downloadLink = dl; + if (auto_open_download_url) { + if (dl.empty()) { + MessageBoxA(0, XorStr("Version in the loader does not match the one on the dashboard, and the download link on dashboard is blank.\n\nTo fix this, either fix the loader so it matches the version on the dashboard. Or if you intended for it to have different versions, update the download link on dashboard so it will auto-update correctly.").c_str(), NULL, MB_ICONERROR); + } + else { + ShellExecuteA(0, XorStr("open").c_str(), dl.c_str(), 0, 0, SW_SHOWNORMAL); + } + LI_FN(exit)(0); } - else - { - ShellExecuteA(0, XorStr("open").c_str(), dl.c_str(), 0, 0, SW_SHOWNORMAL); + else { + if (dl.empty()) { + api::response.message = XorStr("Version in the loader does not match the one on the dashboard, and the download link on dashboard is blank. To fix this, either fix the loader so it matches the version on the dashboard. Or if you intended for it to have different versions, update the download link on dashboard so it will auto-update correctly."); + } + else { + api::response.message = XorStr("invalidver"); + } } - LI_FN(exit)(0); } } else { diff --git a/auth.hpp b/auth.hpp index ef22c0b..c4128b4 100644 --- a/auth.hpp +++ b/auth.hpp @@ -59,6 +59,7 @@ namespace KeyAuth { bool block_proxy = false; bool block_custom_ca = false; bool block_private_dns = false; + bool auto_open_download_url = true; static std::string expiry_remaining(const std::string& expiry); static constexpr const char* kSavePath = "test.json"; static constexpr int kInitFailSleepMs = 1500;