From 7ee008e150bc5bcf76082d726f719ee0fdfda982 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Wed, 11 Feb 2026 02:37:39 -0600 Subject: Fluorine Manager: full Linux port of Mod Organizer 2 Complete native Linux port with FUSE-based virtual filesystem, Proton/umu-run integration, and Flatpak packaging. Key features: - FUSE VFS replacing Windows USVFS (in-process + standalone helper for Flatpak) - Proton/GE-Proton/umu-run launcher with env var forwarding - Flatpak support (sandbox-aware VFS, NXM handler, umu-run) - Wine prefix management UI - Case-insensitive path resolution for Linux filesystems - QSettings-safe INI handling (avoids Bethesda INI corruption) - Portable instance support with auto-generated launcher scripts Co-Authored-By: Claude Opus 4.6 --- libs/installer_manual/src/installermanual.cpp | 136 ++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 libs/installer_manual/src/installermanual.cpp (limited to 'libs/installer_manual/src/installermanual.cpp') diff --git a/libs/installer_manual/src/installermanual.cpp b/libs/installer_manual/src/installermanual.cpp new file mode 100644 index 0000000..278b5f2 --- /dev/null +++ b/libs/installer_manual/src/installermanual.cpp @@ -0,0 +1,136 @@ +/* +Copyright (C) 2012 Sebastian Herbord. All rights reserved. + +This file is part of Mod Organizer. + +Mod Organizer is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Mod Organizer is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Mod Organizer. If not, see . +*/ + +#include "installermanual.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "installdialog.h" + +using namespace MOBase; + +InstallerManual::InstallerManual() : m_MOInfo(nullptr) {} + +bool InstallerManual::init(IOrganizer* moInfo) +{ + m_MOInfo = moInfo; + return true; +} + +QString InstallerManual::name() const +{ + return "Manual Installer"; +} + +QString InstallerManual::localizedName() const +{ + return tr("Manual Installer"); +} + +QString InstallerManual::author() const +{ + return "Tannin, Holt59"; +} + +QString InstallerManual::description() const +{ + return tr("Fallback installer for mods that can be extracted but can't be handled by " + "another installer"); +} + +VersionInfo InstallerManual::version() const +{ + return VersionInfo(1, 0, 1, VersionInfo::RELEASE_FINAL); +} + +QList InstallerManual::settings() const +{ + return QList(); +} + +unsigned int InstallerManual::priority() const +{ + return 0; +} + +bool InstallerManual::isManualInstaller() const +{ + return true; +} + +bool InstallerManual::isArchiveSupported(std::shared_ptr) const +{ + return true; +} + +void InstallerManual::openFile(const FileTreeEntry* entry) +{ + QString tempName = manager()->extractFile(entry->shared_from_this()); + +#ifdef _WIN32 + SHELLEXECUTEINFOW execInfo; + memset(&execInfo, 0, sizeof(SHELLEXECUTEINFOW)); + execInfo.cbSize = sizeof(SHELLEXECUTEINFOW); + execInfo.fMask = SEE_MASK_NOCLOSEPROCESS; + execInfo.lpVerb = L"open"; + std::wstring fileNameW = ToWString(tempName); + execInfo.lpFile = fileNameW.c_str(); + execInfo.nShow = SW_SHOWNORMAL; + if (!::ShellExecuteExW(&execInfo)) { + qCritical("failed to spawn %s: %d", qUtf8Printable(tempName), ::GetLastError()); + } +#else + if (!QDesktopServices::openUrl(QUrl::fromLocalFile(tempName))) { + qCritical("failed to open %s", qUtf8Printable(tempName)); + } +#endif +} + +IPluginInstaller::EInstallResult +InstallerManual::install(GuessedValue& modName, + std::shared_ptr& tree, QString&, int&) +{ + qDebug("offering installation dialog"); + InstallDialog dialog( + tree, modName, m_MOInfo->gameFeatures()->gameFeature(), + m_MOInfo->managedGame()->dataDirectory().dirName().toLower(), parentWidget()); + connect(&dialog, &InstallDialog::openFile, this, &InstallerManual::openFile); + if (dialog.exec() == QDialog::Accepted) { + modName.update(dialog.getModName(), GUESS_USER); + + // TODO probably more complicated than necessary + tree = dialog.getModifiedTree(); + return IPluginInstaller::RESULT_SUCCESS; + } else { + return IPluginInstaller::RESULT_CANCELED; + } +} + +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) +Q_EXPORT_PLUGIN2(installerManual, InstallerManual) +#endif -- cgit v1.3.1