From 4ff751fb7e592376de5faab44ab7dd6fe70dbdd0 Mon Sep 17 00:00:00 2001 From: Tannin Date: Thu, 19 Nov 2015 19:09:34 +0100 Subject: some fixes/disabled code required since hook.dll is gone --- src/installationmanager.cpp | 5 ++++- src/loadmechanism.cpp | 7 +++++++ src/main.cpp | 14 -------------- src/profile.cpp | 4 +++- src/shared/appconfig.inc | 1 - 5 files changed, 14 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp index a6af1a7f..1e06965d 100644 --- a/src/installationmanager.cpp +++ b/src/installationmanager.cpp @@ -694,7 +694,10 @@ bool InstallationManager::install(const QString &fileName, GuessedValue bool archiveOpen = m_CurrentArchive->open(ToWString(QDir::toNativeSeparators(fileName)).c_str(), new MethodCallback(this, &InstallationManager::queryPassword)); if (!archiveOpen) { - qDebug("integrated archiver can't open %s. errorcode %d", qPrintable(fileName), m_CurrentArchive->getLastError()); + qDebug("integrated archiver can't open %s: %s (%d)", + qPrintable(fileName), + qPrintable(getErrorString(m_CurrentArchive->getLastError())), + m_CurrentArchive->getLastError()); } ON_BLOCK_EXIT(std::bind(&InstallationManager::postInstallCleanup, this)); diff --git a/src/loadmechanism.cpp b/src/loadmechanism.cpp index 4d06bea9..4f9f8b1b 100644 --- a/src/loadmechanism.cpp +++ b/src/loadmechanism.cpp @@ -132,6 +132,9 @@ void LoadMechanism::deactivateScriptExtender() QDir pluginsDir(game->gameDirectory().absolutePath() + "/data/" + extender->name() + "/plugins"); +#pragma "implement this for usvfs" + + /* QString hookDLLName = ToQString(AppConfig::hookDLLName()); if (QFile(pluginsDir.absoluteFilePath(hookDLLName)).exists()) { // remove dll from SE plugins directory @@ -141,6 +144,7 @@ void LoadMechanism::deactivateScriptExtender() } removeHintFile(pluginsDir); + */ } catch (const std::exception &e) { QMessageBox::critical(nullptr, QObject::tr("Failed to deactivate script extender loading"), e.what()); } @@ -191,6 +195,8 @@ void LoadMechanism::activateScriptExtender() pluginsDir.mkpath("."); } +#pragma message("implement this for usvfs") +/* QString targetPath = pluginsDir.absoluteFilePath(ToQString(AppConfig::hookDLLName())); QString hookDLLPath = qApp->applicationDirPath() + "/" + QString::fromStdWString(AppConfig::hookDLLName()); @@ -210,6 +216,7 @@ void LoadMechanism::activateScriptExtender() } } writeHintFile(pluginsDir); +*/ } catch (const std::exception &e) { QMessageBox::critical(nullptr, QObject::tr("Failed to set up script extender loading"), e.what()); } diff --git a/src/main.cpp b/src/main.cpp index 773bfc16..07d6fa19 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -131,19 +131,6 @@ bool bootstrap() createAndMakeWritable(AppConfig::overwritePath()); createAndMakeWritable(AppConfig::logPath()); - // verify the hook-dll exists - QString dllName = qApp->applicationDirPath() + "/" + ToQString(AppConfig::hookDLLName()); - - if (::GetModuleHandleW(ToWString(dllName).c_str()) != nullptr) { - throw std::runtime_error("hook.dll already loaded! You can't start Mod Organizer from within itself (not even indirectly)"); - } - - HMODULE dllMod = ::LoadLibraryW(ToWString(dllName).c_str()); - if (dllMod == nullptr) { - throw windows_error("hook.dll is missing or invalid"); - } - ::FreeLibrary(dllMod); - return true; } @@ -516,7 +503,6 @@ int main(int argc, char *argv[]) } game->setGameVariant(settings.value("game_edition").toString()); - #pragma message("edition isn't used?") qDebug("managing game at %s", qPrintable(QDir::toNativeSeparators(gamePath))); diff --git a/src/profile.cpp b/src/profile.cpp index b990fbc1..0b9fa06f 100644 --- a/src/profile.cpp +++ b/src/profile.cpp @@ -585,7 +585,9 @@ bool Profile::invalidationActive(bool *supported) const } return false; } else { - *supported = false; + if (supported != nullptr) { + *supported = false; + } } return false; } diff --git a/src/shared/appconfig.inc b/src/shared/appconfig.inc index e2dbfe20..ac6c210f 100644 --- a/src/shared/appconfig.inc +++ b/src/shared/appconfig.inc @@ -14,7 +14,6 @@ APPPARAM(std::wstring, iniFileName, L"ModOrganizer.ini") APPPARAM(std::wstring, proxyDLLTarget, L"steam_api.dll") APPPARAM(std::wstring, proxyDLLOrig, L"steam_api_orig.dll") // needs to be identical to the value used in proxydll-project APPPARAM(std::wstring, proxyDLLSource, L"proxy.dll") -APPPARAM(std::wstring, hookDLLName, L"hook.dll") // needs to be identical to the value used in proxydll-project APPPARAM(const wchar_t*, localSavePlaceholder, L"__MOProfileSave__\\") APPPARAM(std::wstring, firstStepsTutorial, L"tutorial_firststeps_main.js") -- cgit v1.3.1