From af43100e29859adbf5dcb6ee90cd8f981439b859 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Fri, 1 May 2026 10:09:39 -0500 Subject: Remove AppImage build target and runtime references We ship via portable tarball directory + .bin self-extracting installer only; the AppImage path was unmaintained and pulling in linuxdeploy tooling for a format we no longer publish. Build: - build.sh: drop appimage/all-includes-appimage modes (now: tarball, installer, all=both, shell). Output listing tracks the directory. - docker/Dockerfile: drop BUILD_APPIMAGE arg and the linuxdeploy download/extract block. - docker/build-inner.sh: drop build_appimage() (~120 lines), AppImage arm of the BUILD_MODE switch, *.AppImage summary listing. - docker/AppRun.sh: deleted. - .gitignore: drop *.AppImage / squashfs-root / *.flatpak entries. Runtime: no longer key off APPIMAGE/APPDIR env vars or AppRun-set state. The fluorine-manager launcher script already exports FLUORINE_ORIG_*, MO2_BASE_DIR, MO2_PLUGINS_DIR, MO2_LIBS_DIR, MO2_PYTHON_DIR for the same purpose, so simplify: - envshortcut: appImageOrBinary -> launcherOrBinary; bundledFluorineIcon no longer probes APPDIR. - nxmhandler: drop APPIMAGE-based wrapper path; use applicationFilePath. - protonlauncher: rename cleanAppImageEnv -> cleanFluorineEnv, drop APPIMAGE/APPDIR/OWD/ARGV0/APPIMAGE_ORIGINAL_EXEC/DESKTOPINTEGRATION removals and .mount_Fluori pattern strip. - prefixsetuprunner: same env-cleaning trim. - utility, library.h, proxypython, mainwindow, moapplication, appconfig: comment cleanup pointing at the launcher instead of AppRun. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/src/envshortcut.cpp | 26 +++++++------------------- src/src/mainwindow.cpp | 4 ++-- src/src/moapplication.cpp | 2 +- src/src/nxmhandler_linux.cpp | 8 +------- src/src/prefixsetuprunner.cpp | 12 +++++------- src/src/protonlauncher.cpp | 37 +++++++++++++------------------------ src/src/shared/appconfig.h | 12 +++++------- 7 files changed, 34 insertions(+), 67 deletions(-) (limited to 'src') 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", "")); } @@ -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.). -- cgit v1.3.1