1
0
mirror of synced 2024-11-24 07:40:17 +01:00

fix: Logs always being saved to user folders

Fixes #888
This commit is contained in:
WerWolv 2023-01-16 19:39:00 +01:00
parent b368b9c6d1
commit 92f0aa9593
2 changed files with 10 additions and 10 deletions

View File

@ -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<fs::ImHexPath>(path), true)) {

View File

@ -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<RequestRestartImHex>([&]{ shouldRestart = true; });
shouldRestart = false;