Changeset 19594 for release-kits
- Timestamp:
- 2009-05-26T11:55:45+12:00 (15 years ago)
- Location:
- release-kits/shared
- Files:
-
- 2 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
release-kits/shared/linux/wrapper.cpp
r19510 r19594 2 2 #include <fstream> 3 3 #include <iomanip> 4 #include <cstring> 4 5 #include <cstdlib> 5 6 6 using namespace std; 7 7 8 #ifdef WEB 8 9 #include "wrapper.h" 9 10 #include "libsearch4j.h" 10 11 11 bool extract_bundled_file( const char[], int, char*, bool ); 12 #endif 12 13 13 14 int main(int argc, char** argv) { … … 15 16 char owd[1024]; 16 17 getcwd(owd, sizeof(owd)); 17 18 18 string scratch = (getenv("TMPDIR") == NULL) ? "/tmp" : getenv("TMPDIR"); 19 string tempdir = scratch + "/@[email protected]"; //temporary directory where we will store extracted files 20 string jarfile = tempdir + "/@[email protected]"; //where we will store the jar file 21 string javafile = tempdir + "/@java.installer@"; //where we will store the java tar file 19 string tempdir = scratch + "/greenstone-installer.tmp"; //temporary directory where we will store extracted files 22 20 bool succeeded = false; 23 21 bool textMode = false; … … 44 42 return 1; 45 43 } 44 45 #ifdef WEB 46 47 string jarfile = tempdir + "/@[email protected]"; //where we will store the jar file 48 string javafile = tempdir + "/@java.installer@"; //where we will store the java tar file 49 46 50 47 51 //extract files … … 62 66 } 63 67 68 #endif 69 64 70 //change to the temp directory 65 71 chdir( tempdir.c_str() ); 66 72 73 74 #ifdef WEB 67 75 #ifdef java_is_bundled 68 76 succeeded = (system( "/bin/sh -c ./@java.installer@ > /dev/null" ) == 0); … … 118 126 119 127 } 128 #endif 129 130 #ifdef CDROM 131 string cmd = ""; 132 cmd.append( owd ); 133 cmd.append( "/Java/Linux/jre/bin/java -Dorig.dir=\"" ); 134 cmd.append( owd ); 135 cmd.append( "\" -jar " ); 136 cmd.append( owd ); 137 cmd.append( "/Java/Jars/linux.jar" ); 138 system( cmd.c_str() ); 139 #endif 120 140 121 141 //change to the scratch dir for the following operation … … 129 149 130 150 } 131 151 #ifdef WEB 132 152 bool extract_bundled_file( const char data[], int size, char* filename, bool make_executable) { 133 153 … … 166 186 167 187 } 188 #endif -
release-kits/shared/windows/wrapper/wrapper.cpp
r19587 r19594 8 8 #include <shellapi.h> 9 9 #include <direct.h> 10 11 using namespace std; 12 13 #ifdef WEB 10 14 #include "libsearch4j.h" 11 12 using namespace std; 15 #endif 13 16 14 17 //globals … … 310 313 delete tmp; // deallocate memory 311 314 315 #ifdef WEB 312 316 //rip out java archive if it is bundled 313 317 set_splash_step( "XJAVA" ); … … 380 384 } 381 385 } 386 387 #endif 388 389 #ifdef CDROM 390 391 //ask if they want to install, then do it if so 392 int choice = MessageBox(NULL, "Install Greenstone?", "Greenstone", MB_OKCANCEL | MB_ICONQUESTION ); 393 if ( choice == IDOK ) { 394 395 //launch the jar 396 set_splash_step( "LAUNCHING" ); 397 spoof_progress( SPOOF_TIME ); 398 string cmd = "\""; 399 cmd.append( owd ); 400 cmd.append( "\\Java\\Windows\\jre\\bin\\java.exe\" \"-Dorig.dir=" ); 401 cmd.append( owd ); 402 cmd.append( "\" -jar greenstone.jar" ); 403 404 //hide splash screen 405 ShowWindow(splashWnd, SW_HIDE); 406 407 //run the jar 408 int launch_exit_code = process( cmd, false ); 409 } 410 411 #endif 382 412 383 413 //clean up the temp directory
Note:
See TracChangeset
for help on using the changeset viewer.