From aa2b73295471a73c08b50ce913ba810d0f3eb240 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sun, 24 May 2015 00:11:53 -0400 Subject: [PATCH] Fix directories searched for input files on Windows Update to use the registry key for Cantera 2.2. The 'templates' subdirectory no longer exists. Fix documentation to not incorrectly claim that COMMONPROGRAMFILES will be searched for input files. --- include/cantera/base/global.h | 9 ++++----- src/base/application.cpp | 7 +++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/cantera/base/global.h b/include/cantera/base/global.h index 05f3490aa..43c31fc83 100644 --- a/include/cantera/base/global.h +++ b/include/cantera/base/global.h @@ -66,11 +66,10 @@ void popError(); * for input files along a path that includes platform-specific default * locations, and possibly user-specified locations. * - * The current directory (".") is always searched first. Then, on Windows - * platforms, if environment variable COMMONPROGRAMFILES is set (which it - * should be on Win XP or Win 2000), then directories under this one will be - * added to the search path. The %Cantera Windows installer installs data - * files to this location. + * The current directory (".") is always searched first. Then, on Windows, the + * registry is checked to find the Cantera installation directory, and the + * 'data' subdirectory of the installation directory will be added to the search + * path. * * On the Mac, directory '/Applications/Cantera/data' is added to the * search path. diff --git a/src/base/application.cpp b/src/base/application.cpp index 8d51861c7..8f41bd9d2 100644 --- a/src/base/application.cpp +++ b/src/base/application.cpp @@ -410,15 +410,14 @@ void Application::setDefaultDirectories() #ifdef _WIN32 // Under Windows, the Cantera setup utility records the installation - // directory in the registry. Data files are stored in the 'data' and - // 'templates' subdirectories of the main installation directory. + // directory in the registry. Data files are stored in the 'data' + // subdirectory of the main installation directory. std::string installDir; - readStringRegistryKey("SOFTWARE\\Cantera\\Cantera 2.0", + readStringRegistryKey("SOFTWARE\\Cantera\\Cantera 2.2", "InstallDir", installDir, ""); if (installDir != "") { dirs.push_back(installDir + "data"); - dirs.push_back(installDir + "templates"); // Scripts for converting mechanisms to CTI and CMTL are installed in // the 'bin' subdirectory. Add that directory to the PYTHONPATH.