fix: Portable version detection not working correctly

This commit is contained in:
WerWolv
2022-08-01 23:25:13 +02:00
parent a4c377dc08
commit 59449bbe47
3 changed files with 18 additions and 9 deletions

View File

@@ -75,7 +75,7 @@ namespace hex::init {
// Check if ImHex is installed in portable mode
{
if (const auto executablePath = fs::getExecutablePath(); executablePath.has_value()) {
const auto flagFile = executablePath.value() / "PORTABLE";
const auto flagFile = executablePath->parent_path() / "PORTABLE";
if (fs::exists(flagFile) && fs::isRegularFile(flagFile))
ImHexApi::System::impl::setPortableVersion(true);