diff --git a/src/proxy/proxypython.cpp b/src/proxy/proxypython.cpp index fe2f4c7..74ec327 100644 --- a/src/proxy/proxypython.cpp +++ b/src/proxy/proxypython.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include "resource.h" @@ -92,6 +93,10 @@ bool ProxyPython::init(IOrganizer *moInfo) } m_LoadFailure = FAIL_OTHER; + if (QCoreApplication::applicationDirPath().contains(';')) { + m_LoadFailure = FAIL_SEMICOLON; + return true; + } QString pythonPath = m_MOInfo->pluginSetting(name(), "python_dir").toString(); @@ -213,6 +218,8 @@ std::vector ProxyPython::activeProblems() const result.push_back(PROBLEM_PYTHONDETECTION); } else if (m_LoadFailure == FAIL_INITFAIL) { result.push_back(PROBLEM_INITFAIL); + } else if (m_LoadFailure == FAIL_SEMICOLON) { + result.push_back(PROBLEM_SEMICOLON); } else if (m_Runner != NULL) { if (!m_Runner->isPythonInstalled()) { // don't know how this could happen but wth @@ -244,6 +251,9 @@ QString ProxyPython::shortDescription(unsigned int key) const case PROBLEM_PYTHONDETECTION: { return tr("Python auto-detection failed"); } break; + case PROBLEM_SEMICOLON: { + return tr("ModOrganizer path contains a semicolon"); + } break; default: throw MyException(tr("invalid problem key %1").arg(key)); } @@ -276,6 +286,13 @@ QString ProxyPython::fullDescription(unsigned int key) const case PROBLEM_INITFAIL: { return tr("Sorry, I don't know any details. Most likely your python installation is not supported."); } break; + case PROBLEM_SEMICOLON: { + return tr("The path to Mod Organizer (%1) contains a semicolon.
" + "While this is legal on NTFS drives there is a lot of software that doesn't handle it correctly.
" + "Unfortunately MO depends on libraries that seem to fall into that group.
" + "As a result the python plugin can't be loaded.
" + "The only solution I can offer is to remove the semicolon / move MO to a path without a semicolon.").arg(QCoreApplication::applicationDirPath()); + } break; default: throw MyException(tr("invalid problem key %1").arg(key)); } diff --git a/src/proxy/proxypython.h b/src/proxy/proxypython.h index 31e808d..1b4da36 100644 --- a/src/proxy/proxypython.h +++ b/src/proxy/proxypython.h @@ -53,6 +53,7 @@ private: static const unsigned int PROBLEM_WRONGPYTHONPATH = 3; static const unsigned int PROBLEM_INITFAIL = 4; static const unsigned int PROBLEM_PYTHONDETECTION = 5; + static const unsigned int PROBLEM_SEMICOLON = 6; static const char *s_DownloadPythonURL; MOBase::IOrganizer *m_MOInfo; @@ -62,6 +63,7 @@ private: enum { FAIL_NONE, + FAIL_SEMICOLON, FAIL_NOTINIT, FAIL_MISSINGDEPENDENCIES, FAIL_INITFAIL,