From 122744454c9befc06b582a8f0feb03bfbb85aa71 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Wed, 31 Oct 2018 20:00:20 -0500 Subject: Improve changing mod and plugin priorities --- src/organizercore.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/organizercore.cpp') diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 5c85e323..1fafd4c1 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1183,7 +1183,9 @@ ModList *OrganizerCore::modList() QStringList OrganizerCore::modsSortedByProfilePriority() const { QStringList res; - for (unsigned int i = 0; i < currentProfile()->numRegularMods(); ++i) { + for (int i = currentProfile()->getPriorityMinimum(); + i < currentProfile()->getPriorityMinimum() + currentProfile()->numRegularMods(); + ++i) { int modIndex = currentProfile()->modIndexByPriority(i); res.push_back(ModInfo::getByIndex(modIndex)->name()); } @@ -2304,4 +2306,4 @@ std::vector OrganizerCore::fileMapping( result.insert(result.end(), subRes.begin(), subRes.end()); } return result; -} \ No newline at end of file +} -- cgit v1.3.1 From 3dbfba91e1618e6cdf3ed5ce7ff7955376df03eb Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Thu, 1 Nov 2018 14:51:14 -0500 Subject: Add separators according to context location of context menu --- src/mainwindow.cpp | 14 ++++++++++++++ src/mainwindow.h | 1 + src/organizercore.cpp | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src/organizercore.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5e4bb86f..5b257977 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -204,6 +204,7 @@ MainWindow::MainWindow(QSettings &initSettings , m_CategoryFactory(CategoryFactory::instance()) , m_ContextItem(nullptr) , m_ContextAction(nullptr) + , m_ContextRow(-1) , m_CurrentSaveView(nullptr) , m_OrganizerCore(organizerCore) , m_PluginContainer(pluginContainer) @@ -328,6 +329,7 @@ MainWindow::MainWindow(QSettings &initSettings ui->linkButton->setMenu(linkMenu); ui->listOptionsBtn->setMenu(modListContextMenu()); + connect(ui->listOptionsBtn, SIGNAL(pressed()), this, SLOT(on_listOptionsBtn_pressed())); ui->openFolderMenu->setMenu(openFolderMenu()); @@ -2866,8 +2868,15 @@ void MainWindow::createSeparator_clicked() { return; } + int newPriority; + if (m_ContextRow >= 0) { + newPriority = m_OrganizerCore.currentProfile()->getModPriority(m_ContextRow); + } if (m_OrganizerCore.createMod(name) == nullptr) { return; } m_OrganizerCore.refreshModList(); + if (m_ContextRow >= 0) { + m_OrganizerCore.modList()->changeModPriority(ModInfo::getIndex(name), newPriority); + } } void MainWindow::setColor_clicked() @@ -3023,6 +3032,11 @@ void MainWindow::on_modList_doubleClicked(const QModelIndex &index) } } +void MainWindow::on_listOptionsBtn_pressed() +{ + m_ContextRow = -1; +} + void MainWindow::on_espList_doubleClicked(const QModelIndex &index) { if (!index.isValid()) { diff --git a/src/mainwindow.h b/src/mainwindow.h index 9dee2953..c595575e 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -590,6 +590,7 @@ private slots: // ui slots void on_executablesListBox_currentIndexChanged(int index); void on_modList_customContextMenuRequested(const QPoint &pos); void on_modList_doubleClicked(const QModelIndex &index); + void on_listOptionsBtn_pressed(); void on_espList_doubleClicked(const QModelIndex &index); void on_profileBox_currentIndexChanged(int index); void on_savegameList_customContextMenuRequested(const QPoint &pos); diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 1fafd4c1..fe720a0c 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1184,7 +1184,7 @@ QStringList OrganizerCore::modsSortedByProfilePriority() const { QStringList res; for (int i = currentProfile()->getPriorityMinimum(); - i < currentProfile()->getPriorityMinimum() + currentProfile()->numRegularMods(); + i < currentProfile()->getPriorityMinimum() + (int)currentProfile()->numRegularMods(); ++i) { int modIndex = currentProfile()->modIndexByPriority(i); res.push_back(ModInfo::getByIndex(modIndex)->name()); -- cgit v1.3.1 From a219d034448496880f9deed48ef6905ac4ce594e Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Mon, 26 Nov 2018 03:13:33 -0600 Subject: Add cancel button to "Start Steam?" dialog to not start binary --- src/organizer_en.ts | 160 +++++++++++++++++++++++++------------------------- src/organizercore.cpp | 22 ++++--- 2 files changed, 93 insertions(+), 89 deletions(-) (limited to 'src/organizercore.cpp') diff --git a/src/organizer_en.ts b/src/organizer_en.ts index 5a3826b0..9b1294ac 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -2650,6 +2650,18 @@ You can also use online editors and converters instead. Remove Backup... + + + + Change Categories + + + + + + Primary Category + + Rename Separator... @@ -2660,11 +2672,6 @@ You can also use online editors and converters instead. Remove Separator... - - - Set the priority of the selected mods - - Select Color... @@ -2675,18 +2682,6 @@ You can also use online editors and converters instead. Reset Color - - - - Change Categories - - - - - - Primary Category - - Change versioning scheme @@ -3151,6 +3146,11 @@ You can also use online editors and converters instead. Ignore file + + + Set the priority of the selected mods + + MessageDialog @@ -4326,118 +4326,118 @@ p, li { white-space: pre-wrap; } - + Start Steam? - + Steam is required to be running already to correctly start the game. Should MO try to start steam now? - + Error - + Windows Event Log Error - + The Windows Event Log service is disabled and/or not running. This prevents USVFS from running properly. Your mods may not be working in the executable that you are launching. Note that you may have to restart MO and/or your PC after the service is fixed. Continue launching %1? - + No profile set - + Failed to refresh list of esps: %1 - + Multiple esps/esls activated, please check that they don't conflict. - + Download? - + A download has been started but no installed page plugin recognizes it. If you download anyway no information (i.e. version) will be associated with the download. Continue? - + failed to update mod list: %1 - - + + login successful - + Login failed - + Login failed, try again? - + login failed: %1. Download will not be associated with an account - + login failed: %1 - + login failed: %1. You need to log-in with Nexus to update MO. - + MO1 "Script Extender" load mechanism has left hook.dll in your game folder - - + + Description missing - + <a href="%1">hook.dll</a> has been found in your game folder (right click to copy the full path). This is most likely a leftover of setting the ModOrganizer 1 load mechanism to "Script Extender", in which case you must remove this file either by changing the load mechanism in ModOrganizer 1 or manually removing the file, otherwise the game is likely to crash and burn. - + failed to save load order: %1 - + The designated write target "%1" is not enabled. @@ -5034,7 +5034,8 @@ p, li { white-space: pre-wrap; } QObject - + + Error @@ -5397,7 +5398,7 @@ If the folder was still in use, restart MO and try again. - + Mod Organizer @@ -5474,12 +5475,12 @@ If the folder was still in use, restart MO and try again. - + Script Extender - + Proxy DLL @@ -5699,12 +5700,12 @@ Select Show Details option to see the full change-log. - + Error - + Failed to create "%1", you may not have the necessary permission. path remains unchanged. @@ -5784,6 +5785,11 @@ If you use pre-releases, never contact me directly by e-mail or via private mess Colors + + + Mod Contains selected Plugin + + Plugin is Contained in selected Mod @@ -5795,23 +5801,24 @@ If you use pre-releases, never contact me directly by e-mail or via private mess - - If checked, the download interface will be more compact. + + Is overwritten (loose files) - - Compact Download Interface + + Is overwriting (loose files) - - If checked, the download list will display meta information instead of file names. + + + Modify the categories available to arrange your mods. - - Download Meta Information + + Configure Mod Categories @@ -5819,12 +5826,6 @@ If you use pre-releases, never contact me directly by e-mail or via private mess Reset stored information from dialogs. - - - Mod Contains selected Plugin - Is contained in selected Mod - - This will make all dialogs show up again where you checked the "Remember selection"-box. @@ -5836,24 +5837,23 @@ If you use pre-releases, never contact me directly by e-mail or via private mess - - - Modify the categories available to arrange your mods. + + If checked, the download interface will be more compact. - - Configure Mod Categories + + Compact Download Interface - - Is overwriting (loose files) + + If checked, the download list will display meta information instead of file names. - - Is overwritten (loose files) + + Download Meta Information @@ -6327,52 +6327,52 @@ For the other games this is not a sufficient replacement for AI! - + Confirm - + Changing the mod directory affects all your profiles! Mods not present (or named differently) in the new location will be disabled in all profiles. There is no way to undo this unless you backed up your profiles manually. Proceed? - + Select base directory - + Select download directory - + Select mod directory - + Select cache directory - + Select profiles directory - + Select overwrite directory - + Confirm? - + This will make all dialogs show up again where you checked the "Remember selection"-box. Continue? diff --git a/src/organizercore.cpp b/src/organizercore.cpp index fe720a0c..b66895db 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1183,8 +1183,8 @@ ModList *OrganizerCore::modList() QStringList OrganizerCore::modsSortedByProfilePriority() const { QStringList res; - for (int i = currentProfile()->getPriorityMinimum(); - i < currentProfile()->getPriorityMinimum() + (int)currentProfile()->numRegularMods(); + for (int i = currentProfile()->getPriorityMinimum(); + i < currentProfile()->getPriorityMinimum() + (int)currentProfile()->numRegularMods(); ++i) { int modIndex = currentProfile()->modIndexByPriority(i); res.push_back(ModInfo::getByIndex(modIndex)->name()); @@ -1289,12 +1289,16 @@ HANDLE OrganizerCore::spawnBinaryProcess(const QFileInfo &binary, .exists()) && (m_Settings.getLoadMechanism() == LoadMechanism::LOAD_MODORGANIZER)) { if (!testForSteam()) { - if (QuestionBoxMemory::query(window, "steamQuery", binary.fileName(), - tr("Start Steam?"), - tr("Steam is required to be running already to correctly start the game. " - "Should MO try to start steam now?"), - QDialogButtonBox::Yes | QDialogButtonBox::No) == QDialogButtonBox::Yes) { + QDialogButtonBox::StandardButton result; + result = QuestionBoxMemory::query(window, "steamQuery", binary.fileName(), + tr("Start Steam?"), + tr("Steam is required to be running already to correctly start the game. " + "Should MO try to start steam now?"), + QDialogButtonBox::Yes | QDialogButtonBox::No | QDialogButtonBox::Cancel); + if (result == QDialogButtonBox::Yes) { startSteam(window); + } else if(result == QDialogButtonBox::Cancel) { + return INVALID_HANDLE_VALUE; } } } @@ -1334,7 +1338,7 @@ HANDLE OrganizerCore::spawnBinaryProcess(const QFileInfo &binary, return INVALID_HANDLE_VALUE; } } - + QString modsPath = settings().getModDirectory(); // Check if this a request with either an executable or a working directory under our mods folder @@ -1727,7 +1731,7 @@ void OrganizerCore::refreshBSAList() if (m_ActiveArchives.isEmpty()) { m_ActiveArchives = m_DefaultArchives; } - + if (m_UserInterface != nullptr) { m_UserInterface->updateBSAList(m_DefaultArchives, m_ActiveArchives); } -- cgit v1.3.1 From 2212ad6f1c0bbaff7025cdb7227023661e399596 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Thu, 29 Nov 2018 08:17:28 -0600 Subject: Add executable blacklisting --- src/mainwindow.cpp | 14 +-- src/organizer_en.ts | 263 +++++++++++++++++++++++++++++-------------------- src/organizercore.cpp | 20 +++- src/organizercore.h | 2 +- src/settings.cpp | 18 ++++ src/settings.h | 7 +- src/settingsdialog.cpp | 27 +++++ src/settingsdialog.h | 13 ++- src/settingsdialog.ui | 22 ++++- src/usvfsconnector.cpp | 13 ++- src/usvfsconnector.h | 2 +- 11 files changed, 272 insertions(+), 129 deletions(-) (limited to 'src/organizercore.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d0591d6e..9a0e02aa 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2877,7 +2877,7 @@ void MainWindow::createSeparator_clicked() } int newPriority = -1; - if (m_ContextRow >= 0 && m_ModListSortProxy->sortColumn() == ModList::COL_PRIORITY) + if (m_ContextRow >= 0 && m_ModListSortProxy->sortColumn() == ModList::COL_PRIORITY) { newPriority = m_OrganizerCore.currentProfile()->getModPriority(m_ContextRow); } @@ -2885,7 +2885,7 @@ void MainWindow::createSeparator_clicked() if (m_OrganizerCore.createMod(name) == nullptr) { return; } m_OrganizerCore.refreshModList(); - if (newPriority >= 0) + if (newPriority >= 0) { m_OrganizerCore.modList()->changeModPriority(ModInfo::getIndex(name), newPriority); } @@ -4129,7 +4129,7 @@ void MainWindow::on_actionSettings_triggered() updateDownloadListDelegate(); - m_OrganizerCore.updateVFSParams(settings.logLevel(), settings.crashDumpsType()); + m_OrganizerCore.updateVFSParams(settings.logLevel(), settings.crashDumpsType(), settings.executablesBlacklist()); m_OrganizerCore.cycleDiagnostics(); } @@ -4405,8 +4405,8 @@ void MainWindow::sendSelectedPluginsToBottom_clicked() void MainWindow::sendSelectedPluginsToPriority_clicked() { bool ok; - int newPriority = QInputDialog::getInt(this, - tr("Set Priority"), tr("Set the priority of the selected plugins"), + int newPriority = QInputDialog::getInt(this, + tr("Set Priority"), tr("Set the priority of the selected plugins"), 0, 0, INT_MAX, 1, &ok); if (!ok) return; @@ -5678,8 +5678,8 @@ void MainWindow::sendSelectedModsToBottom_clicked() void MainWindow::sendSelectedModsToPriority_clicked() { bool ok; - int newPriority = QInputDialog::getInt(this, - tr("Set Priority"), tr("Set the priority of the selected mods"), + int newPriority = QInputDialog::getInt(this, + tr("Set Priority"), tr("Set the priority of the selected mods"), 0, 0, INT_MAX, 1, &ok); if (!ok) return; diff --git a/src/organizer_en.ts b/src/organizer_en.ts index 9b1294ac..518e49bc 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -4041,113 +4041,113 @@ p, li { white-space: pre-wrap; } - + drag&drop failed: %1 - + Confirm - + Are you sure you want to remove "%1"? - + Flags - + Content - + Mod Name - + Version - + Priority - + Category - + Source Game - + Nexus ID - + Installation - - + + unknown - + Name of your mods - + Version of the mod (if available) - + Installation priority of your mod. The higher, the more "important" it is and thus overwrites files from mods with lower priority. - + Category of the mod. - + The source game which was the origin of this mod. - + Id of the mod as used on Nexus. - + Emblemes to highlight things that might require attention. - + Depicts the content of the mod:<br><table cellspacing=7><tr><td><img src=":/MO/gui/content/plugin" width=32/></td><td>Game plugins (esp/esm/esl)</td></tr><tr><td><img src=":/MO/gui/content/interface" width=32/></td><td>Interface</td></tr><tr><td><img src=":/MO/gui/content/mesh" width=32/></td><td>Meshes</td></tr><tr><td><img src=":/MO/gui/content/bsa" width=32/></td><td>BSA</td></tr><tr><td><img src=":/MO/gui/content/texture" width=32/></td><td>Textures</td></tr><tr><td><img src=":/MO/gui/content/sound" width=32/></td><td>Sounds</td></tr><tr><td><img src=":/MO/gui/content/music" width=32/></td><td>Music</td></tr><tr><td><img src=":/MO/gui/content/string" width=32/></td><td>Strings</td></tr><tr><td><img src=":/MO/gui/content/script" width=32/></td><td>Scripts (Papyrus)</td></tr><tr><td><img src=":/MO/gui/content/skse" width=32/></td><td>Script Extender plugins</td></tr><tr><td><img src=":/MO/gui/content/skyproc" width=32/></td><td>SkyProc Patcher</td></tr><tr><td><img src=":/MO/gui/content/menu" width=32/></td><td>Mod Configuration Menu</td></tr><tr><td><img src=":/MO/gui/content/inifile" width=32/></td><td>INI files</td></tr><tr><td><img src=":/MO/gui/content/modgroup" width=32/></td><td>ModGroup files</td></tr></table> - + Time this mod was installed @@ -4353,91 +4353,103 @@ Continue launching %1? - + + Blacklisted Executable + + + + + The executable you are attempted to launch is blacklisted in the virtual file system. This will likely prevent the executable, and any executables that are launched by this one, from seeing any mods. This could extend to INI files, save games and any other virtualized files. + +Continue launching %1? + + + + No profile set - + Failed to refresh list of esps: %1 - + Multiple esps/esls activated, please check that they don't conflict. - + Download? - + A download has been started but no installed page plugin recognizes it. If you download anyway no information (i.e. version) will be associated with the download. Continue? - + failed to update mod list: %1 - - + + login successful - + Login failed - + Login failed, try again? - + login failed: %1. Download will not be associated with an account - + login failed: %1 - + login failed: %1. You need to log-in with Nexus to update MO. - + MO1 "Script Extender" load mechanism has left hook.dll in your game folder - - + + Description missing - + <a href="%1">hook.dll</a> has been found in your game folder (right click to copy the full path). This is most likely a leftover of setting the ModOrganizer 1 load mechanism to "Script Extender", in which case you must remove this file either by changing the load mechanism in ModOrganizer 1 or manually removing the file, otherwise the game is likely to crash and burn. - + failed to save load order: %1 - + The designated write target "%1" is not enabled. @@ -5398,7 +5410,7 @@ If the folder was still in use, restart MO and try again. - + Mod Organizer @@ -5475,12 +5487,12 @@ If the folder was still in use, restart MO and try again. - + Script Extender - + Proxy DLL @@ -5694,18 +5706,18 @@ Select Show Details option to see the full change-log. - - + + attempt to store setting for unknown plugin "%1" - + Error - + Failed to create "%1", you may not have the necessary permission. path remains unchanged. @@ -6042,52 +6054,52 @@ p, li { white-space: pre-wrap; } - + Author: - + Version: - + Description: - + Key - + Value - + Blacklisted Plugins (use <del> to remove): - + Workarounds - + Steam App ID - + The Steam AppID for your game - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -6103,17 +6115,17 @@ p, li { white-space: pre-wrap; } - + Load Mechanism - + Select loading mechanism. See help for details. - + Mod Organizer needs a dll to be injected into the game so all mods are visible to it. There are several means to do this: *Mod Organizer* (default) In this mode the Mod Organizer itself injects the dll. The disadvantage is that you always have to start the game through MO or a link created by it. @@ -6124,17 +6136,17 @@ If you use the Steam version of Oblivion the default will NOT work. In this case - + NMM Version - + The Version of Nexus Mod Manager to impersonate. - + Mod Organizer uses an API provided by the Nexus to provide features like checking for updates and downloading files. Unfortunately this API has not been made available officially to third party tools like MO so we have to impersonate the Nexus Mod Manager to be allowed in. On top of this Nexus has used the client identification to lock out outdated versions of NMM to force users to update. This means that MO also needs to impersonate the new version of NMM even if MO doesn't need an update. Therefore you can configure the version to identify as here. Please note that MO does identify itself as MO to the webserver, it's not lying about what it is. It is merely adding a "compatible" NMM version to the user agent. @@ -6143,44 +6155,44 @@ tl;dr-version: If Nexus-features don't work, insert the current version num - + Enforces that inactive ESPs and ESMs are never loaded. - + It seems that the Games occasionally load ESP or ESM files even if they haven't been activated as plugins. I don't yet know what the circumstances are, but user reports imply it is in some cases unwanted. If this is checked, ESPs and ESMs not checked in the List are invisible to the game and can not be loaded. - + Hide inactive ESPs/ESMs - + If checked, files (i.e. esps, esms and bsas) belonging to the core game can not be disabled in the UI. (default: on) - + If checked, files (i.e. esps, esms and bsas) belonging to the core game can not be disabled in the UI. (default: on) Uncheck this if you want to use Mod Organizer with total conversions (like Nehrim) but be aware that the game will crash if required files are not enabled. - + Force-enable game files - + Disable this to no longer display mods installed outside MO in the mod list (left pane). Assets from those mods will then be treated as having lowest mod priority together with the original game content. - + By default Mod Organizer will display esp+bsa bundles installed with foreign tools as mods (left pane). This allows you to control their priority in relation to other mods. This is particularly useful if you also use Steam Workshop to install mods. However, if you installed loose file mods outside MO which conflict with BSAs also installed outside MO those conflicts can't be resolved correctly. @@ -6188,44 +6200,63 @@ If you disable this feature, MO will only display official DLCs this way. Please - + Display mods installed outside MO - - + + For Skyrim, this can be used instead of Archive Invalidation. It should make AI redundant for all Profiles. For the other games this is not a sufficient replacement for AI! - + Back-date BSAs + + + Add executables to the blacklist to prevent them from +accessing the virtual file system. This is useful to prevent +unintended programs from being hooked. Hooking unintended +programs may affect the execution of these programs or the +programs you are intentionally running. + + + + + Add executables to the blacklist to prevent them from accessing the virtual file system. This is useful to prevent unintended programs from being hooked. Hooking unintended programs may affect the execution of these programs or the programs you are intentionally running. + + + Configure Executables Blacklist + + + + These are workarounds for problems with Mod Organizer. Please make sure you read the help text before changing anything here. - + Diagnostics - + Log Level - + Decides the amount of data printed to "ModOrganizer.log" - + Decides the amount of data printed to "ModOrganizer.log". "Debug" produces very useful information for finding problems. There is usually no noteworthy performance impact but the file may become rather large. If this is a problem you may prefer the "Info" level for regluar use. On the "Error" level the log file usually remains empty. @@ -6233,37 +6264,37 @@ For the other games this is not a sufficient replacement for AI! - + Debug - + Info (recommended) - + Warning - + Error - + Crash Dumps - + Decides which type of crash dumps are collected when injected processes crash. - + Decides which type of crash dumps are collected when injected processes crash. "None" Disables the generation of crash dumps by MO. @@ -6274,37 +6305,37 @@ For the other games this is not a sufficient replacement for AI! - + None - + Mini (recommended) - + Data - + Full - + Max Dumps To Keep - + Maximum number of crash dumps to keep on disk. Use 0 for unlimited. - + Maximum number of crash dumps to keep on disk. Use 0 for unlimited. Set "Crash Dumps" above to None to disable crash dump collection. @@ -6312,12 +6343,12 @@ For the other games this is not a sufficient replacement for AI! - + Hint: right click link and copy link location - + Logs and crash dumps are stored under your current instance in the <a href="LOGS_FULL_PATH">LOGS_DIR</a> and <a href="DUMPS_FULL_PATH">DUMPS_DIR</a> folders. @@ -6327,52 +6358,68 @@ For the other games this is not a sufficient replacement for AI! - + Confirm - + Changing the mod directory affects all your profiles! Mods not present (or named differently) in the new location will be disabled in all profiles. There is no way to undo this unless you backed up your profiles manually. Proceed? - + + Executables Blacklist + + + + + Enter one executable per line to be blacklisted from the virtual file system. +Mods and other virtualized files will not be visible to these executables and +any executables launched by them. + +Example: + Chrome.exe + Firefox.exe + + + + Select base directory - + Select download directory - + Select mod directory - + Select cache directory - + Select profiles directory - + Select overwrite directory - + Confirm? - + This will make all dialogs show up again where you checked the "Remember selection"-box. Continue? @@ -6576,7 +6623,7 @@ On Windows XP: UsvfsConnector - + Preparing vfs diff --git a/src/organizercore.cpp b/src/organizercore.cpp index b66895db..9ac3cb63 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -762,9 +762,9 @@ void OrganizerCore::prepareVFS() m_USVFS.updateMapping(fileMapping(m_CurrentProfile->name(), QString())); } -void OrganizerCore::updateVFSParams(int logLevel, int crashDumpsType) { +void OrganizerCore::updateVFSParams(int logLevel, int crashDumpsType, QString executableBlacklist) { setGlobalCrashDumpsType(crashDumpsType); - m_USVFS.updateParams(logLevel, crashDumpsType); + m_USVFS.updateParams(logLevel, crashDumpsType, executableBlacklist); } bool OrganizerCore::cycleDiagnostics() { @@ -1339,10 +1339,24 @@ HANDLE OrganizerCore::spawnBinaryProcess(const QFileInfo &binary, } } + for (auto exec : settings().executablesBlacklist().split(";")) { + if (exec.compare(binary.fileName(), Qt::CaseInsensitive)) { + if (QuestionBoxMemory::query(window, QString("blacklistedExecutable"), binary.fileName(), + tr("Blacklisted Executable"), + tr("The executable you are attempted to launch is blacklisted in the virtual file" + " system. This will likely prevent the executable, and any executables that are" + " launched by this one, from seeing any mods. This could extend to INI files, save" + " games and any other virtualized files.\n\nContinue launching %1?").arg(binary.fileName()), + QDialogButtonBox::Yes | QDialogButtonBox::No) == QDialogButtonBox::No) { + return INVALID_HANDLE_VALUE; + } + } + } + QString modsPath = settings().getModDirectory(); // Check if this a request with either an executable or a working directory under our mods folder - // then will start the processs in a virtualized "environment" with the appropriate paths fixed: + // then will start the process in a virtualized "environment" with the appropriate paths fixed: // (i.e. mods\FNIS\path\exe => game\data\path\exe) QString cwdPath = currentDirectory.absolutePath(); bool virtualizedCwd = cwdPath.startsWith(modsPath, Qt::CaseInsensitive); diff --git a/src/organizercore.h b/src/organizercore.h index 28ecef48..086fa11d 100644 --- a/src/organizercore.h +++ b/src/organizercore.h @@ -167,7 +167,7 @@ public: void prepareVFS(); - void updateVFSParams(int logLevel, int crashDumpsType); + void updateVFSParams(int logLevel, int crashDumpsType, QString executableBlacklist); bool cycleDiagnostics(); diff --git a/src/settings.cpp b/src/settings.cpp index ce3a68ff..c311ef29 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -386,6 +386,20 @@ QColor Settings::pluginListContainedColor() const return m_Settings.value("Settings/containedColor", QColor(0, 0, 255, 64)).value(); } +QString Settings::executablesBlacklist() const +{ + return m_Settings.value("Settings/executable_blacklist", ( + QStringList() + << "Chrome.exe" + << "Firefox.exe" + << "TSVNCache.exe" + << "TGitCache.exe" + << "Steam.exe" + << "GameOverlayUI.exe" + ).join(";") + ).toString(); +} + void Settings::setNexusLogin(QString username, QString password) { m_Settings.setValue("Settings/nexus_login", true); @@ -1080,6 +1094,8 @@ Settings::WorkaroundsTab::WorkaroundsTab(Settings *m_parent, m_forceEnableBox->setChecked(m_parent->forceEnableCoreFiles()); m_displayForeignBox->setChecked(m_parent->displayForeign()); + m_dialog.setExecutableBlacklist(m_parent->executablesBlacklist()); + } void Settings::WorkaroundsTab::update() @@ -1094,4 +1110,6 @@ void Settings::WorkaroundsTab::update() m_Settings.setValue("Settings/hide_unchecked_plugins", m_hideUncheckedBox->isChecked()); m_Settings.setValue("Settings/force_enable_core_files", m_forceEnableBox->isChecked()); m_Settings.setValue("Settings/display_foreign", m_displayForeignBox->isChecked()); + + m_Settings.setValue("Settings/executable_blacklist", m_dialog.getExecutableBlacklist()); } diff --git a/src/settings.h b/src/settings.h index 8fe053e8..667b1b4c 100644 --- a/src/settings.h +++ b/src/settings.h @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with Mod Organizer. If not, see . */ -#ifndef WORKAROUNDS_H -#define WORKAROUNDS_H +#ifndef SETTINGS_H +#define SETTINGS_H #include "loadmechanism.h" @@ -227,6 +227,7 @@ public: QColor pluginListContainedColor() const; + QString executablesBlacklist() const; /** * @brief set the nexus login information @@ -525,4 +526,4 @@ private: }; -#endif // WORKAROUNDS_H +#endif // SETTINGS_H diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index de18a850..e1c4b10d 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -34,6 +34,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #define WIN32_LEAN_AND_MEAN #include @@ -115,6 +116,32 @@ void SettingsDialog::on_categoriesBtn_clicked() } } +void SettingsDialog::on_execBlacklistBtn_clicked() +{ + bool ok = false; + QString result = QInputDialog::getMultiLineText( + this, + tr("Executables Blacklist"), + tr("Enter one executable per line to be blacklisted from the virtual file system.\n" + "Mods and other virtualized files will not be visible to these executables and\n" + "any executables launched by them.\n\n" + "Example:\n" + " Chrome.exe\n" + " Firefox.exe"), + m_ExecutableBlacklist.split(";").join("\n"), + &ok + ); + if (ok) { + QStringList blacklist; + for (auto exec : result.split("\n")) { + if (exec.trimmed().endsWith(".exe", Qt::CaseInsensitive)) { + blacklist << exec.trimmed(); + } + } + m_ExecutableBlacklist = blacklist.join(";"); + } +} + void SettingsDialog::on_bsaDateBtn_clicked() { IPluginGame const *game diff --git a/src/settingsdialog.h b/src/settingsdialog.h index 386cd24e..911f910d 100644 --- a/src/settingsdialog.h +++ b/src/settingsdialog.h @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with Mod Organizer. If not, see . */ -#ifndef WORKAROUNDDIALOG_H -#define WORKAROUNDDIALOG_H +#ifndef SETTINGSDIALOG_H +#define SETTINGSDIALOG_H #include "tutorabledialog.h" #include @@ -69,17 +69,22 @@ public: QColor getOverwrittenColor() { return m_OverwrittenColor; } QColor getContainsColor() { return m_ContainsColor; } QColor getContainedColor() { return m_ContainedColor; } + QString getExecutableBlacklist() { return m_ExecutableBlacklist; } void setOverwritingColor(QColor col) { m_OverwritingColor = col; } void setOverwrittenColor(QColor col) { m_OverwrittenColor = col; } void setContainsColor(QColor col) { m_ContainsColor = col; } void setContainedColor(QColor col) { m_ContainedColor = col; } + void setExecutableBlacklist(QString blacklist) { m_ExecutableBlacklist = blacklist; } + private slots: void on_loginCheckBox_toggled(bool checked); void on_categoriesBtn_clicked(); + void on_execBlacklistBtn_clicked(); + void on_bsaDateBtn_clicked(); void on_browseDownloadDirBtn_clicked(); @@ -134,8 +139,10 @@ private: QColor m_OverwrittenColor; QColor m_ContainsColor; QColor m_ContainedColor; + + QString m_ExecutableBlacklist; }; -#endif // WORKAROUNDDIALOG_H +#endif // SETTINGSDIALOG_H diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index 555180b5..ae13b9f2 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -17,7 +17,7 @@ - 4 + 5 @@ -1037,6 +1037,26 @@ For the other games this is not a sufficient replacement for AI! + + + + Add executables to the blacklist to prevent them from +accessing the virtual file system. This is useful to prevent +unintended programs from being hooked. Hooking unintended +programs may affect the execution of these programs or the +programs you are intentionally running. + + + Add executables to the blacklist to prevent them from accessing the virtual file system. This is useful to prevent unintended programs from being hooked. Hooking unintended programs may affect the execution of these programs or the programs you are intentionally running. + + + Configure Executables Blacklist + + + false + + + diff --git a/src/usvfsconnector.cpp b/src/usvfsconnector.cpp index 4ffc81c0..9c81d0d9 100644 --- a/src/usvfsconnector.cpp +++ b/src/usvfsconnector.cpp @@ -132,7 +132,11 @@ UsvfsConnector::UsvfsConnector() CreateVFS(¶ms); - BlacklistExecutable(L"TSVNCache.exe"); + ClearExecutableBlacklist(); + for (auto exec : Settings::instance().executablesBlacklist().split(";")) { + std::wstring buf = exec.toStdWString(); + BlacklistExecutable(buf.data()); + } m_LogWorker.moveToThread(&m_WorkerThread); @@ -199,6 +203,11 @@ void UsvfsConnector::updateMapping(const MappingType &mapping) */ } -void UsvfsConnector::updateParams(int logLevel, int crashDumpsType) { +void UsvfsConnector::updateParams(int logLevel, int crashDumpsType, QString executableBlacklist) { USVFSUpdateParams(::logLevel(logLevel), ::crashDumpsType(crashDumpsType)); + ClearExecutableBlacklist(); + for (auto exec : executableBlacklist.split(";")) { + std::wstring buf = exec.toStdWString(); + BlacklistExecutable(buf.data()); + } } diff --git a/src/usvfsconnector.h b/src/usvfsconnector.h index 40f8857b..3aefb703 100644 --- a/src/usvfsconnector.h +++ b/src/usvfsconnector.h @@ -82,7 +82,7 @@ public: ~UsvfsConnector(); void updateMapping(const MappingType &mapping); - void updateParams(int logLevel, int crashDumpsType); + void updateParams(int logLevel, int crashDumpsType, QString executableBlacklist); private: -- cgit v1.3.1 From 9431597e6683ed74285e78057145f5ff6d326bb9 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Thu, 29 Nov 2018 15:33:47 -0600 Subject: Correct comparison logic for blacklist warning --- src/organizercore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/organizercore.cpp') diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 9ac3cb63..4dbe7c86 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1340,7 +1340,7 @@ HANDLE OrganizerCore::spawnBinaryProcess(const QFileInfo &binary, } for (auto exec : settings().executablesBlacklist().split(";")) { - if (exec.compare(binary.fileName(), Qt::CaseInsensitive)) { + if (exec.compare(binary.fileName(), Qt::CaseInsensitive) == 0) { if (QuestionBoxMemory::query(window, QString("blacklistedExecutable"), binary.fileName(), tr("Blacklisted Executable"), tr("The executable you are attempted to launch is blacklisted in the virtual file" -- cgit v1.3.1 From 93763a93640754f468d4a5d1aeaf5ad4effa6d56 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Sat, 8 Dec 2018 11:15:16 -0600 Subject: Add workaround setting to prevent the GUI from locking when running an executable --- src/organizercore.cpp | 5 ++- src/settings.cpp | 8 ++++ src/settings.h | 6 +++ src/settingsdialog.ui | 117 +++++++++++++++++++++++++++++--------------------- 4 files changed, 85 insertions(+), 51 deletions(-) (limited to 'src/organizercore.cpp') diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 4dbe7c86..1a5a9484 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1223,7 +1223,7 @@ HANDLE OrganizerCore::spawnBinaryDirect(const QFileInfo &binary, LPDWORD exitCode) { HANDLE processHandle = spawnBinaryProcess(binary, arguments, profileName, currentDirectory, steamAppID, customOverwrite); - if (processHandle != INVALID_HANDLE_VALUE) { + if (Settings::instance().lockGUI() && processHandle != INVALID_HANDLE_VALUE) { std::unique_ptr dlg; ILockedWaitingForProcess* uilock = nullptr; @@ -1485,6 +1485,9 @@ HANDLE OrganizerCore::startApplication(const QString &executable, bool OrganizerCore::waitForApplication(HANDLE handle, LPDWORD exitCode) { + if (!Settings::instance().lockGUI()) + return true; + ILockedWaitingForProcess* uilock = nullptr; if (m_UserInterface != nullptr) { uilock = m_UserInterface->lock(); diff --git a/src/settings.cpp b/src/settings.cpp index 3abb0988..b067106f 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -210,6 +210,11 @@ bool Settings::forceEnableCoreFiles() const return m_Settings.value("Settings/force_enable_core_files", true).toBool(); } +bool Settings::lockGUI() const +{ + return m_Settings.value("Settings/lock_gui", true).toBool(); +} + bool Settings::automaticLoginEnabled() const { return m_Settings.value("Settings/nexus_login", false).toBool(); @@ -1060,6 +1065,7 @@ Settings::WorkaroundsTab::WorkaroundsTab(Settings *m_parent, , m_hideUncheckedBox(m_dialog.findChild("hideUncheckedBox")) , m_forceEnableBox(m_dialog.findChild("forceEnableBox")) , m_displayForeignBox(m_dialog.findChild("displayForeignBox")) + , m_lockGUIBox(m_dialog.findChild("lockGUIBox")) { m_appIDEdit->setText(m_parent->getSteamAppID()); @@ -1093,6 +1099,7 @@ Settings::WorkaroundsTab::WorkaroundsTab(Settings *m_parent, m_hideUncheckedBox->setChecked(m_parent->hideUncheckedPlugins()); m_forceEnableBox->setChecked(m_parent->forceEnableCoreFiles()); m_displayForeignBox->setChecked(m_parent->displayForeign()); + m_lockGUIBox->setChecked(m_parent->lockGUI()); m_dialog.setExecutableBlacklist(m_parent->executablesBlacklist()); @@ -1110,6 +1117,7 @@ void Settings::WorkaroundsTab::update() m_Settings.setValue("Settings/hide_unchecked_plugins", m_hideUncheckedBox->isChecked()); m_Settings.setValue("Settings/force_enable_core_files", m_forceEnableBox->isChecked()); m_Settings.setValue("Settings/display_foreign", m_displayForeignBox->isChecked()); + m_Settings.setValue("Settings/lock_gui", m_lockGUIBox->isChecked()); m_Settings.setValue("Settings/executable_blacklist", m_dialog.getExecutableBlacklist()); diff --git a/src/settings.h b/src/settings.h index 667b1b4c..2b8186f3 100644 --- a/src/settings.h +++ b/src/settings.h @@ -109,6 +109,11 @@ public: */ bool forceEnableCoreFiles() const; + /** + * @return true if the GUI should be locked when running executables + */ + bool lockGUI() const; + /** * @brief register download speed * @param url complete download url @@ -496,6 +501,7 @@ private: QCheckBox *m_hideUncheckedBox; QCheckBox *m_forceEnableBox; QCheckBox *m_displayForeignBox; + QCheckBox *m_lockGUIBox; }; private slots: diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index 91bfca4e..203078a6 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -966,57 +966,77 @@ tl;dr-version: If Nexus-features don't work, insert the current version number o - - - false - - - Enforces that inactive ESPs and ESMs are never loaded. - - - It seems that the Games occasionally load ESP or ESM files even if they haven't been activated as plugins. -I don't yet know what the circumstances are, but user reports imply it is in some cases unwanted. If this is checked, ESPs and ESMs not checked in the List are invisible to the game and can not be loaded. - - - Hide inactive ESPs/ESMs - - - - - - - If checked, files (i.e. esps, esms and bsas) belonging to the core game can not be disabled in the UI. (default: on) - - - If checked, files (i.e. esps, esms and bsas) belonging to the core game can not be disabled in the UI. (default: on) + + + + + If checked, files (i.e. esps, esms and bsas) belonging to the core game can not be disabled in the UI. (default: on) + + + If checked, files (i.e. esps, esms and bsas) belonging to the core game can not be disabled in the UI. (default: on) Uncheck this if you want to use Mod Organizer with total conversions (like Nehrim) but be aware that the game will crash if required files are not enabled. - - - Force-enable game files - - - true - - - - - - - Disable this to no longer display mods installed outside MO in the mod list (left pane). Assets from those mods will then be treated as having lowest mod priority together with the original game content. - - - By default Mod Organizer will display esp+bsa bundles installed with foreign tools as mods (left pane). This allows you to control their priority in relation to other mods. This is particularly useful if you also use Steam Workshop to install mods. + + + Force-enable game files + + + true + + + + + + + Disable this to no longer display mods installed outside MO in the mod list (left pane). Assets from those mods will then be treated as having lowest mod priority together with the original game content. + + + By default Mod Organizer will display esp+bsa bundles installed with foreign tools as mods (left pane). This allows you to control their priority in relation to other mods. This is particularly useful if you also use Steam Workshop to install mods. However, if you installed loose file mods outside MO which conflict with BSAs also installed outside MO those conflicts can't be resolved correctly. If you disable this feature, MO will only display official DLCs this way. Please note that plugins (esps, esms, and esls) displayed in the right pane are completely unaffected by this feature. - - - Display mods installed outside MO - - - true - - + + + Display mods installed outside MO + + + true + + + + + + + false + + + Enforces that inactive ESPs and ESMs are never loaded. + + + It seems that the Games occasionally load ESP or ESM files even if they haven't been activated as plugins. +I don't yet know what the circumstances are, but user reports imply it is in some cases unwanted. If this is checked, ESPs and ESMs not checked in the List are invisible to the game and can not be loaded. + + + Hide inactive ESPs/ESMs + + + + + + + Disable this to prevent the GUI from being locked when running an executable. This may result in abnormal behavior. + + + Disable this to prevent the GUI from being locked when running an executable. This may result in abnormal behavior. + + + Lock GUI when running executable + + + true + + + + @@ -1330,9 +1350,6 @@ programs you are intentionally running. appIDEdit mechanismBox nmmVersionEdit - hideUncheckedBox - forceEnableBox - displayForeignBox bsaDateBtn tabWidget -- cgit v1.3.1 From d7e6fd1dd65edc265b8d44928dc02cd4c76af069 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Sat, 8 Dec 2018 20:23:45 -0600 Subject: Don't disable ESMs when disabling mods if alternatives are available --- src/organizercore.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/organizercore.cpp') diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 1a5a9484..d52ef40b 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1772,7 +1772,16 @@ void OrganizerCore::updateModActiveState(int index, bool active) QDir dir(modInfo->absolutePath()); for (const QString &esm : dir.entryList(QStringList() << "*.esm", QDir::Files)) { - m_PluginList.enableESP(esm, active); + const FileEntry::Ptr file = m_DirectoryStructure->findFile(ToWString(esm)); + if (file.get() == nullptr) { + qWarning("failed to activate %s", qPrintable(esm)); + continue; + } + + if (active != m_PluginList.isEnabled(esm) + && file->getAlternatives().empty()) { + m_PluginList.enableESP(esm, active); + } } int enabled = 0; for (const QString &esl : -- cgit v1.3.1