sys: Replaced many helper functions with libwolv

This commit is contained in:
WerWolv
2023-03-12 18:27:29 +01:00
parent e958934a22
commit 0dafb3d230
62 changed files with 263 additions and 1091 deletions

View File

@@ -1,6 +1,5 @@
#include <hex.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/logger.hpp>
#include "window.hpp"
@@ -10,16 +9,19 @@
#include <hex/api/project_file_manager.hpp>
#include <wolv/io/fs.hpp>
#include <wolv/utils/guards.hpp>
int main(int argc, char **argv, char **envp) {
using namespace hex;
ImHexApi::System::impl::setProgramArguments(argc, argv, envp);
// Check if ImHex is installed in portable mode
{
if (const auto executablePath = fs::getExecutablePath(); executablePath.has_value()) {
if (const auto executablePath = wolv::io::fs::getExecutablePath(); executablePath.has_value()) {
const auto flagFile = executablePath->parent_path() / "PORTABLE";
if (fs::exists(flagFile) && fs::isRegularFile(flagFile))
if (wolv::io::fs::exists(flagFile) && wolv::io::fs::isRegularFile(flagFile))
ImHexApi::System::impl::setPortableVersion(true);
}
}