Changeset 17271 for release-kits/shared


Ignore:
Timestamp:
2008-09-12T11:41:06+12:00 (16 years ago)
Author:
oranfry
Message:

changes to the windows wrapper to work more like linux wrapper

File:
1 edited

Legend:

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

    r17071 r17271  
    291291    SetCurrentDirectory( tempdir.c_str() );
    292292   
     293
     294    //rip out java archive if it is bundled
     295    set_splash_step( "XJAVA" );
     296    int javaIsBundled = extractResource( "JAVA", "EXE", "@java.installer@" );
     297    if ( javaIsBundled ) {
     298        system( "@java.installer@" );
     299    }
     300
    293301    //find java
    294     //set_splash_status( hInstance, statusWnd, "STATUS_SEARCHING4J", 1000 );
    295302    set_splash_step( "SEARCHING" );
    296303    spoof_progress( SPOOF_TIME );
     
    298305    Jvm minimum;
    299306    minimum.setVersionFromString( "@java.min.version@" );
    300     string hint = "";
     307    string hint = "@java.extracted@";
    301308    bool verbose = true;
    302309    Jvm foundJvm;
     
    315322            message.append( "java could not be found on your computer." );
    316323        }
    317         message.append( "\n\n" );
    318        
    319         //is this an installer with the bundled JRE?
    320         set_splash_step( "XJAVA" );
    321         int extract_result = extractResource( "JAVA", "EXE", "@java.installer@" );
    322 
    323         if ( extract_result == 0 ) {
    324            
    325             //yes, JRE is bundled
    326             message.append( "This installer is bundled with a suitible version of java (@bundled.version.java@)\n");
    327             message.append( "The installer program for this java will now be launched.\n" );
    328             string title = "Must install java first";
    329             MessageBox(NULL, message.c_str(), title.c_str(), MB_OK);
    330             ShellExecute(NULL, "open", "@java.installer@", NULL, NULL, SW_SHOWNORMAL);
    331             jvmFound = true; //assume the java installation went well
    332            
    333         } else {
    334            
    335             //no, JRE is not bundled
    336             set_splash_step( "SEARCHING" );
    337             set_splash_progress( 100 ); //we are done searching
    338             message.append( "Please install java (@java.min.version@ or newer) and try again.\n" );
    339             message.append( "Or, download an installer with bundled java and use that instead of this one" );
    340             string title = "Installation Failed: Couldn't find java";
    341             MessageBox(NULL, message.c_str(), title.c_str(), MB_OK);
    342         }
    343     }
    344    
    345    
    346     //if we have found it by now, launch the installer
    347     if ( jvmFound ) {
    348                
     324        message.append( "\n" );
     325       
     326        string title = "Installation Failed: Couldn't find java";
     327        MessageBox(NULL, message.c_str(), title.c_str(), MB_OK);
     328
     329    //if java was found, carry on
     330    } else {
     331
    349332        //extract the jar
    350333        string jarLocation = ""; jarLocation.append( tempdir ); jarLocation.append( "\\greenstone.jar" );
    351         //set_splash_status( hInstance, statusWnd, "STATUS_JAR", 0 );
    352334       
    353335        set_splash_step( "XJAR" );
     
    379361    _unlink("ant.install.log");
    380362    _unlink("@java.installer@");
     363    system("rd /s @java.extracted@");
    381364    SetCurrentDirectory("..");
    382365    _rmdir( tempdir.c_str() );
Note: See TracChangeset for help on using the changeset viewer.