+ kiwix-launcher able to launch system xulrunner binary

pull/9/head
kelson42 12 years ago
parent 9ec15ba891
commit 461aa5c1f9

@ -98,17 +98,29 @@ int main(int argc, char *argv[]) {
} }
/* Find xulrunner (binary) path */ /* Find xulrunner (binary) path */
std::vector<std::string> xulrunnerPossibleNames;
xulrunnerPossibleNames.push_back(std::string("xulrunner") + std::string(EXEXT));
xulrunnerPossibleNames.push_back(std::string("xulrunner-bin") + std::string(EXEXT));
xulrunnerPossibleNames.push_back(std::string("xulrunner-") + std::string(GECKO_VERSION));
xulrunnerPossibleNames.push_back(std::string("xulrunner-") + std::string(GECKO_VERSION) +
std::string(".0"));
xulrunnerPossibleNames.push_back(std::string("xulrunner-") + std::string(MAJOR_GECKO_VERSION));
xulrunnerPossibleNames.push_back(std::string("xulrunner-") + std::string(MINOR_GECKO_VERSION));
std::vector<std::string>::iterator filesIt;
string xulrunnerPath; string xulrunnerPath;
directoriesIt = xulrunnerPossibleDirectories.begin(); directoriesIt = xulrunnerPossibleDirectories.begin();
while (xulrunnerPath.empty() && directoriesIt != xulrunnerPossibleDirectories.end()) { while (xulrunnerPath.empty() && directoriesIt != xulrunnerPossibleDirectories.end()) {
if (fileExists(*directoriesIt)) { if (fileExists(*directoriesIt)) {
xulrunnerPath = computeAbsolutePath(*directoriesIt, std::string("xulrunner-bin") + std::string(EXEXT)); filesIt = xulrunnerPossibleNames.begin();
if (!fileExists(xulrunnerPath)) { while (xulrunnerPath.empty() &&
xulrunnerPath = computeAbsolutePath(*directoriesIt, std::string("xulrunner") + std::string(EXEXT)); filesIt != xulrunnerPossibleNames.end()) {
xulrunnerPath = computeAbsolutePath(*directoriesIt, *filesIt);
if (!fileExists(xulrunnerPath)) { if (!fileExists(xulrunnerPath)) {
xulrunnerPath.clear(); xulrunnerPath.clear();
} }
} filesIt++;
};
} }
directoriesIt++; directoriesIt++;
} }
@ -134,7 +146,7 @@ int main(int argc, char *argv[]) {
"kiwix-windows/application.ini")); "kiwix-windows/application.ini"));
string applicationIniPath; string applicationIniPath;
std::vector<std::string>::iterator filesIt = applicationIniPossiblePaths.begin(); filesIt = applicationIniPossiblePaths.begin();
while (applicationIniPath.empty() && while (applicationIniPath.empty() &&
filesIt != applicationIniPossiblePaths.end()) { filesIt != applicationIniPossiblePaths.end()) {
if (fileExists(*filesIt)) { if (fileExists(*filesIt)) {

Loading…
Cancel
Save