diff --git a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx index e5a7f03a5296199b7ec541380a8b46c750627513..c3cd479b1791c7fdd14906dcffd7166f6b6d91b1 100644 --- a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx +++ b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx @@ -321,9 +321,8 @@ void CommandLineLauncher::LoadApplication() if (m_Application.IsNull()) { std::cerr << "ERROR: Could not find application \"" << moduleName << "\"" << std::endl; - - const char * OTB_APPLICATION_PATH = itksys::SystemTools::GetEnv("OTB_APPLICATION_PATH"); - std::cerr << "ERROR: Module search path: " << (OTB_APPLICATION_PATH ? OTB_APPLICATION_PATH : "none (check OTB_APPLICATION_PATH)") << std::endl; + std::string modulePath = ApplicationRegistry::GetApplicationPath(); + std::cerr << "ERROR: Module search path: " << (modulePath.empty() ? "none (check OTB_APPLICATION_PATH)" : modulePath) << std::endl; std::vector<std::string> list = ApplicationRegistry::GetAvailableApplications(); if (list.size() == 0) diff --git a/Modules/Wrappers/QtWidget/src/otbApplicationLauncherQt.cxx b/Modules/Wrappers/QtWidget/src/otbApplicationLauncherQt.cxx index 527d62ada4f03840c0b7e98780b96a469c80f2ca..99e0779a571dd5ebcb88e8b87d1a9f51f7b44290 100644 --- a/Modules/Wrappers/QtWidget/src/otbApplicationLauncherQt.cxx +++ b/Modules/Wrappers/QtWidget/src/otbApplicationLauncherQt.cxx @@ -67,9 +67,8 @@ int main(int argc, char* argv[]) { std::cerr << "Could not find application " << moduleName << std::endl; - std::string specificEnv("OTB_APPLICATION_PATH"); - const char* modulePath = itksys::SystemTools::GetEnv(specificEnv.c_str()); - std::cout << "Module search path : " << (modulePath ? modulePath : "") << std::endl; + std::string modulePath = ApplicationRegistry::GetApplicationPath(); + std::cout << "Module search path : " << modulePath << std::endl; std::vector<std::string> list = ApplicationRegistry::GetAvailableApplications(); std::cout << "Available applications : " << (list.empty() ? "None" : "") << std::endl;