diff --git a/main/source/init/tasks.cpp b/main/source/init/tasks.cpp index 780fcccf8..422cd0a96 100644 --- a/main/source/init/tasks.cpp +++ b/main/source/init/tasks.cpp @@ -64,16 +64,6 @@ namespace hex::init { using enum fs::ImHexPath; - // Check if ImHex is installed in portable mode - { - if (const auto executablePath = fs::getExecutablePath(); executablePath.has_value()) { - const auto flagFile = executablePath->parent_path() / "PORTABLE"; - - if (fs::exists(flagFile) && fs::isRegularFile(flagFile)) - ImHexApi::System::impl::setPortableVersion(true); - } - } - // Create all folders for (u32 path = 0; path < u32(fs::ImHexPath::END); path++) { for (auto &folder : fs::getDefaultPaths(static_cast(path), true)) { diff --git a/main/source/main.cpp b/main/source/main.cpp index 42f1c2ad7..ce1796bad 100644 --- a/main/source/main.cpp +++ b/main/source/main.cpp @@ -16,6 +16,16 @@ int main(int argc, char **argv, char **envp) { bool shouldRestart = false; + // Check if ImHex is installed in portable mode + { + if (const auto executablePath = fs::getExecutablePath(); executablePath.has_value()) { + const auto flagFile = executablePath->parent_path() / "PORTABLE"; + + if (fs::exists(flagFile) && fs::isRegularFile(flagFile)) + ImHexApi::System::impl::setPortableVersion(true); + } + } + do { EventManager::subscribe([&]{ shouldRestart = true; }); shouldRestart = false;