Fixed setup of data directories on Windows

This commit is contained in:
Ray Speth 2012-04-16 20:59:48 +00:00
parent f5dc3480c7
commit d4adf41799

View file

@ -649,21 +649,20 @@ void Application::setDefaultDirectories()
std::string installDir;
readStringRegistryKey("SOFTWARE\\Cantera\\Cantera 2.0",
"InstallDir", installDir, "");
if (installDir == "") {
return;
}
dirs.push_back(installDir + "data");
dirs.push_back(installDir + "templates");
if (installDir != "") {
dirs.push_back(installDir + "data");
dirs.push_back(installDir + "templates");
// Scripts for converting mechanisms to CTI and CMTL formats are installed
// In the 'bin' subdirectory. Add that directory to the PYTHONPATH.
const char* old_pythonpath = getenv("PYTHONPATH");
std::string pythonpath = "PYTHONPATH=" + installDir + "\\bin";
if (old_pythonpath) {
pythonpath += ";";
pythonpath.append(old_pythonpath);
// Scripts for converting mechanisms to CTI and CMTL are installed in
// the 'bin' subdirectory. Add that directory to the PYTHONPATH.
const char* old_pythonpath = getenv("PYTHONPATH");
std::string pythonpath = "PYTHONPATH=" + installDir + "\\bin";
if (old_pythonpath) {
pythonpath += ";";
pythonpath.append(old_pythonpath);
}
putenv(pythonpath.c_str());
}
putenv(pythonpath.c_str());
#endif