diff --git a/src/client/component/updater.cpp b/src/client/component/updater.cpp index c58117a2..8e18d659 100644 --- a/src/client/component/updater.cpp +++ b/src/client/component/updater.cpp @@ -1,6 +1,7 @@ #include #include "loader/component_loader.hpp" #include "splash.hpp" +#include "updater.hpp" #include @@ -127,6 +128,25 @@ namespace updater } } + void update() + { +#if defined(NDEBUG) && defined(CI) + try + { + if (requires_update()) + { + perform_update(splash::get_window()); + activate_update(); + } + } + catch (...) + { + } +#else + requires_update(); +#endif + } + class component final : public generic_component { public: @@ -136,7 +156,7 @@ namespace updater this->update_thread_ = std::thread([this] { - this->update(); + update(); }); } @@ -165,21 +185,6 @@ namespace updater this->update_thread_.join(); } } - - void update() - { - try - { - if (requires_update()) - { - perform_update(splash::get_window()); - activate_update(); - } - } - catch (...) - { - } - } }; } diff --git a/src/client/component/updater.hpp b/src/client/component/updater.hpp new file mode 100644 index 00000000..4957d177 --- /dev/null +++ b/src/client/component/updater.hpp @@ -0,0 +1,6 @@ +#pragma once + +namespace updater +{ + void update(); +} diff --git a/src/client/launcher/launcher.cpp b/src/client/launcher/launcher.cpp index 73cb8d5f..0754a2d6 100644 --- a/src/client/launcher/launcher.cpp +++ b/src/client/launcher/launcher.cpp @@ -5,11 +5,14 @@ #include "html/html_window.hpp" #include "resource.hpp" +#include "component/updater.hpp" namespace launcher { bool run() { + updater::update(); + bool run_game = false; html_window window("BOIII", 750, 430);