Skip to content

Commit

Permalink
Add path modifications for appimage based linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
oblivioncth committed Oct 15, 2023
1 parent 3f5a5ab commit e413863
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions app/src/kernel/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,26 @@ void Core::attachFlashpoint(std::unique_ptr<Fp::Install> flashpointInstall)

#ifdef __linux__
// Add platform support environment variables
QString winFpPath = u"Z:"_s + fpPath;
if(mFlashpointInstall->outfittedDaemon() == Fp::Daemon::Qemu) // Appimage based build
{
QString pathValue = de.value(u"PATH"_s);
pathValue.prepend(fpPath + u"/FPSoftware/FPWine/bin:"_s + fpPath + u"/FPSoftware/FPQemuPHP:"_s);
de.insert(u"PATH"_s, pathValue);
qputenv("PATH", pathValue.toLocal8Bit()); // Path needs to be updated for self as well

de.insert(u"DIR"_s, fpPath);
de.insert(u"WINDOWS_DIR"_s, winFpPath);
de.insert(u"FP_STARTUP_PATH"_s, winFpPath + u"\\FPSoftware"_s);
de.insert(u"FP_BROWSER_PLUGINS"_s, winFpPath + u"\\FPSoftware\\BrowserPlugins"_s);
de.insert(u"WINEPREFIX"_s, fpPath + u"/FPSoftware/Wine"_s);
de.insert(u"GTK_USE_PORTAL"_s, "1");
de.remove(u"LD_PRELOAD"_s);
}
else // Regular Linux build
{
QString winFpPath = u"Z:"_s + fpPath;

de.insert(u"DIR"_s, fpPath);
de.insert(u"WINDOWS_DIR"_s, winFpPath);
de.insert(u"FP_STARTUP_PATH"_s, winFpPath + u"\\FPSoftware"_s);
de.insert(u"FP_BROWSER_PLUGINS"_s, winFpPath + u"\\FPSoftware\\BrowserPlugins"_s);
de.insert(u"WINEPREFIX"_s, fpPath + u"/FPSoftware/Wine"_s);
}
#endif

TExec::setDefaultProcessEnvironment(de);
Expand Down

0 comments on commit e413863

Please sign in to comment.