Changeset 22406

Show
Ignore:
Timestamp:
15.07.2010 09:57:01 (10 years ago)
Author:
sjm84
Message:

Upgraded the windows installer to have a -extract option for extracting the Java installer from the exe

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/release-kits/shared/windows/wrapper/wrapper.cpp

    r22223 r22406  
    264264     
    265265    const int SPOOF_TIME = 1000; 
    266     string command; 
     266    string command = lpCmdLine; 
     267 
     268    if(command.compare("-extract") || command.compare("--extract") || command.compare("-x")){ 
     269        printf("----------------------------\n"); 
     270        printf("Extracting java installer...\n"); 
     271        printf("----------------------------\n"); 
     272        int result = extractResource( "JAR", "JAR", "greenstone.jar" ); 
     273         
     274        if(result == 0){ 
     275            printf("\n"); 
     276            printf("Extraction complete\n"); 
     277            printf("You can now type java -jar greenstone.jar to run the installer from the command line\n"); 
     278            return 0;    
     279        } 
     280        else{ 
     281            return 1; 
     282        } 
     283    } 
     284    else if(command.compare("-text") == 0 || command.compare("text") == 0 ) 
     285    { 
     286        cerr << "-text is depricated, please use -extract and then run \"java -jar greenstone.jar text\"" << endl; 
     287    } 
     288     
    267289    srand( time(0) ); 
    268290    mainInstance = hInstance;