aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/src/envshortcut.cpp26
-rw-r--r--src/src/mainwindow.cpp4
-rw-r--r--src/src/moapplication.cpp2
-rw-r--r--src/src/nxmhandler_linux.cpp8
-rw-r--r--src/src/prefixsetuprunner.cpp12
-rw-r--r--src/src/protonlauncher.cpp37
-rw-r--r--src/src/shared/appconfig.h12
7 files changed, 34 insertions, 67 deletions
diff --git a/src/src/envshortcut.cpp b/src/src/envshortcut.cpp
index 60cd33a..60786d2 100644
--- a/src/src/envshortcut.cpp
+++ b/src/src/envshortcut.cpp
@@ -17,17 +17,11 @@
namespace env
{
-// Returns the path to the AppImage file itself, or falls back to the
-// running binary if not running from an AppImage.
-static QString appImageOrBinary()
+// Prefer the fluorine-manager launcher script over the bare ModOrganizer-core
+// binary — the launcher sets up bundled library paths, Qt plugin paths, etc.
+// Without it, shortcuts fail on systems that don't have all deps in PATH.
+static QString launcherOrBinary()
{
- QString appImage = QProcessEnvironment::systemEnvironment().value("APPIMAGE");
- if (!appImage.isEmpty() && QFile::exists(appImage)) {
- return appImage;
- }
- // Prefer the fluorine-manager launcher script over the bare ModOrganizer-core
- // binary — the launcher sets up bundled library paths, Qt plugin paths, etc.
- // Without it, shortcuts fail on systems that don't have all deps in PATH.
const QString appDir = QCoreApplication::applicationDirPath();
const QString launcher = appDir + "/fluorine-manager";
if (QFile::exists(launcher)) {
@@ -281,16 +275,10 @@ static QImage extractIconFromExe(const QString& exePath)
return img;
}
-// Return the path to the bundled Fluorine icon inside the AppImage,
-// or the installed hicolor copy. Empty string if neither exists.
+// Return the path to the installed hicolor copy of the Fluorine icon.
+// Empty string if not present.
static QString bundledFluorineIcon()
{
- QString const appDir = QProcessEnvironment::systemEnvironment().value("APPDIR");
- if (!appDir.isEmpty()) {
- QString bundled = appDir + "/usr/share/icons/hicolor/256x256/apps/com.fluorine.manager.png";
- if (QFile::exists(bundled))
- return bundled;
- }
QString hicolor = QDir::homePath() +
"/.local/share/icons/hicolor/256x256/apps/com.fluorine.manager.png";
if (QFile::exists(hicolor))
@@ -362,7 +350,7 @@ Shortcut::Shortcut(const Executable& exe) : Shortcut()
m_name = exe.title();
m_instanceName = i.displayName();
- m_target = appImageOrBinary();
+ m_target = launcherOrBinary();
// For portable instances, use the absolute directory path so MO2 can
// find it (line 595 in instancemanager.cpp handles abs path lookup).
diff --git a/src/src/mainwindow.cpp b/src/src/mainwindow.cpp
index ee32208..a928c6d 100644
--- a/src/src/mainwindow.cpp
+++ b/src/src/mainwindow.cpp
@@ -636,8 +636,8 @@ void MainWindow::resetActionIcons()
void MainWindow::resetButtonIcons()
{
- // Some icon-only QPushButtons can lose their icons after stylesheet repolish on
- // Linux/AppImage. Re-apply explicit resource icons to keep these controls visible.
+ // Some icon-only QPushButtons can lose their icons after stylesheet repolish
+ // on Linux. Re-apply explicit resource icons to keep these controls visible.
ui->listOptionsBtn->setIcon(QIcon::fromTheme(
"preferences-system", QIcon(":/MO/gui/settings")));
ui->openFolderMenu->setIcon(
diff --git a/src/src/moapplication.cpp b/src/src/moapplication.cpp
index 0c50509..aac387f 100644
--- a/src/src/moapplication.cpp
+++ b/src/src/moapplication.cpp
@@ -190,7 +190,7 @@ MOApplication::MOApplication(int& argc, char** argv) : QApplication(argc, argv)
TimeThis const tt("MOApplication()");
// Ensure the app name is always "ModOrganizer" regardless of the binary
- // filename (e.g. "ModOrganizer.bin" inside an AppImage).
+ // filename (settings/profile lookups key off this).
setApplicationName("ModOrganizer");
setDesktopFileName(QStringLiteral("com.fluorine.manager"));
setWindowIcon(QIcon(":/MO/gui/app_icon"));
diff --git a/src/src/nxmhandler_linux.cpp b/src/src/nxmhandler_linux.cpp
index 3c9ef2a..c7db527 100644
--- a/src/src/nxmhandler_linux.cpp
+++ b/src/src/nxmhandler_linux.cpp
@@ -198,13 +198,7 @@ void NxmHandlerLinux::registerHandler()
const QString wrapperPath = localBin + "/mo2-nxm-handler";
// Determine a stable executable path for the wrapper script.
- // QCoreApplication::applicationFilePath() returns the temp FUSE mount for
- // AppImages (/tmp/.mount_XXXXX/...) which changes every launch. Use the
- // APPIMAGE env var (the actual .AppImage file) when available.
- QString executable = qEnvironmentVariable("APPIMAGE");
- if (executable.isEmpty()) {
- executable = QCoreApplication::applicationFilePath();
- }
+ const QString executable = QCoreApplication::applicationFilePath();
const QString wrapper =
QString("#!/bin/sh\nexec \"%1\" nxm-handle \"$@\"\n").arg(executable);
diff --git a/src/src/prefixsetuprunner.cpp b/src/src/prefixsetuprunner.cpp
index cd2fcf4..a3f782f 100644
--- a/src/src/prefixsetuprunner.cpp
+++ b/src/src/prefixsetuprunner.cpp
@@ -564,18 +564,16 @@ QProcess* PrefixSetupRunner::buildWrappedProcess(
{
auto* proc = new QProcess(this);
- // Start from the system environment and clean AppImage vars.
+ // Start from the system environment and clean Fluorine bundling vars.
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
- // Remove AppImage/Fluorine vars that can confuse Wine.
+ // Remove Fluorine vars that can confuse Wine.
for (const char* var : {"QT_QPA_PLATFORM_PLUGIN_PATH", "MO2_PLUGINS_DIR",
- "MO2_LIBS_DIR", "MO2_PYTHON_DIR", "MO2_BASE_DIR",
- "APPIMAGE", "APPDIR", "OWD", "ARGV0",
- "APPIMAGE_ORIGINAL_EXEC", "DESKTOPINTEGRATION"}) {
+ "MO2_LIBS_DIR", "MO2_PYTHON_DIR", "MO2_BASE_DIR"}) {
env.remove(var);
}
- // Restore pre-AppImage environment if available.
+ // Restore pre-launcher environment if available.
auto restoreOrStrip = [&env](const QString& var, const QString& origVar) {
if (env.contains(origVar)) {
const QString orig = env.value(origVar);
@@ -719,7 +717,7 @@ int PrefixSetupRunner::runHostProcess(const QString& exe,
proc.setArguments(args);
proc.setProcessChannelMode(QProcess::MergedChannels);
- // Clean AppImage/Fluorine env so host tools find their system libraries.
+ // Clean Fluorine env so host tools find their system libraries.
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
auto restoreOrStrip = [&env](const QString& var, const QString& origVar) {
if (env.contains(origVar)) {
diff --git a/src/src/protonlauncher.cpp b/src/src/protonlauncher.cpp
index 9c6bba8..d8b1289 100644
--- a/src/src/protonlauncher.cpp
+++ b/src/src/protonlauncher.cpp
@@ -14,32 +14,22 @@
namespace
{
-// Restore the pre-AppImage environment for child processes (Proton, Wine).
-// The AppRun script saves FLUORINE_ORIG_* vars before
-// modifying PATH, LD_LIBRARY_PATH, etc. We restore from those saved values
-// so game processes get a clean host environment without AppImage library paths.
-void cleanAppImageEnv(QProcessEnvironment& env)
+// Restore the pre-launcher environment for child processes (Proton, Wine).
+// The fluorine-manager launcher script saves FLUORINE_ORIG_* before
+// modifying PATH, LD_LIBRARY_PATH, etc., so game processes get a clean
+// host environment without the bundled-library paths leaking through.
+void cleanFluorineEnv(QProcessEnvironment& env)
{
- // Remove Fluorine/AppImage-specific vars that should never leak to game processes.
+ // Remove Fluorine-specific vars that should never leak to game processes.
env.remove("QT_QPA_PLATFORM_PLUGIN_PATH");
env.remove("MO2_PLUGINS_DIR");
env.remove("MO2_LIBS_DIR");
env.remove("MO2_PYTHON_DIR");
env.remove("MO2_BASE_DIR");
- // AppImage runtime injects these — they can confuse Proton/Wine.
- env.remove("APPIMAGE");
- env.remove("APPDIR");
- env.remove("OWD");
- env.remove("ARGV0");
- env.remove("APPIMAGE_ORIGINAL_EXEC");
-
- env.remove("DESKTOPINTEGRATION");
-
- // Restore saved pre-AppImage values. AppRun sets FLUORINE_ORIG_* before
- // modifying PATH, LD_LIBRARY_PATH, etc. If those vars exist, use them to
- // restore the original host environment. If not (standalone/non-AppImage),
- // fall back to stripping known AppImage patterns.
+ // Restore saved pre-launcher values from FLUORINE_ORIG_*. If those
+ // vars are missing (e.g. someone invoked ModOrganizer-core directly),
+ // fall back to stripping bundled-runtime paths by pattern.
auto restoreOrStrip = [](const QString& var, const QString& origVar,
QProcessEnvironment& e) {
if (e.contains(origVar)) {
@@ -51,12 +41,11 @@ void cleanAppImageEnv(QProcessEnvironment& env)
}
e.remove(origVar);
} else {
- // Fallback: strip AppImage mount paths by pattern.
const QString value = e.value(var);
if (value.isEmpty()) return;
QStringList kept;
for (const QString& p : value.split(':')) {
- if (p.contains(".mount_Fluori") || p.contains("/fluorine/python")) {
+ if (p.contains("/fluorine/python")) {
continue;
}
kept.append(p);
@@ -76,7 +65,7 @@ void cleanAppImageEnv(QProcessEnvironment& env)
restoreOrStrip("XDG_DATA_DIRS", "FLUORINE_ORIG_XDG_DATA_DIRS", env);
restoreOrStrip("QT_PLUGIN_PATH", "FLUORINE_ORIG_QT_PLUGIN_PATH", env);
- MOBase::log::debug("cleanAppImageEnv: {} (LD_LIBRARY_PATH='{}')",
+ MOBase::log::debug("cleanFluorineEnv: {} (LD_LIBRARY_PATH='{}')",
hasOrigVars ? "restored from FLUORINE_ORIG_*" : "pattern-strip fallback",
env.value("LD_LIBRARY_PATH", "<unset>"));
}
@@ -577,7 +566,7 @@ bool ProtonLauncher::launchWithProton(qint64& pid) const
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.remove("PYTHONHOME");
- cleanAppImageEnv(env);
+ cleanFluorineEnv(env);
// Prepend fluorine's bin dir to PATH so the container sees our injected
// xrandr (steamrt4 ships without it; Proton-GE protonfixes require it).
@@ -819,7 +808,7 @@ bool ProtonLauncher::launchDirect(qint64& pid) const
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.remove("PYTHONHOME");
- cleanAppImageEnv(env);
+ cleanFluorineEnv(env);
for (auto it = m_wrapperEnvVars.cbegin(); it != m_wrapperEnvVars.cend(); ++it) {
env.insert(it.key(), it.value());
}
diff --git a/src/src/shared/appconfig.h b/src/src/shared/appconfig.h
index efbc169..e7e94b1 100644
--- a/src/src/shared/appconfig.h
+++ b/src/src/shared/appconfig.h
@@ -31,15 +31,13 @@ namespace AppConfig
#define APPPARAM(partype, parid, value) partype parid();
#include "appconfig.inc"
-// Returns the application base directory. On Linux, if the MO2_BASE_DIR
-// environment variable is set (e.g. by an AppImage wrapper) that value is
-// returned; otherwise falls back to QCoreApplication::applicationDirPath().
+// Returns the application base directory. Respects MO2_BASE_DIR if set
+// (the fluorine-manager launcher exports it), otherwise falls back to
+// QCoreApplication::applicationDirPath().
QString basePath();
-// Returns the directory containing MO2 plugins. On Linux, if the
-// MO2_PLUGINS_DIR environment variable is set (e.g. when plugins live
-// inside a read-only AppImage squashfs) that value is used; otherwise
-// falls back to basePath() + "/plugins".
+// Returns the directory containing MO2 plugins. Respects MO2_PLUGINS_DIR
+// if set, otherwise falls back to basePath() + "/plugins".
QString pluginsPath();
// Returns the directory containing bundled Linux libraries (7z.so, etc.).