Changeset 19848

Show
Ignore:
Timestamp:
15.06.2009 17:00:45 (10 years ago)
Author:
oranfry
Message:

changes that went in for the 2.82cd release

Location:
release-kits/shared/windows
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • release-kits/shared/windows/ant-scripts/windows-targets.xml

    r19326 r19848  
    88        </copy> 
    99    </target> 
     10     
     11    <target name="get-copy-of-wrapper-source"> 
     12        <copy todir="${todir}" overwrite="true"> 
     13            <fileset dir="${wirk2.home}/windows/wrapper"/> 
     14            <fileset dir="${wirk2.home}/greenstone2/wrapper" includes="*.bmp"/> 
     15            <fileset dir="${wirk2.home}/greenstone2/icon" includes="icon.ico"/> 
     16            <fileset dir="${wirk2.home}/core/search4j" includes="libsearch4j.cpp,libsearch4j.h"/> 
     17        </copy> 
     18    </target> 
     19 
    1020</project> 
  • release-kits/shared/windows/wirk.cpp

    r19846 r19848  
    8484    //create the command 
    8585    stringstream command; 
    86     command << "cmd.exe /c " << WIRK_HOME << "\\core\\ant\\bin\\ant.bat -f \"" << WIRK_HOME << "\\ant-scripts\\build.xml\" -addressing \"-Dwirk" << XXX << ".home=" << WIRK_HOME << "\""; 
     86    command << "c:\\windows\\cmd.exe /c " << WIRK_HOME << "\\core\\ant\\bin\\ant.bat -f \"" << WIRK_HOME << "\\ant-scripts\\build.xml\" -addressing \"-Dwirk" << XXX << ".home=" << WIRK_HOME << "\""; 
    8787 
    8888    //pass on the arguments 
  • release-kits/shared/windows/wrapper/wrapper.cpp

    r19594 r19848  
    1111using namespace std; 
    1212 
    13 #ifdef WEB 
     13#ifndef CDROM 
    1414#include "libsearch4j.h" 
    1515#endif 
     
    294294     
    295295    //get the original working directory 
    296     char* owd = _getcwd(NULL, 1024); 
    297      
     296    char* owdChar = _getcwd(NULL, 1024); 
     297    string owd = ""; 
     298    owd.append( owdChar ); 
     299    delete owdChar; 
     300     
     301    //strip trailing slash 
     302    if ( owd.substr(owd.length()-1,1).compare( "\\" ) == 0 ) { 
     303        owd = owd.substr(0, owd.length()-1); 
     304    } 
     305         
    298306    //using the users TMP directory for temp files rather than the current directory so 
    299307    //installation from cdrom works 
     
    305313        string title = "Failed to create the temp folder."; 
    306314        string message = "Failed to create the temp folder.\nPlease set the environment variable TMP to a folder you have permission to write to."; 
    307         ShowWindow(splashWnd, SW_HIDE); //hide splash screen 
    308         MessageBox(NULL, message.c_str(), title.c_str(), MB_OK); 
     315        //ShowWindow(splashWnd, SW_HIDE); //hide splash screen 
     316        MessageBox(splashWnd, message.c_str(), title.c_str(), MB_OK); 
    309317        return -1; 
    310318    } 
     
    313321    delete tmp; //  deallocate memory 
    314322     
    315     #ifdef WEB 
     323    #ifdef CDROM 
     324 
     325    //ask if they want to install, then do it if so 
     326    int choice = MessageBox(splashWnd, "Install Greenstone?", "Greenstone", MB_OKCANCEL | MB_ICONQUESTION ); 
     327    if ( choice == IDOK ) { 
     328 
     329        //prepare to launch the jar 
     330        set_splash_step( "LAUNCHING" ); 
     331        spoof_progress( SPOOF_TIME ); 
     332     
     333        string cmd = "\""; 
     334        cmd.append( owd ); 
     335        cmd.append( "\\Java\\Windows\\jre\\bin\\java.exe\" \"-Dorig.dir=" ); 
     336        cmd.append( owd ); 
     337        cmd.append( "\" -jar \"" ); 
     338        cmd.append( owd ); 
     339        cmd.append( "\\Java\\Jars\\windows.jar\"" ); 
     340        char cmdLpstr[1024]; 
     341        strcpy( cmdLpstr, cmd.c_str() ); 
     342         
     343         
     344        STARTUPINFO si; 
     345        PROCESS_INFORMATION pi; 
     346        memset(&pi, 0, sizeof(pi)); 
     347        memset(&si, 0, sizeof(si)); 
     348        si.cb = sizeof(si); 
     349        DWORD dwExitCode = -1; 
     350 
     351        //hide splash screen 
     352        ShowWindow(splashWnd, SW_HIDE); 
     353 
     354        //launch the jar 
     355        bool result; 
     356        result = CreateProcess(NULL, cmdLpstr, NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi); 
     357 
     358        WaitForSingleObject(pi.hProcess, INFINITE); 
     359        GetExitCodeProcess(pi.hProcess, &dwExitCode); 
     360        CloseHandle(pi.hThread); 
     361        CloseHandle(pi.hProcess); 
     362 
     363    }    
     364    #else 
     365 
    316366    //rip out java archive if it is bundled 
    317367    set_splash_step( "XJAVA" ); 
     
    348398         
    349399        string title = "Installation Failed: Couldn't find java"; 
    350         ShowWindow(splashWnd, SW_HIDE); //hide splash screen 
    351         MessageBox(NULL, message.c_str(), title.c_str(), MB_OK); 
     400        //ShowWindow(splashWnd, SW_HIDE); //hide splash screen 
     401        MessageBox(splashWnd, message.c_str(), title.c_str(), MB_OK); 
    352402 
    353403    //if java was found, carry on 
     
    380430            string title = "Installation Error"; 
    381431            string message = "The installation exited with an error. Java may not be installed properly, or the installation may have been interrupted partway through. Please try again."; 
    382             ShowWindow(splashWnd, SW_HIDE); //hide splash screen 
     432            //ShowWindow(splashWnd, SW_HIDE); //hide splash screen 
    383433            MessageBox(NULL, message.c_str(), title.c_str(), MB_OK); 
    384434        } 
    385435    } 
    386  
    387436    #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 
    412437     
    413438    //clean up the temp directory 
     439    _unlink( "ant.install.log" ); 
     440    #ifndef CDROM 
    414441    _unlink( "greenstone.jar" ); 
    415     _unlink( "ant.install.log" ); 
    416442    _unlink( "@java.installer@" ); 
    417443    process( "cmd.exe /c rd /s /q @java.extracted@", false ); 
     444    #endif 
     445 
    418446    SetCurrentDirectory( ".." ); 
    419447    _rmdir( tempdir.c_str() ); 
    420  
    421     delete owd; 
    422448     
    423449    return 0;