Changeset 16207
- Timestamp:
- 2008-06-26T14:40:53+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
release-kits/shared/linux/wrapper.cpp
r16089 r16207 6 6 7 7 #include "wrapper.h" 8 #include "libsearch4j.h" 8 9 9 10 bool extract_bundled_file( const char[], int, char*, bool ); … … 13 14 string tempdir = "greenstone.tmp"; //temporary directory where we will store extracted files 14 15 string jarfile = tempdir + "/@[email protected]"; //where we will store the jar file 15 string search4jfile = tempdir + "/search4j"; //where we will store the jar file16 16 string javafile = tempdir + "/@java.installer@"; //where we will store the java tar file 17 17 bool succeeded = false; … … 30 30 cout << "Extracting installer jar..." << endl; 31 31 succeeded = extract_bundled_file( @installer.name@jar, sizeof(@installer.name@jar), (char*)jarfile.c_str(), false); 32 33 cout << "Extracting search4j tool..." << endl;34 succeeded = extract_bundled_file( search4j, sizeof(search4j), (char*)search4jfile.c_str(), true ) && succeeded;35 32 36 33 #ifdef java_is_bundled … … 61 58 62 59 //check if an appropriate java is found 63 bool jvmFound = (system( "./search4j -m @java.min.version@ -h ./@java.extracted@" ) == 0); 60 Jvm minimum; minimum.setVersionFromString( "@java.min.version@" ); 61 string hint = "./@java.extracted@"; 62 Jvm foundJvm; 63 bool jvmFound = find( foundJvm, true, minimum, hint, false ); 64 64 65 65 //if the jvm was not found, report not found … … 70 70 71 71 //tell them if java is absent or just too old 72 if ( system( "./search4j -h ./@java.extracted@" ) == 0 ) { 72 Jvm tmpJvm; 73 if ( find(tmpJvm,false,minimum,hint,false) ) { 73 74 cout << "You have java, but it is too old." << endl; 74 75 } else { 75 76 cout << "Could not find java on your system." << endl; 76 77 } 78 tmpJvm = NULL; 77 79 78 80 cout << "Install java (@java.min.version@ or greater) and set JAVA_HOME or JRE_HOME, and try again" << endl; … … 86 88 cout << "Launching Installer ..." << endl; 87 89 int launch_exit_code = 0; 88 launch_exit_code = system( "./search4j -m @java.min.version@ -l @[email protected] -h ./@java.extracted@");90 launch_exit_code = system( foundJvm.getExecutable() + " -jar @[email protected]" ); 89 91 90 92 //report how it went
Note:
See TracChangeset
for help on using the changeset viewer.