- bugfix: automatically removes a file from old NCC release that was interfering with the current version

- bugfix: fomod installer didn't find fomod files in nested folder
- bugfix: python proxy will now not even try to initialize python if python_dir contains no python.
This is necessary because the python interpreter crashes the application if the path is invalid
This commit is contained in:
Tannin
2013-09-05 21:04:20 +02:00
parent 6d99b33c61
commit 224627515a
5 changed files with 75 additions and 25 deletions
+13 -3
View File
@@ -1,5 +1,7 @@
#include "pythonrunner.h"
#pragma warning( disable : 4100 )
#pragma warning( disable : 4996 )
#include <boost/python.hpp>
#include <iplugininstaller.h>
@@ -8,6 +10,7 @@
#include "proxypluginwrappers.h"
#include <Windows.h>
#include <utility.h>
#include <QFile>
// sip and qt slots seems to conflict
#include <sip.h>
@@ -16,6 +19,7 @@
#include <boost/python.hpp>
#endif
MOBase::IOrganizer *s_Organizer = NULL;
@@ -44,8 +48,12 @@ private:
IPythonRunner *CreatePythonRunner(const MOBase::IOrganizer *moInfo, const QString &pythonDir)
{
PythonRunner *result = new PythonRunner(moInfo);
result->initPython(pythonDir);
return result;
if (result->initPython(pythonDir)) {
return result;
} else {
delete result;
return NULL;
}
}
@@ -624,7 +632,9 @@ static char* argv0 = "ModOrganizer.exe";
bool PythonRunner::initPython(const QString &pythonPath)
{
try {
//QString pythonPath = m_MOInfo->pluginSetting(name(), "python_dir").toString();
if (!pythonPath.isEmpty() && !QFile::exists(pythonPath + "/python.exe")) {
return false;
}
strncpy(m_PythonHome, pythonPath.toUtf8().constData(), MAX_PATH);
if (!pythonPath.isEmpty()) {
Py_SetPythonHome(m_PythonHome);