diff --git a/auth.cpp b/auth.cpp index 75c3162..6b7801e 100644 --- a/auth.cpp +++ b/auth.cpp @@ -752,16 +752,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"); + } } - KA_EXIT(0); } } else { diff --git a/auth.hpp b/auth.hpp index 487338b..d322327 100644 --- a/auth.hpp +++ b/auth.hpp @@ -58,6 +58,7 @@ namespace KeyAuth { bool require_pinning = 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;